当DataGuard升级CPU后。发现主备库不能同步了,日志报错,所以在主库的运行的升级的后脚本“@catbundle.sql cpu apply”不能同步到备库

现象:

broker状态:

[oracle@webdb2 ~]$ dgmgrl sys/oracle

DGMGRL for Linux: Version 11.2.0.3.0 -64bit Production

Copyright (c) 2000, 2009, Oracle. Allrights reserved.

欢迎使用 DGMGRL, 要获取有关信息请键入 "help"。

已连接。

DGMGRL> show configuration

配置 - webdb

保护模式:        MaxAvailability

数据库:

webdb  - 主数据库

webdb2 - 物理备用数据库

高速启动故障转移: DISABLED

配置状态:

ORA-16664: 无法从数据库接收结果

DGM-17017: 无法确定配置状态

--查看主库状态:

SQL> Select timestamp, message FROMV$DATAGUARD_STATUS Where Rownum < 5;

TIMESTAMP  MESSAGE

-------------------------------------------------------------------------------------------

2014-10-23 Error 604 received logging on to the standby

2014-10-23  PING[ARC2]: Heartbeat failed to connect tostandby'(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=webdb2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=webdb2)(SERVER=DEDICATED)))'.Error is 604.

2014-10-23 Error 604 received logging on to the standby

2014-10-23 PING[ARC2]: Heartbeat failed to connect to standby'(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=webdb2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=webdb2)(SERVER=DEDICATED)))'.Error is 604.

--此时查看日志

主库日志:

ORA-00604: 递归 SQL 级别 1 出现错误

ORA-20154: TNS: 监听程序当前无法识别连接描写叙述符中请求的服务

ORA-06512: 在 line 29

Thu Oct 23 00:25:52 2014

Errors in file/u01/app/ora11g/diag/rdbms/webdb/webdb/trace/webdb_ora_18833.trc:

ORA-00604: 递归 SQL
级别 1 出现错误

ORA-20154: TNS: 监听程序当前无法识别连接描写叙述符中请求的服务

ORA-06512: 在 line 29

Thu Oct 23 00:25:52 2014

Errors in file/u01/app/ora11g/diag/rdbms/webdb/webdb/trace/webdb_ora_18842.trc:

ORA-00604: 递归 SQL 级别 1 出现错误

ORA-20154: TNS: 监听程序当前无法识别连接描写叙述符中请求的服务

ORA-06512: 在 line 29

Thu Oct 23 00:25:53 2014

Error 604 receivedlogging on to the standby

PING[ARC2]: Heartbeatfailed to connect to standby'(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=webdb2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=webdb2)(SERVER=DEDICATED)))'.Error is 604.

Thu Oct 23 00:26:12 2014

Errors in file /u01/app/ora11g/diag/rdbms/webdb/webdb/trace/webdb_ora_18961.trc:

ORA-00604: 递归 SQL 级别 1 出现错误

ORA-20154: TNS: 监听程序当前无法识别连接描写叙述符中请求的服务

ORA-06512: 在 line 29

备库日志:

ORA-00604: 递归 SQL
级别 1 出现错误

ORA-16000: 打开数据库以进行仅仅读訪问

ORA-06512: 在 line 3

Thu Oct 23 00:27:39 2014

Errors in file /u01/app/ora11g/diag/rdbms/webdb2/webdb2/trace/webdb2_ora_30130.trc:

ORA-00604: 递归 SQL
级别 1 出现错误

ORA-20154: TNS: 监听程序当前无法识别连接描写叙述符中请求的服务

ORA-06512: 在 line 29

Errors in file/u01/app/ora11g/diag/rdbms/webdb2/webdb2/trace/webdb2_ora_30130.trc:

ORA-00604: 递归 SQL 级别 1 出现错误

ORA-16000: 打开数据库以进行仅仅读訪问

ORA-06512: 在 line 3

--进一步查看trace文件

主库trace:

[oracle@webdb1 trace]$ more/u01/app/ora11g/diag/rdbms/webdb/webdb/trace/webdb_ora_8589.trc

