ORA-16191: The "Unable to Log On to Standby" Error
TT00 (PID:184449): Error 1017 received logging on to the standby
TT00 (PID:184449): -------------------------------------------------------------------------
TT00 (PID:184449): Check that the source and target databases are using a password file
TT00 (PID:184449): and remote_login_passwordfile is set to SHARED or EXCLUSIVE,
TT00 (PID:184449): and that the SYS password is same in the password files,
TT00 (PID:184449): returning error ORA-16191
TT00 (PID:184449): -------------------------------------------------------------------------
The ORA-16191 error, "unable to log on to standby," is a specific and critical issue for Oracle Data Guard professionals. This error occurs when a primary database process (specifically a Transport process, or TT00) fails to establish a connection to its designated standby database. The error message you've provided, which includes the underlying ORA-01017 ("invalid username/password") error, points directly to a password file synchronization problem. This guide will provide a detailed explanation of the error, a systematic approach to diagnosis, and the precise steps to resolve the issue and ensure your Data Guard environment is robust.
The Foundation: Data Guard and Password Files
To understand ORA-16191, you must be familiar with the core components of Oracle Data Guard and how they interact.
Transport Processes (
TT00): These are background processes on the primary database responsible for transporting redo data to the standby. They must be able to log in to the standby database's instance to deliver the redo logs.Password File: This is an external file that stores the encrypted passwords for privileged users like
SYS,SYSTEM, andSYSMAN. It allows for privileged connections (e.g., asSYSDBA) without requiring the password to be exposed in a connection string.REMOTE_LOGIN_PASSWORDFILE: This parameter, set toSHAREDorEXCLUSIVE, tells the database to use the password file for remote privileged connections. In a Data Guard environment, this is crucial for the primary database to authenticate with the standby.
The ORA-16191 error, as seen in your message, is a direct result of a failure in this authentication process. The primary database process is attempting to connect to the standby as SYS, but the password it's using (from its local password file) does not match the password stored in the standby database's password file. The standby database rejects the connection with ORA-01017.
The Breakdown: Why the Passwords Don't Match
Password file mismatch in a Data Guard setup is a common issue, and it can happen for several reasons:
Manual Password Change: A user or script changed the
SYSpassword on the primary database usingALTER USER SYS IDENTIFIED BY new_password;but did not copy the new password file to the standby. The password file is not automatically synchronized by Data Guard.Password File Corruption: The password file on either the primary or standby database could be corrupt, leading to an authentication failure.
Standby Creation Issues: The standby database was created without a proper copy of the primary's password file, or the password file was not copied correctly after a password change during the initial setup.
Diagnosis: Pinpointing the Problem
Before you can fix the password file, you need to verify the mismatch.
Check
REMOTE_LOGIN_PASSWORDFILE: First, ensure the parameter is correctly set on both primary and standby databases.SQLSHOW PARAMETER remote_login_passwordfile; -- It should be SHARED or EXCLUSIVECheck
V$LOGSTDBY_PROCESSon the Primary: This view can provide information about theTT00process. Look for theSTATUScolumn, which will confirm the failure to connect.SQLSELECT process, status, error FROM V$LOGSTDBY_PROCESS;(Note: This is more for logical standby, but similar views exist for physical standby).
Verify Password Files: This is the most crucial step. Use a tool like
orapwdto verify the existence and modification times of the password files.Primary:
$ORACLE_HOME/bin/orapwd file=$ORACLE_HOME/dbs/orapw<sid> force=y(Don't run this, just check the file).ls -l $ORACLE_HOME/dbs/orapw<sid>Standby: ls -l $ORACLE_HOME/dbs/orapw<sid>
A recent password change on the primary that wasn't mirrored on the standby will be evident in the file's timestamp.
Resolution: A Practical Guide
The resolution for ORA-16191 is straightforward: you must make the password files identical.
Reset the SYS Password on the Primary: The safest and most foolproof method is to reset the
SYSpassword on the primary database, which will generate a new password file, and then copy it to the standby.Step A: Connect to the Primary Database as
SYSDBAand shut it down.
SQLsqlplus / as sysdba SHUTDOWN IMMEDIATE;Step B: Use
orapwdto create a new password file on the primary.
Bashcd $ORACLE_HOME/dbs orapwd file=orapw<sid> password=new_sys_password entries=10 force=yStep C: Start the primary database.
SQLSTARTUP;Step D: Copy the new password file to the standby server.
Bashscp $ORACLE_HOME/dbs/orapw<sid> oracle@standby_server_hostname:$ORACLE_HOME/dbs/Restart the Standby Database: The standby database needs to be restarted to load the new password file.
Step A: Connect to the Standby Database as
SYSDBAand shut it down.
SQLsqlplus / as sysdba SHUTDOWN IMMEDIATE;Step B: Start the standby database and restart the managed recovery process.
SQLSTARTUP NOMOUNT; ALTER DATABASE MOUNT STANDBY DATABASE; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;After these steps, the
TT00process on the primary should be able to log into the standby without error, and redo transport will resume.
Video Resources
Oracle Data Guard: Physical Standby Configuration
Managing Oracle Password Files
Conclusion
The ORA-16191 error, when combined with ORA-01017, is a clear indicator that the password files between your primary and standby databases are out of sync. This is a critical issue that halts the transfer of redo data, breaking your Data Guard protection. The resolution is to generate a new password file on the primary database and securely copy it to the standby server. By understanding the role of password files in a Data Guard environment, you can quickly diagnose and resolve this issue, ensuring the high availability and disaster recovery capabilities of your Oracle database.
No comments:
Post a Comment