查看: 1782|回复: 0

[Oracle数据库] 12c Oracle ADG日志切换hang

发表于 2018-1-25 08:00:00

一、环境
12c ADG环境

二、现象描述

主库日志切换卡住(hang)

  1. SQL> alter system switch logfile;
复制代码

三、处理过程
1、查看日志

  1. <roidb02:orcldg:/u01/app/oracle/diag/rdbms/orcldg/orcldg/trace>$tail -f al*.log
  2. Mon Jan 08 21:04:20 2018
  3. ARC0: LGWR is scheduled to archive destination LOG_ARCHIVE_DEST_1 after log switch
  4. Mon Jan 08 21:11:21 2018
  5. ARC3: LGWR is scheduled to archive destination LOG_ARCHIVE_DEST_1 after log switch
  6. Mon Jan 08 21:19:21 2018
  7. ARC0: LGWR is scheduled to archive destination LOG_ARCHIVE_DEST_1 after log switch
  8. Mon Jan 08 21:26:22 2018
  9. ARC3: LGWR is scheduled to archive destination LOG_ARCHIVE_DEST_1 after log switch
  10. Mon Jan 08 21:34:22 2018
  11. ARC0: LGWR is scheduled to archive destination LOG_ARCHIVE_DEST_1 after log switch
  12. Mon Jan 08 21:42:19 2018
  13. ARC0: LGWR is scheduled to archive destination LOG_ARCHIVE_DEST_1 after log switch
复制代码

2、考虑归档参数

  1. SQL> show parameter log_archive_dest
  2. NAME TYPE VALUE
  3. ------------------------------------ ----------- ------------------------------
  4. log_archive_dest string
  5. log_archive_dest_1 string service="orcl", SYNC AFFIRM de
  6. lay=0 optional compression=dis
  7. able max_failure=0 max_connect
  8. ions=1 reopen=300 db_unique_na
  9. me="orcl" net_timeout=10, vali
  10. d_for=(online_logfile,all_role
  11. s)
  12. log_archive_dest_10 string
  13. log_archive_dest_11 string
  14. log_archive_dest_12 string
  15. NAME TYPE VALUE
  16. ------------------------------------ ----------- ------------------------------
  17. log_archive_dest_13 string
  18. log_archive_dest_14 string
  19. log_archive_dest_15 string
  20. log_archive_dest_16 string
  21. log_archive_dest_17 string
  22. log_archive_dest_18 string
  23. log_archive_dest_19 string
  24. log_archive_dest_2 string location="+DATADG/arch", vali
  25. d_for=(STANDBY_LOGFILE,STANDBY
  26. _ROLE)
复制代码

3、参数明显有问题,另开一个会话

  1. SQL> ALTER SYSTEM SET log_archive_dest_2='location="+DATADG/arch", valid_for=(ALL_LOGFILES,ALL_ROLES)';
  2. System altered.
  3. SQL>
复制代码

4、查看主库日志

  1. ALTER SYSTEM SET log_archive_dest_2='location="+DATADG/arch", valid_for=(ALL_LOGFILES,ALL_ROLES)' SCOPE=BOTH;
  2. Mon Jan 08 21:49:23 2018
  3. Archived Log entry 376 added for thread 1 sequence 365 ID 0x58e622f8 dest 2:
  4. krse_arc_driver_core: Successful archiving of previously failed ORL
  5. Mon Jan 08 21:49:23 2018
  6. ******************************************************************
  7. LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_1
  8. ******************************************************************
  9. Mon Jan 08 21:49:24 2018
  10. Destination LOG_ARCHIVE_DEST_1 no longer supports SYNCHRONIZATION
  11. Mon Jan 08 21:49:24 2018
  12. Thread 1 advanced to log sequence 368 (LGWR switch)
  13. Current log# 1 seq# 368 mem# 0: +DATADG/ORCLDG/ONLINELOG/group_1.399.962961189
  14. Current log# 1 seq# 368 mem# 1: +DATADG/ORCLDG/ONLINELOG/group_1.402.962961189
  15. Mon Jan 08 21:49:24 2018
  16. Archived Log entry 377 added for thread 1 sequence 366 ID 0x58e622f8 dest 2:
  17. Mon Jan 08 21:49:24 2018
  18. Archived Log entry 378 added for thread 1 sequence 367 ID 0x58e622f8 dest 2:
  19. Mon Jan 08 21:49:48 2018
  20. Destination LOG_ARCHIVE_DEST_1 is SYNCHRONIZED
  21. Mon Jan 08 21:49:49 2018
  22. Destination LOG_ARCHIVE_DEST_1 no longer supports SYNCHRONIZATION
  23. Mon Jan 08 21:49:49 2018
  24. Thread 1 advanced to log sequence 369 (LGWR switch)
  25. Current log# 2 seq# 369 mem# 0: +DATADG/ORCLDG/ONLINELOG/group_2.401.962961191
  26. Current log# 2 seq# 369 mem# 1: +DATADG/ORCLDG/ONLINELOG/group_2.404.962961191
  27. Mon Jan 08 21:49:49 2018
  28. Archived Log entry 383 added for thread 1 sequence 368 ID 0x58e622f8 dest 2:
复制代码

5、小结
要理解本地归档路径参数的具体含义



回复

使用道具 举报