Trace file/u01/app/ora11g/diag/rdbms/webdb/webdb/trace/webdb_ora_8589.trc

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic StorageManagement, OLAP, Data Mining

and Real Application Testing options

ORACLE_HOME =/u01/app/ora11g/product/11.2.0/db_1

System name:    Linux

Node name:      webdb1

Release:        2.6.32-200.13.1.el5uek

Version:        #1 SMP Wed Jul 27 21:02:33 EDT 2011

Machine:        x86_64

Instance name: webdb

Redo thread mounted by this instance: 1

Oracle process number: 176

Unix process pid: 8589, image:oracle@webdb1

*** 2014-10-14 13:19:18.860

*** SESSION ID:(21.12621) 2014-10-1413:19:18.860

*** CLIENT ID:() 2014-10-14 13:19:18.860

*** SERVICE NAME:(SYS$USERS) 2014-10-1413:19:18.860

*** MODULE NAME:(emagent@webdb1 (TNSV1-V3)) 2014-10-14 13:19:18.860

*** ACTION NAME:() 2014-10-14 13:19:18.860

Error in executing triggers on connectinternal

*** 2014-10-14 13:19:18.861

dbkedDefDump(): Starting a non-incidentdiagnostic dump (flags=0x0, level=0, mask=0x0)

----- Error Stack Dump -----

ORA-00604: 递归 SQL
级别 1 出现错误

ORA-20154: TNS: 监听程序当前无法识别连接描写叙述符中请求的服务

ORA-06512: 在 line 28

Trace file/u01/app/ora11g/diag/rdbms/webdb/webdb/trace/webdb_ora_8589.trc

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic StorageManagement, OLAP, Data Mining

and Real Application Testing options

ORACLE_HOME =/u01/app/ora11g/product/11.2.0/db_1

System name:    Linux

Node name:      webdb1

Release:        2.6.32-200.13.1.el5uek

Version:        #1 SMP Wed Jul 27 21:02:33 EDT 2011

Machine:        x86_64

Instance name: webdb

Redo thread mounted by this instance: 1

Oracle process number: 163

Unix process pid: 8589, image:oracle@webdb1

备库trace:

[oracle@webdb2 trace]$ more/u01/app/ora11g/diag/rdbms/webdb2/webdb2/trace/webdb2_ora_29791.trc

Trace file/u01/app/ora11g/diag/rdbms/webdb2/webdb2/trace/webdb2_ora_29791.trc

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic StorageManagement, OLAP, Data Mining

and Real Application Testing options

ORACLE_HOME =/u01/app/ora11g/product/11.2.0/db_1

System name:    Linux

Node name:      webdb2

Release:        2.6.32-200.13.1.el5uek

Version:        #1 SMP Wed Jul 27 21:02:33 EDT 2011

Machine:        x86_64

Instance name: webdb2

Redo thread mounted by this instance: 1

Oracle process number: 22

Unix process pid: 29791, image:oracle@webdb2

*** 2014-10-23 11:30:21.649

*** SESSION ID:(854.10603) 2014-10-2311:30:21.649

*** CLIENT ID:() 2014-10-23 11:30:21.649

*** SERVICE NAME:(SYS$USERS) 2014-10-2311:30:21.649

*** MODULE NAME:(emagent@webdb2 (TNSV1-V3)) 2014-10-23 11:30:21.649

*** ACTION NAME:() 2014-10-23 11:30:21.649

Error in executing triggers on connectinternal

*** 2014-10-23 11:30:21.649

dbkedDefDump(): Starting a non-incidentdiagnostic dump (flags=0x0, level=0, mask=0x0)

----- Error Stack Dump -----

ORA-00604: 递归 SQL 级别 1 出现错误

ORA-20154: TNS: 监听程序当前无法识别连接描写叙述符中请求的服务

ORA-06512: 在 line 29

Error in executing triggers on connectinternal

*** 2014-10-23 11:30:21.650

dbkedDefDump(): Starting a non-incidentdiagnostic dump (flags=0x0, level=0, mask=0x0)

----- Error Stack Dump -----

ORA-00604: 递归 SQL 级别 1 出现错误

