oracle 11g r2(11.2.0.4.0 ),配置rac+dg,备库启用实时应用遇到的一些问题:
主库参数:
*.log_archive_dest_2='location=+arch/jhdb/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=jhdb'
*.log_archive_dest_3='service=jhdg lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=jhdg'
修改主库传输redolog模式,由arcn传输改成lgwr。
主库日志:
Archived Log entry 23982 added for thread 1 sequence 11108 ID 0x41cdfd03 dest 2:
******************************************************************
LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_3
******************************************************************
Mon Sep 25 10:24:02 2017
WARN: ARC1: Terminating pid 3986 hung on an I/O operation
WARN: ARC1: Terminating pid 35951 hung on an I/O operation
WARN: ARC1: Terminating pid 3362 hung on an I/O operation
Killing 1 processes with pids 3986 (Process by index) in order to remove hung processes. Requested by OS process 35949 on instance 1
Killing 1 processes with pids 35951 (Process by index) in order to remove hung processes. Requested by OS process 35949 on instance 1
Killing 1 processes with pids 3362 (Process by index) in order to remove hung processes. Requested by OS process 35949 on instance 1
ARC1: Error 16198 due to hung I/O operation to LOG_ARCHIVE_DEST_3
ARC1: Detected ARCH process failure
ARC1: Detected ARCH process failure
ARC1: Detected ARCH process failure
ARC1: STARTING ARCH PROCESSES
Mon Sep 25 10:24:09 2017
ARC0 started with pid=44, OS id=5886
Mon Sep 25 10:24:09 2017
ARC2 started with pid=89, OS id=5902
Mon Sep 25 10:24:09 2017
ARC3 started with pid=101, OS id=5904
ARC0: Archival started
ARC2: Archival started
ARC2: Becoming the heartbeat ARCH
Reclaiming FAL entry from dead process [pid 3986]
Reclaiming FAL entry from dead process [pid 3362]
ARC3: Archival started
ARC1: STARTING ARCH PROCESSES COMPLETE
Reclaiming FAL entry from dead process [pid 35951]
ARC0: Standby redo logfile selected for thread 1 sequence 11107 for destination LOG_ARCHIVE_DEST_3
ARC2: Standby redo logfile selected for thread 1 sequence 11108 for destination LOG_ARCHIVE_DEST_3
Mon Sep 25 10:24:23 2017
ARC0: Archive log rejected (thread 1 sequence 11107) at host 'jhdg'
FAL[server, ARC0]: FAL archive failed, see trace file.
ARCH: FAL archive failed. Archiver continuing
ORACLE Instance jhdb1 - Archival Error. Archiver continuing.
Mon Sep 25 10:30:11 2017
Thread 1 advanced to log sequence 11110 (LGWR switch)
Current log# 5 seq# 11110 mem# 0: +DATA/jhdb/onlinelog/group5_1.log
Current log# 5 seq# 11110 mem# 1: +ARCH/jhdb/onlinelog/group5_1.log
Mon Sep 25 10:30:12 2017
Archived Log entry 23990 added for thread 1 sequence 11109 ID 0x41cdfd03 dest 2:
Mon Sep 25 10:30:12 2017
******************************************************************
LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_3
******************************************************************
由日志可知,日志在传输过程中出现问题,导致主库archive hung住,系统自动杀死hung会话。
查看本地归档
*.log_archive_dest_2='location=+arch/jhdb/archivelog/jhdb2 valid_for=(all_logfiles,all_roles) db_unique_name=jhdb'
启用lgwr传输redolog,在备库查询应该有lgwr进程传输日志,而不是arch进程,但是在async模式下,使用的是LNS进程传输redolog;在sync模式下使用的是lgwr传输redolog如下:
SQL> select process,status,thread#,sequence#,block#,blocks from v$managed_standby;
PROCESS STATUS THREAD# SEQUENCE# BLOCK# BLOCKS
--------- ------------ ---------- ---------- ---------- ----------
ARCH CLOSING 1 11110 22528 304
ARCH CLOSING 1 11111 59392 1713
ARCH CLOSING 1 11106 1 1583
ARCH CLOSING 1 11109 12288 578
LNS WRITING 1 11112 42441 4
备库启动实时应用:
alter database recover managed standby database using current logfile disconnect from session;
备库日志:
Fetching gap sequence in thread 1, gap sequence 11103-11103
Mon Sep 25 10:04:44 2017
FAL[client]: Failed to request gap sequence
GAP - thread 1 sequence 11103-11103
DBID 1103974919 branch 884618889
FAL[client]: All defined FAL servers have been attempted.
------------------------------------------------------------
Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization
parameter is defined to a value that's sufficiently large
enough to maintain adequate log switch information to resolve
archivelog gaps.
------------------------------------------------------------
Mon Sep 25 10:07:45 2017
RFS[20]: Assigned to RFS process 7107
RFS[20]: Selected log 1 for thread 1 sequence 11107 dbid 1103974919 branch 884618889
Mon Sep 25 10:07:45 2017
RFS[21]: Assigned to RFS process 7109
RFS[21]: Selected log 9 for thread 1 sequence 11108 dbid 1103974919 branch 884618889
Mon Sep 25 10:07:45 2017
Archived Log entry 211 added for thread 1 sequence 11108 ID 0x41cdfd03 dest 2:
Mon Sep 25 10:07:45 2017
Fetching gap sequence in thread 1, gap sequence 11103-11107
Mon Sep 25 10:07:46 2017
Archived Log entry 212 added for thread 1 sequence 11107 ID 0x41cdfd03 dest 2:
Mon Sep 25 10:07:46 2017
RFS[22]: Assigned to RFS process 7114
RFS[22]: Opened log for thread 1 sequence 11103 dbid 1103974919 branch 884618889
RFS[21]: Opened log for thread 1 sequence 11105 dbid 1103974919 branch 884618889
RFS[20]: Opened log for thread 1 sequence 11104 dbid 1103974919 branch 884618889
Archived Log entry 213 added for thread 1 sequence 11105 rlc 884618889 ID 0x41cdfd03 dest 3:
Archived Log entry 214 added for thread 1 sequence 11104 rlc 884618889 ID 0x41cdfd03 dest 3:
Mon Sep 25 10:07:56 2017
RFS[21]: Opened log for thread 1 sequence 11106 dbid 1103974919 branch 884618889
Archived Log entry 215 added for thread 1 sequence 11106 rlc 884618889 ID 0x41cdfd03 dest 3:
Mon Sep 25 10:08:01 2017
Archived Log entry 216 added for thread 1 sequence 11103 rlc 884618889 ID 0x41cdfd03 dest 3:
Mon Sep 25 10:08:02 2017
Media Recovery Log /u01/app/oracle/archivelog/1_11103_884618889.dbf
Media Recovery Log /u01/app/oracle/archivelog/2_9767_884618889.dbf
Media Recovery Log /u01/app/oracle/archivelog/1_11104_884618889.dbf
Media Recovery Log /u01/app/oracle/archivelog/2_9768_884618889.dbf
Media Recovery Log /u01/app/oracle/archivelog/2_9769_884618889.dbf
Media Recovery Log /u01/app/oracle/archivelog/2_9770_884618889.dbf
Media Recovery Log /u01/app/oracle/archivelog/1_11105_884618889.dbf
Media Recovery Log /u01/app/oracle/archivelog/1_11106_884618889.dbf
Media Recovery Log /u01/app/oracle/archivelog/2_9771_884618889.dbf
Media Recovery Log /u01/app/oracle/archivelog/1_11107_884618889.dbf
Media Recovery Waiting for thread 2 sequence 9772 (in transit)
查看备库standby_log使用状态,发现未分配。
SQL> select GROUP#,THREAD#,SEQUENCE#,USED,ARCHIVED,STATUS from v$standby_log;
GROUP# THREAD# SEQUENCE# USED ARC STATUS
---------- ---------- ---------- ---------- --- ----------
1 1 0 0 NO UNASSIGNED
2 2 0 0 NO UNASSIGNED
9 1 0 0 YES UNASSIGNED
10 2 0 0 YES UNASSIGNED
11 1 0 0 YES UNASSIGNED
12 2 0 0 YES UNASSIGNED
13 1 0 0 YES UNASSIGNED
14 2 0 0 YES UNASSIGNED
详细请参考:http://blog.itpub.net/article.php?url=http://blog.itpub.net/26736162/viewspace-2121688