上面的输出很明显再次看到主库中的密码文件变更不会自动传播到备库。
但是事实上,我们在备库kokki上依旧可以使用原来的密码文件,如下:
SQL> connect sys/oracle@kokki as sysdba
Connected.
然后第二个问题是:如果密码文件已经不一致的情况下,redo是否能够正常传输?对这个问题,我们在主库切换一次日志来验证一下。
SQL> connect sys/prutser@peppi as sysdba
Connected.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
DGMGRL> show configuration;
Configuration - PeppiEnKokki
Protection Mode: MaxPerformance
Databases:
peppi - Primary database
kokki - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
通过上面的输出我们可以看到,竟然结果都是正常的,很明显密码文件的变化不会直接影响到redo的传输,这是因为主库和备库已经建立了连接,对于redo的部分,备库就不需要再次获得主库的重新认证了。但是一旦重置redo的传输,就会很清楚的看到会存在问题。
DGMGRL> edit database kokki set property LogShipping=off;
Property "logshipping" updated
DGMGRL> edit database kokki set property LogShipping=on;
Property "logshipping" updated
DGMGRL> show configuration;
Configuration - PeppiEnKokki
Protection Mode: MaxPerformance
Databases:
peppi - Primary database
Error: ORA-16778: redo transport error for one or more databases
kokki - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
ERROR
通过这可以很清晰的看到redo的传输中断了然后提示了ORA-16778的错误,如果主库的密码文件一旦发生改变,那么不会马上暴露出问题,但是可能在后来的某一个时间点爆发。
那么ORA-16778 错误代表什么含义?
$ oerr ora 16778
16778, 00000, "redo transport error for one or more databases"
// *Cause: The redo transport service was unable to send redo data to one
// or more standby databases.
// *Action: Check the Data Guard broker log and Oracle alert log for
// more details. Query the LogXptStatus property to see the
// errors.
我们刚刚已经在主库修改了sys的密码,这个时候的问题是怎么修复?
探索答案:
可能我们可以简单的通过在kokki上面重建密码文件得以解决,让我们试一试。
el5$ rm $ORACLE_HOME/dbs/orapwv1120
el5$ orapwd file=$ORACLE_HOME/dbs/orapwv1120 password=prutser
SQL> connect sys/prutser@kokki as sysdba
Connected.
看起来似乎是可以的,但是问题是dataguard是否如此乐观的认为问题已经解决了呢?
SQL> connect sys/prutser@peppi as sysdba
Connected.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
DGMGRL> show configuration;
Configuration - PeppiEnKokki
Protection Mode: MaxPerformance
Databases:
peppi - Primary database
Error: ORA-16778: redo transport error for one or more databases
kokki - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
ERROR
这个时候发现情况没有看上去那么好了,是不是我们需要重置一下redo的传输,我们来简单验证一下。
DGMGRL> edit database kokki set property LogShipping=off;
Property "logshipping" updated
DGMGRL> edit database kokki set property LogShipping=on;
Property "logshipping" updated
DGMGRL> show configuration;
Configuration - PeppiEnKokki
Protection Mode: MaxPerformance
Databases:
peppi - Primary database
Error: ORA-16778: redo transport error for one or more databases
kokki - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
ERROR