ORA-16000: 打开数据库以进行仅仅读訪问

ORA-06512: 在 line 3

分析:

能够从看到trace log中看到都与tiger运行有关。于是想到在主库是创建过的两个 logon on database tiger

解决的方法:

--禁用登录tiger

把一个登录IP限制的tiger的禁用后,主库的

ORA-00604: 递归 SQL 级别 1 出现错误

ORA-20154: TNS: 监听程序当前无法识别连接描写叙述符中请求的服务

报错消失。仅仅剩下以下的报错:

Error 604 received logging on to thestandby

PING[ARC2]: Heartbeat failed to connect tostandby'(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=webdb2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=webdb2)(SERVER=DEDICATED)))'.Error is 604.

备库依旧报错

--启动备库到mount状态

SQL> shutdown immediate

SQL> startup mount

ORACLE 例程已经启动。

Total System Global Area 1.0456E+10 bytes

Fixed Size                  2237488 bytes

Variable Size            5435821008 bytes

Database Buffers         4999610368 bytes

Redo Buffers               17973248 bytes

数据库装载完成。

SQL> select open_mode from v$database;

OPEN_MODE

--------------------

MOUNTED

--查看日志

主库:

Thu Oct 23 13:45:15 2014

Archived Log entry 2225 added for thread 1sequence 1122 ID 0xc8d579d3 dest 1:

ARC3: Standby redo logfile selected forthread 1 sequence 1122 for destination LOG_ARCHIVE_DEST_2

Thu Oct 23 13:46:46 2014

ARC3: Archive log rejected (thread 1sequence 1120) at host'(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=webdb2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=webdb2)(SERVER=DEDICATED)))'

Thu Oct 23 13:46:46 2014

ARC0: Archive log rejected (thread 1sequence 1121) at host'(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=webdb2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=webdb2)(SERVER=DEDICATED)))'

FAL[server, ARC3]: FAL archive failed, seetrace file.

ARCH: FAL archive failed. Archivercontinuing

ORACLE Instance webdb - Archival Error.Archiver continuing.

FAL[server, ARC0]: FAL archive failed, seetrace file.

ARCH: FAL archive failed. Archivercontinuing

ORACLE Instance webdb - Archival Error.Archiver continuing.

Thu Oct 23 13:46:49 2014

Destination LOG_ARCHIVE_DEST_2 isSYNCHRONIZED

LGWR: Standby redo logfile selected toarchive thread 1 sequence 1124

LGWR: Standby redo logfile selected forthread 1 sequence 1124 for destination LOG_ARCHIVE_DEST_2

Thread 1 advanced to log sequence 1124(LGWR switch)

Current log# 2 seq# 1124 mem# 0:+DATA/webdb/onlinelog/group_2.262.819826783

Current log# 2 seq# 1124 mem# 1:+FRA/webdb/onlinelog/group_2.258.819826785

Archived Log entry 2244 added for thread 1sequence 1123 ID 0xc8d579d3 dest 1

备库:

Using STANDBY_ARCHIVE_DEST parameterdefault value as USE_DB_RECOVERY_FILE_DEST

Thu Oct 23 13:45:15 2014

RFS[1]: Assigned to RFS process 17293

RFS[1]: Opened log for thread 1 sequence1102 dbid -925543465 branch 819826777

Thu Oct 23 13:45:15 2014

Primary database is in MAXIMUM AVAILABILITYmode

Standby controlfile consistent with primary

Standby controlfile consistent with primary

RFS[2]: Assigned to RFS process 17297

RFS[2]: Selected log 7 for thread 1sequence 1123 dbid -925543465 branch 819826777

Deleted Oracle managed file+FRA/webdb2/archivelog/2014_10_13/thread_1_seq_1049.350.860808821

Archived Log entry 1104 added for thread 1sequence 1102 rlc 819826777 ID 0xc8d579d3 dest 2:

能够看到主备库恢复心跳。备库能恢复应用日志

打开备库操作:

SQL> alter database open;

数据库已更改。

SQL> select open_mode from v$database;

OPEN_MODE

--------------------

