Search This Blog

Tuesday, September 20, 2011

How to Change / Recover Lost SYS password

How to change / recover lost sys password?
there are following method to change sys password , each depends on type of password authentication

Method: 1
1. connect to database with sysdba user and execute (on server where oracle is installed)
SQL> alter user sys identified by password;

Method: 2
1. connect to database with sysdba user and execute (on server where oracle is installed)
SQL> passw

This command will ask you old password and new password

Method: 3
re-create password file (on server where oracle is installed)
1. connect to database with sysdba user
1.1 make sure "remote_login_password" parameter is set to SHARED or EXCLUSIVE
2. shutdown immediate
3. backup existing password file (password file located under $ORACLE_HOME/dbs directory)
$ORACLE_HOME/dbs $mv orapwSID.ora orapwSID.ora.bk

4. create new password file
$ORACLE_HOME/bin $orapwd file=$ORACLE_HOME/dbs/orapwSID.ora password=oracle entries=5

5. start oracle database



Method: 5

If oracle password is based on OS authentication then use the following way
1. Make user OS user is logged with member of dba group (on linux) , ORA_DBA group (on windows)

#1. Make sure that the OS user that is logged on is member of the dba group. If the dba group is not known, check the file:

$ORACLE_HOME/rdbms/lib/config.c (or config.s)
#2. Make sure that the sqlnet.ora file does not contain the:

sqlnet.authentication_services
parameter. If this parameter exist, it should be commented.

#3. check the ORACLE_HOME, ORACLE_SID and PATH parameters. They must correspond to the parameters of the Oracle instance where the SYS password has been lost.

If the instance is already started, use the document:

#4. connect to the instance using:

sqlplus /nolog
connect / as sysdba
#5. Change the sys password using:
alter user sys identified by password;

If a passwordfile is in use, the command would update the password file as well, so there is no need to recreate this file.

No comments: