If your administration is as good as anybodies, you are bound to loose the not-so-frequently used password for the SYS and SYSTEM users of oracle. Here are a few ways I found to re-set those passwords:
Method 1: SQLPLUS (Tested on AIX Oracle 9.2.0.1.0)
Log into the database server as a user belonging to ‘dba’ [unix ] or ‘ora_dba’ [windows ] group , typically ‘oracle’, or an administrator on your windos machine. You are able to log into Oracle as SYS user, and change the SYSTEM password by doing the following:
$ sqlplus "/ as sysdba" SQL*Plus: Release 9.2.0.1.0 - Production on Mon Apr 5 15:32:09 2004 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production With the OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production SQL> show user USER is "SYS" SQL> passw system Changing password for system New password: Retype new password: Password changed SQL> quit
Next, we need to change the password of SYS:
$ sqlplus "/ as system" SQL*Plus: Release 9.2.0.1.0 - Production on Mon Apr 5 15:36:45 2004 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. SP2-0306: Invalid option. Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] where <logon> ::= <username>[/<password>][@<connect_string>] | / Enter user-name: system Enter password: Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production With the OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production SQL> passw sys Changing password for sys New password: Retype new password: Password changed SQL> quit
You should now be able to log on the SYS and SYSTEM users, with the passwords you just typed in.
Method 2: Creating pwd file (Tested on Windows Oracle 8.1.7)
- Stop the Oracle service of the instance you want to change the passwords of.
- Find the PWD###.ora file for this instance, this is usuallly located atC:\oracle\ora81\database\, where ### is the SID of your database.
- rename the PWD###.ora file to PWD###.ora.bak for obvious safety reasons.
- Create a new pwd file by issuing the command:
orapwd file=C:\oracle\ora81\database\PWD###.ora password=XXXXX
where ### is the SID and XXXXX is the password you would like to use for the SYS and INTERNAL accounts. - Start the Oracle service for the instance you just fixed. You should be able to get in with the SYS user and change other passwords from there.
Add this blog to your reader
Thursday 2009-03-19 at 15:29 GMT +0000 |
Stop the Oracle service of the instance you want to change the passwords of.
Find the PWD###.ora file for this instance, this is usuallly located atC:\oracle\ora81\database\, where ### is the SID of your database.
rename the PWD###.ora file to PWD###.ora.bak for obvious safety reasons.
Create a new pwd file by issuing the command:
orapwd file=C:\oracle\ora81\database\PWD###.ora password=XXXXX
where ### is the SID and XXXXX is the password you would like to use for the SYS and INTERNAL accounts.
Start the Oracle service for the instance you just fixed. You should be able to get in with the SYS user and change other passwords from there.
My question is where to execute this
Create a new pwd file by issuing the command:
orapwd file=C:\oracle\ora81\database\PWD###.ora password=XXXXX
Thursday 2009-03-19 at 17:05 GMT +0000 |
“orapwd” is a utility which is part of your oracle installation. There is probably a path set to it, which means you can execute it anywhere you like, as long as it points to the correct file with the “file=…” parameter, as described.
Saturday 2009-04-18 at 15:57 GMT +0000 |
And here’s some info on resetting passwords for Windows users (in this case, the postgres user): http://www.guusbosman.nl/node/2531
Saturday 2009-04-25 at 06:12 GMT +0000 |
I tried method 2 on Oracle 9.2 on windows 2000. It seems to work fine but I used TOAD to reconnect to the database as sysdba (with user SYS). Then I changed the System password. what is the exact script to reconnect as sysdba using SQLPLUS.
Thanks in advance for your help.
Pierre
Saturday 2009-04-25 at 10:52 GMT +0000 |
To connect as sys/sysdba, you can use the first blue command in method 1 (sqlplus “/ as sysdba”) on a command prompt.
Wednesday 2009-05-20 at 16:41 GMT +0000 |
In 10g, the first method works, but you have to enter normally:
sqlplus system/@
because “/ as system” doesn’t work.
Sunday 2009-11-01 at 02:46 GMT +0000 |
Can I translate this article and publish it on my blog with link to this page?
Sunday 2009-11-01 at 12:42 GMT +0000 |
Sure, feel free!