在做节前环境巡检时,欧博abg发现数据库alert日志在2022-09-29 00:10:14的时候突然报ORA-16191,一直报到现在。ORA-16191一般为主备库的密码不致导致的。但0点不可能有人为操作,备份及日志清理脚本也不会影响到密码文件。因此主备库的密码文件应该是不会有什么变更的,这个问题就很有奇怪了。 alert 报错日志: Thu Sep 29 00:10:14 2022 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 ------------------------------------------------------------ FAL[server, ARC2]: Error 16191 creating remote archivelog file 'standby1' FAL[server, ARC2]: FAL archive failed, see trace file. ARCH: FAL archive failed. Archiver continuing ORACLE Instance db - Archival Error. Archiver continuing.DG同步时间监控也没有预警:(此库为数据变动很小的库) 参数:remote_login_passwordfile SQL> show parameter remote_login_passwordfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ remote_login_passwordfile string EXCLUSIVE 测试一:数据库版本:Release 11.2.0.3.0 主库修改密码,不同步密码文件 1、主库修改sys密码 SQL> alter user sys identified by oracle; User altered.2、log_archive_dest_state_2 禁用再启用 -- 主库操作:禁用log_archive_dest_state_2 SQL> alter system set log_archive_dest_state_2='defer'; System altered. SQL> alter system set log_archive_dest_state_2='enable'; System altered. -- 切归档: SQL> alter system switch logfile; -- 查看主库的alert 日志: Tue Nov 08 10:42:37 2022 ALTER SYSTEM SET log_archive_dest_state_2='defer' SCOPE=BOTH; Tue Nov 08 10:42:50 2022 ALTER SYSTEM SET log_archive_dest_state_2='enable' SCOPE=BOTH; Tue Nov 08 10:42:50 2022 Error 1031 received logging on to the standby PING[ARC2]: Heartbeat failed to connect to standby 'standby1'. Error is 1031. -- 查看报错: SQL> select dest_name,status,error from v$archive_dest where dest_id=1 or dest_id=2; DEST_NAME STATUS ERROR -------------------- -------------------- ------------------------------------------------------------ LOG_ARCHIVE_DEST_1 VALID LOG_ARCHIVE_DEST_2 ERROR ORA-01031: insufficient privileges报错:ORA-01031: insufficient privileges 3、查看备库的同步状态 -- 同步时间: SQL> select value from v$dataguard_stats where; VALUE -------------------- +00 00:00:00 -- 进程: SQL> select process,status,client_process,thread#,sequence# from v$managed_standby; PROCESS STATUS CLIENT_P THREAD# SEQUENCE# --------- ------------ -------- ---------- ---------- ARCH CLOSING ARCH 1 7133 ARCH CLOSING ARCH 1 7134 ARCH CONNECTED ARCH 0 0 ARCH CLOSING ARCH 1 7132 MRP0 WAIT_FOR_LOG N/A 1 7135 RFS IDLE UNKNOWN 0 0 RFS IDLE UNKNOWN 0 0 RFS IDLE UNKNOWN 0 0 RFS IDLE UNKNOWN 0 01、apply lag 的 value : +00 00:00:00 数据库版本:Release 11.2.0.4.0 主库修改密码,不同步密码文件 -- 修改sys 密码: SQL> alter user sys identified by oracle; User altered. SQL> alter system set log_archive_dest_state_2='defer'; System altered. SQL> alter system set log_archive_dest_state_2='enable'; System altered. -- alert 日志: ALTER SYSTEM SET log_archive_dest_state_2='defer' SCOPE=BOTH; ALTER SYSTEM SET log_archive_dest_state_2='enable' SCOPE=BOTH; Tue Nov 08 15:45:16 2022 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 ------------------------------------------------------------报错:ORA-16191: Primary log shipping client not logged on standby 总结1、sys主备库密码不一致不同版本报错不一样: 2、11G 修改sys 或密码文件均需要同步至备库,否则将影响同步,12c以Oracle推出了db passwd asm存储的特性,欧博RAC TO RAC ADG的情况下,DB的口令文件存储在ASM中,那么主库修改的操作,可以同步到DG环境,欧博娱乐避免每次修改都需要人为修改! 3、在密码不一致的情况下,主库报错:ORA-01031或ORA-16191后,备库v$dataguard_stats视图:apply lag 的值依然:+00 00:00:00。 4、从测试上来看,密码修改或密码文件清除,如果不立即启动重传归档的话,不影响归档传输。回到我开头的问题,应该是之前修改过sys密码,没有同步密码文件。本身库数据变化就少,归档也没多少,所以等了几天后触发了重传归档,才有了0点才出现报错的问题。 解决1、ORA-01031、ORA-16191 一般均为密码不一致导致,同步密码文件即可解决。 2、关于同步延迟敏感问题,对主库和备库的scn号进行对比监控,从而提高敏感度。 脚本实现逻辑:standby_time 监控
文章推荐
欢迎赞赏支持或留言指正 (责任编辑:) |