READ ONLY

SQL> ALTER DATABASE RECOVER MANAGEDSTANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

ALTER DATABASE RECOVER MANAGED STANDBYDATABASE USING CURRENT LOGFILE DISCONNECT

*

第 1 行出现错误:

ORA-01153: 激活了不兼容的介质恢复

SQL> select open_mode from v$database;

OPEN_MODE

--------------------

READ ONLY WITH APPLY

--主库切换日志

SQL> alter system switch logfile;

系统已更改。

--查看日志

主库:

Thu Oct 23 14:19:52 2014

LGWR: Standby redo logfile selected toarchive thread 1 sequence 1125

LGWR: Standby redo logfile selected forthread 1 sequence 1125 for destination LOG_ARCHIVE_DEST_2

Thread 1 advanced to log sequence 1125(LGWR switch)

Current log# 3 seq# 1125 mem# 0:+DATA/webdb/onlinelog/group_3.263.819826787

Current log# 3 seq# 1125 mem# 1:+FRA/webdb/onlinelog/group_3.259.819826789

Thu Oct 23 14:19:53 2014

Archived Log entry 2246 added for thread 1sequence 1124 ID 0xc8d579d3 dest 1:

备库:

Completed: ALTER DATABASE RECOVER MANAGEDSTANDBY DATABASE  THROUGH ALL SWITCHOVERDISCONNECT  USING CURRENT LOGFILE

Thu Oct 23 14:15:51 2014

ALTER DATABASE RECOVER MANAGED STANDBYDATABASE USING CURRENT LOGFILE DISCONNECT

ORA-1153 signalled during: ALTER DATABASERECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT...

Thu Oct 23 14:19:52 2014

Standby controlfile consistent with primary

RFS[2]: Selected log 7 for thread 1sequence 1125 dbid -925543465 branch 819826777

Thu Oct 23 14:19:52 2014

Archived Log entry 1123 added for thread 1sequence 1124 ID 0xc8d579d3 dest 1:

Thu Oct 23 14:19:52 2014

Media Recovery Waiting for thread 1sequence 1125 (in transit)

Recovery of Online Redo Log: Thread 1 Group7 Seq 1125 Reading mem 0

Mem# 0: +DATA/webdb2/onlinelog/group_7.282.819884421

Mem# 1: +FRA/webdb2/onlinelog/group_7.278.819884423

能够看到在仅仅读应用状态open备库后。日志应用仍然正常

--查看DataGuard状态

[oracle@webdb1 trace]$ dgmgrl sys/oracle

DGMGRL for Linux: Version 11.2.0.3.0 -64bit Production

Copyright (c) 2000, 2009, Oracle. Allrights reserved.

欢迎使用 DGMGRL, 要获取有关信息请键入 "help"。

已连接。

DGMGRL> show configuration

配置 - webdb

保护模式:        MaxAvailability

数据库:

webdb  - 主数据库

webdb2 - 物理备用数据库

高速启动故障转移: DISABLED

配置状态:

SUCCESS

总结:

通过报错分析看到,主备不同步跟CPU补丁升级没有直接关系,跟创建的logon on database 触发器有关。

假设在主数据创建一个logon on database tiger。可能会引起主备库不能同步传输日志的问题,

这时。我们要做是把备库又一次mount,然后再open到仅仅读应用状态(READ ONLY WITH APPLY)

由于当备库重新启动后,备库直接启动到仅仅读应用状态(READ ONLY WITH APPLY)。就会出现上面的问题。

參考:

http://www.cnblogs.com/Spiritual-journey/archive/2012/10/21/2732806.html

