SYS password

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

 

Change SYS password, PrimDB & StandbyDB

Create backup of the password file on PrimDB:

cp /u02/app/oracle/product/11.2.0/db_2/dbs/orapwPRIMDB /u02/app/oracle/product/11.2.0/db_2/dbs/orapwPRIMDDB.bak

Whenever you change the password of the sys user in primary, you need to follow the above step

To create the password file of sys user in primary, use the orapwd utility

orapwd file=<$ORACLE_HOME/dbs/orapw<SID>> password=<password> entries=<n> force=y

Once this is done, you can just copy it to the standby database server to the location mentioned earlier and rename it to orapw<STANDBY SID>

 

Troubleshooting

[oracle@primdb ~]$ tail -100f /u02/app/oracle/diag/rdbms/proddb/PRIMDB/trace/alert_PRIMDB.log

Error 1017 received logging on to the standby
------------------------------------------------------------
Check that the primary and standby are using a password file
and remote_login_passwordfile is set to SHARED or EXCLUSIVE,
and that the SYS password is same in the password files.
      returning error ORA-16191
------------------------------------------------------------

1. Changed the password for sys on PrimDB
2. Could not change on StandbyDB since it was mounted
3. No password file exist on prod but created one on the StandbyDB with sys password same as in PrimD
4. Parameter remote_login_passwordfile is set for both. Can we connect?
sqlplus sys/pwd as sysdba
5. Remember to cancel recovery and restart the StandbyDB on the new password file

Copy the password file of the primary to the standby database server and place it in $ORACLE_HOME/dbs location

Later, you need to rename this file to orapw<STANDBY SID>

PrimDB:

SQL> show parameter remote_login_passwordfile 	 NAME                                 TYPE        VALUE
	------------------------------------ ----------- ------------------------------
	 remote_login_passwordfile            string      EXCLUSIVE

StandbyDB:

SQL> show parameter remote_login_passwordfile 	 NAME                                 TYPE        VALUE
	------------------------------------ ----------- ------------------------------
	 remote_login_passwordfile            string      EXCLUSIVE

PrimDB:

SQL> select * from v$pwfile_users;no rows selected

StandbyDB :

SQL> select * from v$pwfile_users; 	 USERNAME                       SYSDB SYSOP SYSAS
	------------------------------ ----- ----- -----
	 SYS                            TRUE  TRUE  FALSE

If so, recreate password on the PrimDB should help us

Linux: 

$ cd ORACLE_HOME/dbs
$ orapwd file=orapw$ORACLE_SID password=****** entries=10 force=y

Windows:

go to ORACLE_HOME/database 
c:\> orapwd file=PWD<ORACLE_SID>.ora password=****** entries=10 force=y

Then copy this password file to StandbyDB in same location and rename it as per the ORACLE_SID of StandbyDB.
Then check the view v$pwfile_users again

 

TEST CONNECTION and ERRORS

SQL> show parameter LOG_ARCHIVE_DEST; 	…
	log_archive_dest_2        string     service=STANDBYDB1 arch reopen=30
	log_archive_dest_3        string     service=STANDBYDB2 arch reopen=30
	…
$ tnsping STANDBYDB1
$ tnsping STANDBYDB2
[oracle@primdb ~]$ sqlplus /nolog
SQL> conn sys/Pa$$w0rd@STANDBYDB2 as sysdba
[oracle@primdb ~]$ sqlplus / as sysdba
SQL> select inst_id,error from gv$archive_Dest_status where dest_id=2;
SQL> select inst_id,error from gv$archive_Dest_status where dest_id=3;
[oracle@primdb ~]$ sqlplus sys/Pa$$word@StandbyDB as sysdba
[oracle@stabdbydb ~]$ sqlplus sys/Pa$$word@ProdDB as sysdba

Newsletter

Enter your email to join our mailing list

Quick Contact