暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

关于Oracle归档进程的运行机制

原创 eygle 2007-06-08
679
真理是需要不断摸索才能发现的。
所以,在网友的质疑下,我发现上一篇的文章的认识是有问题的,经过进一步的研究,终于找到了问题的原因所在。
关键原因在于alter system archive log current是怎样执行的?这是核心所在。
首先排除归档进程,当log_archive_max_processes参数设置为1时,archive log current同样会出现之前讨论的问题:
SQL> alter system set log_archive_max_processes=1 scope=both;
System altered.
SQL> archive log stop;
Statement processed.
SQL> archive log start;
Statement processed.
SQL> alter system archive log current;
System altered.

此时观察警告日志:
Fri Jun 8 15:33:56 2007
Archive Log Stop
Archive Log Start
Using log_archive_dest parameter default value
Archiving is enabled
ARCH: STARTING ARCH PROCESSES
ARCH: STARTING ARCH PROCESSES COMPLETE
ARC0 started with pid=12
ARC0: Archival started
Fri Jun 8 15:34:12 2007
ARCH: Evaluating archive log 5 thread 1 sequence 324
ARCH: Beginning to archive log 5 thread 1 sequence 324
Creating archive destination LOG_ARCHIVE_DEST_1: '/opt/oracle/product/9.2.0/dbs/arch1_324.dbf'
Fri Jun 8 15:34:12 2007
Beginning log switch checkpoint up to RBA [0x145.2.10], SCN: 0x0004.6c6330e3
Fri Jun 8 15:34:12 2007
ARC0: Evaluating archive log 5 thread 1 sequence 324
ARC0: Unable to archive log 5 thread 1 sequence 324
Log actively being archived by another process

只有一个归档进程了,那么为什么还存在"Log actively being archived by another process"的提示呢?
那么一定还存在另外一个进程在执行归档。
我们索性将所有归档进程停止,再来研究:
SQL> archive log stop;
Statement processed.
SQL> alter system archive log current;
System altered.

在日志中记录了如下信息:
Fri Jun 8 15:34:12 2007
Thread 1 advanced to log sequence 325
Current log# 3 seq# 325 mem# 0: /opt/oracle/oradata/eygle/redo03.log
Fri Jun 8 15:34:12 2007
ARCH: Completed archiving log 5 thread 1 sequence 324
Archive Log Stop
Using log_archive_dest parameter default value
Archiving is disabled
Shutting down archive processes
Archiving is disabled
Fri Jun 8 15:35:52 2007
ARCH shutting down
ARC0: Archival stopped
Fri Jun 8 15:35:55 2007
Beginning log switch checkpoint up to RBA [0x146.2.10], SCN: 0x0004.6c633108
Thread 1 advanced to log sequence 326
Current log# 4 seq# 326 mem# 0: /opt/oracle/oradata/eygle/redo04.dbf
Fri Jun 8 15:35:55 2007
ARCH: Evaluating archive log 3 thread 1 sequence 325
ARCH: Beginning to archive log 3 thread 1 sequence 325
Creating archive destination LOG_ARCHIVE_DEST_1: '/opt/oracle/product/9.2.0/dbs/arch1_325.dbf'
ARCH: Completed archiving log 3 thread 1 sequence 325
Fri Jun 8 15:35:55 2007
Completed checkpoint up to RBA [0x146.2.10], SCN: 0x0004.6c633108
Completed checkpoint up to RBA [0x145.2.10], SCN: 0x0004.6c6330e3

我们注意到归档仍然成功的完成了。
那么到底是哪个进程在进行归档工作呢?
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论