Logon database Tiger引起DataGuard不同步问题的更多相关文章

  1. 使用Oracle 11g新特性 Active Database Duplication 搭建Dataguard环境

    Duplication Database 介绍 Duplicate database可以按照用途分为2种: duplicate database(复制出一个数据库) duplicate standby ...

  2. dataguard不同步问题ora-16191解决

    公司的11g的dataguard主备不同步,检查步骤如下: Primary:查询主库的最大日志 SQL> select max(sequence#) from v$archived_log;SQ ...

  3. Oracle Database 12c Using duplicate standby database from active database Created Active DataGuard

    primary database db_name=zwc, db_unique_name=zwc standby database db_name=zwc, db_unique_name=standb ...

  4. 11g数据库查看dataguard是否同步

    一.环境      主库:       ip地址:192.168.122.203       oracle根目录:/data/db/oracle       SID:qyq       数据文件路径/ ...

  5. Oracle 10g DataGuard手记之基础配置

    DataGuard为企业数据的高可用性,数据安全以及灾难恢复提供支持,一般由一个primary db与几个物理或逻辑standby db组成一个DataGuard配置. 系统环境 操作系统为windo ...

  6. Oracle 11.2.0.4.0 Dataguard部署和日常维护(2)-Datauard部署篇

    1. primary库设置dataguard相关参数   1.1. 强制primay库在任何状态下必须记录日志 SYS@userdata>select FORCE_LOGGING from v$ ...

  7. 12.2 中的Data Guard Standby 密码文件自动同步 (Doc ID 2307365.1)

    Data Guard Standby Automatic Password file Synchronization in 12.2 (Doc ID 2307365.1) APPLIES TO: Or ...

  8. Oracle DataGuard主库丢失归档日志后备库的RMAN增量恢复一例

    第一部分  问题描述和环境状态确认 ----1. 问题场景 Oracle DataGuard主库丢失archivelog,如何不重建备库完成同步? 在Oracle DataGuard主从同步过程中可能 ...

  9. DG_Oracle DataGuard作用和概念(概念)

    2014-06-03 Created By BaoXinjian  

随机推荐

  1. RxSwift 系列(二)

    前言 Subject是一个代理,它既是Observer,也是Observable.因为它是一个Observer,它可以订阅一个或多个Observable;因为它是一个Observable,它又可以被其 ...

  2. 【20181024T2】小C的序列【GCD性质+链表】

    题面 [错解] 一眼不可做啊 哎分治? 算不了啊 真的是,打暴力走人 20pts (事实上,还有20pts是随机数据,加个小小的特判就可以) [正解] 首先,从l开始往后gcd最多只有O(log)种取 ...

  3. 【动态规划/多重背包问题】POJ1014-Dividing

    多重背包问题的优化版来做,详见之前的动态规划读书笔记. dp[i][j]表示前i中数加得到j时第i种数最多剩余几个(不能加和得到i的情况下为-1)递推式为: dp[i][j]=mi(dp[i-1][j ...

  4. [GCJ2017R3]Cooclement

    题目大意: 一种数列按照如下方式变化: 新数列第i位等于原数中数字i的出现次数. 变化过程中数列长度不变. 例如数列12的变化过程为12-11-20-01-10. 现在告诉你一个数列x,请求出x可能是 ...

  5. 【manacher】模板

    考试竟然写错了manacher!太耻辱了!所以赶快又敲了一遍模板!!一定不能错了aaaa #include<iostream> #include<cstdio> #includ ...

  6. bzoj1977 次小生成树

    Description 小 C 最近学了很多最小生成树的算法,Prim 算法.Kurskal 算法.消圈算法等等. 正当小 C 洋洋得意之时,小 P 又来泼小 C 冷水了.小 P 说,让小 C 求出一 ...

  7. BZOJ 4443: [Scoi2015]小凸玩矩阵 最大流

    4443: [Scoi2015]小凸玩矩阵 题目连接: http://www.lydsy.com/JudgeOnline/problem.php?id=4443 Description 小凸和小方是好 ...

  8. hdu 5234 Happy birthday 背包 dp

    Happy birthday Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?p ...

  9. C#中&和&&,|和||区别

    当两者都为逻辑运算符时. 其实没什么差别. &&和||当已经确定结果时,不会对第二个操作数求值.也不知道什么情况会用到这个差别.做个笔记好了. http://blog.csdn.net ...

  10. PHP简单利用 token 防止表单重复提交

    <?php /* * 隐藏一个可变的token,每次提交都需要和服务器校对 */ session_start(); function set_token() { $_SESSION['token ...