ITPUB论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
更多
查看: 3577|回复: 13

求教:归档进程的管理 [复制链接]

注册会员

弦乐之花

精华贴数
0
技术积分
3711
社区积分
20
注册时间
2006-7-13
论坛徽章:
19
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44ITPUB北京2009年会纪念徽章
日期:2009-02-09 11:42:452010新春纪念徽章
日期:2010-03-01 11:06:13BLOG每日发帖之星
日期:2010-03-28 01:01:02ITPUB9周年纪念徽章
日期:2010-10-08 09:31:222012新春纪念徽章
日期:2012-01-04 11:51:22
发表于 2007-5-30 16:23:22 |显示全部楼层
Fri May 25 20:46:06 2007
Starting control autobackup
Control autobackup written to DISK device
        handle '/ora_rman_backup/crtl_backup/c-4205638757-20070525-00'
Fri May 25 20:46:11 2007
Thread 1 advanced to log sequence 535
  Current log# 1 seq# 535 mem# 0: /dev/udpay/lv_redo11_256m
  Current log# 1 seq# 535 mem# 1: /dev/udpay/lv_redo12_256m
Fri May 25 20:46:11 2007
ARCH: Evaluating archive   log 6 thread 1 sequence 534
ARCH: Beginning to archive log 6 thread 1 sequence 534
Creating archive destination LOG_ARCHIVE_DEST_1: '/archivelog/arch/1_534.dbf'
Fri May 25 20:46:12 2007
ARC0: Evaluating archive   log 6 thread 1 sequence 534
ARC0: Unable to archive log 6 thread 1 sequence 534
      Log actively being archived by another process
Fri May 25 20:46:15 2007
ARCH: Completed archiving  log 6 thread 1 sequence 534
Fri May 25 20:46:18 2007
Thread 1 advanced to log sequence 536
  Current log# 2 seq# 536 mem# 0: /dev/udpay/lv_redo21_256m
  Current log# 2 seq# 536 mem# 1: /dev/udpay/lv_redo22_256m
Fri May 25 20:46:18 2007
ARCH: Evaluating archive   log 1 thread 1 sequence 535
ARCH: Beginning to archive log 1 thread 1 sequence 535
Creating archive destination LOG_ARCHIVE_DEST_1: '/archivelog/arch/1_535.dbf'
Fri May 25 20:46:19 2007
ARC0: Evaluating archive   log 1 thread 1 sequence 535
ARC0: Unable to archive log 1 thread 1 sequence 535
      Log actively being archived by another process
Fri May 25 20:46:19 2007
ARCH: Completed archiving  log 1 thread 1 sequence 535
Fri May 25 20:46:40 2007
Starting control autobackup
Control autobackup written to DISK device
        handle '/ora_rman_backup/crtl_backup/c-4205638757-20070525-01'

为什么一秒后
oracle又启动了另外一个进程去归档
oracle关于归档进程的管理是怎么的呢?
实在不解,请大家指教一下

版主

态度决定一切

精华贴数
2
技术积分
6739
社区积分
1950
注册时间
2006-4-17
论坛徽章:
59
ITPUB十周年纪念徽章
日期:2011-11-01 16:21:152010年世界杯参赛球队:日本
日期:2010-03-24 12:54:572010新春纪念徽章
日期:2010-03-01 11:06:132010新春纪念徽章
日期:2010-01-04 08:33:08祖国60周年纪念徽章
日期:2009-10-09 08:28:00ITPUB8周年纪念徽章
日期:2009-09-27 10:21:21生肖徽章2007版:马
日期:2009-09-10 11:26:192009日食纪念
日期:2009-07-22 09:30:00ITPUB元老
日期:2009-04-18 17:12:38ITPUB9周年纪念徽章
日期:2010-10-08 09:28:522010广州亚运会纪念徽章:皮划艇
日期:2010-12-14 09:53:422011新春纪念徽章
日期:2011-01-25 15:41:01
发表于 2007-5-31 16:17:25 |显示全部楼层
log_archive_max_processes这个参数的缺省值是2 ,估计跟日志切换的快慢有关系,不太确定,期待高手解决

使用道具 举报

版主

版主

精华贴数
11
技术积分
33853
社区积分
3867
注册时间
2001-10-18
论坛徽章:
109
管理团队2006纪念徽章
日期:2006-04-16 22:44:452012新春纪念徽章
日期:2012-01-04 11:49:54灰彻蛋
日期:2011-12-17 23:16:55数据库板块每日发贴之星
日期:2011-03-16 01:01:02月度精华徽章
日期:2011-04-01 02:15:44SQL数据库编程大师
日期:2011-04-13 12:09:01现任管理团队成员
日期:2011-05-07 01:45:08蜘蛛蛋
日期:2011-10-18 13:05:40季节之章:夏
日期:2011-10-21 12:00:32ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41紫蛋头
日期:2012-01-06 21:49:51ITPUB9周年纪念徽章
日期:2010-10-08 09:28:52
发表于 2007-6-1 10:52:47 |显示全部楼层
这样子就OK了。
当然,如果没有smtools.utc2date,自己创建一个
SELECT   c.cwt_business_id, b.su_mdn, COUNT( a.su_id ) COUNT
    FROM track a, service_unit b, corporation c
   WHERE a.su_id(+) = b.su_id AND b.corp_id = c.corp_id AND  a.utc  >=  smtools.utc2date(1177689600)
         AND  a.utc <  smtools.utc2date(1177776000)
GROUP BY c.cwt_business_id, b.su_mdn
ORDER BY c.cwt_business_id, b.su_mdn;

使用道具 举报

注册会员

弦乐之花

精华贴数
0
技术积分
3711
社区积分
20
注册时间
2006-7-13
论坛徽章:
19
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44ITPUB北京2009年会纪念徽章
日期:2009-02-09 11:42:452010新春纪念徽章
日期:2010-03-01 11:06:13BLOG每日发帖之星
日期:2010-03-28 01:01:02ITPUB9周年纪念徽章
日期:2010-10-08 09:31:222012新春纪念徽章
日期:2012-01-04 11:51:22
发表于 2007-6-1 11:50:38 |显示全部楼层
可否请斑竹说清楚些
我执行语句报
ERROR at line 2:
ORA-00942: table or view does not exist

使用道具 举报

注册会员

弦乐之花

精华贴数
0
技术积分
3711
社区积分
20
注册时间
2006-7-13
论坛徽章:
19
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44ITPUB北京2009年会纪念徽章
日期:2009-02-09 11:42:452010新春纪念徽章
日期:2010-03-01 11:06:13BLOG每日发帖之星
日期:2010-03-28 01:01:02ITPUB9周年纪念徽章
日期:2010-10-08 09:31:222012新春纪念徽章
日期:2012-01-04 11:51:22
发表于 2007-6-7 09:44:37 |显示全部楼层
经过这段时间的思考,我觉得应该是oracle的归档进程的管理机制所产生的。
首先oracle初始化参数log_archive_max_processes决定初始启动的归档进程数。
可以查看v$archive_processes视图或系统进程,注意到其实oracle从一开始就启动了log_archive_max_processes所指定的数目,只是大家可以看看他们的状态。
从报出来的提示看,oracle对归档进程的管理应该是采用了竞争机制,类似于lgwr进程每3秒激活一次,arch也是定期的激活或者是由日志切换触发(我觉得后者更合理),所有归档进程都去归档需要归档的日志,肉少狼多,没肉吃的就只好‘抱怨’了!
所以这的确只是一个harmless提示!!!
但是!!!oracle如果在这样环境里给用户这么个信息,不是自找没趣吗?!
oracle还没这么傻吧!
既然不是oracle的话,那就要看自己了!
如果已经起用了自动归档,这时你在做手工归档看看!
问题出现了!!!
这才是问题的本源!
遇到类似问题的朋友,仔细想想,自己是不是这种情况?
当然千奇百怪的错误总是会有的,有不是这种情况的朋友帖出来看看吧!
至于在网上常看到有人说是归档过慢之类的原因,我觉得oracle不会这么傻吧!
既然已经交给一个归档进程去做了,那慢又怎么样?杀掉这个任务换个家伙去干?况且oracle怎么判断他慢呢?就算可以给个标准,那至少也该有个参数控制吧!可我并没有找到这样的参数!如果是内固的话,我只能说产品太没人情味了!
至于说与log_archive_max_processes有关,oracle觉得慢,又调用了一个进程去归档它,那更是自相矛盾了!!!从日志看,oracle是对正在归档的日志加锁了的,就算慢,也不可能去启动另一个进程去归档它!如果可以的话,也不用那个提示了!
以上只是自己在一个合理的假设内所做的推断,还请大家多多指教,有什么不足还请大家指正!!!

使用道具 举报

注册会员

弦乐之花

精华贴数
0
技术积分
3711
社区积分
20
注册时间
2006-7-13
论坛徽章:
19
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44ITPUB北京2009年会纪念徽章
日期:2009-02-09 11:42:452010新春纪念徽章
日期:2010-03-01 11:06:13BLOG每日发帖之星
日期:2010-03-28 01:01:02ITPUB9周年纪念徽章
日期:2010-10-08 09:31:222012新春纪念徽章
日期:2012-01-04 11:51:22
发表于 2007-6-7 11:10:31 |显示全部楼层
日志摘录
Thu Jun  7 10:42:51 2007
ARCH: Evaluating archive   log 2 thread 1 sequence 488
ARCH: Beginning to archive log 2 thread 1 sequence 488
Creating archive destination LOG_ARCHIVE_DEST_1: '/home/oracle/product/9204/dbs/arch/1_488.dbf'
Thu Jun  7 10:42:51 2007
ARC0: Evaluating archive   log 2 thread 1 sequence 488
ARC0: Unable to archive log 2 thread 1 sequence 488
      Log actively being archived by another process
Thu Jun  7 10:42:52 2007
ARCH: Completed archiving  log 2 thread 1 sequence 488
Thu Jun  7 10:45:10 2007
ALTER SYSTEM SET log_archive_start=FALSE SCOPE=SPFILE;
Thu Jun  7 10:45:43 2007
Thu Jun  7 10:46:20 2007
ALTER DATABASE OPEN
Thu Jun  7 10:46:46 2007
ARCH: Evaluating archive   log 3 thread 1 sequence 489
ARCH: Beginning to archive log 3 thread 1 sequence 489
Creating archive destination LOG_ARCHIVE_DEST_1: '/home/oracle/product/9204/dbs/arch/1_489.dbf'
Thu Jun  7 10:46:46 2007
Thread 1 advanced to log sequence 490
  Current log# 1 seq# 490 mem# 0: /home/oradata/gias/logfile/redo01.log
Thu Jun  7 10:46:46 2007
ARCH: Completed archiving  log 3 thread 1 sequence 489

使用道具 举报

注册会员

弦乐之花

精华贴数
0
技术积分
3711
社区积分
20
注册时间
2006-7-13
论坛徽章:
19
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44ITPUB北京2009年会纪念徽章
日期:2009-02-09 11:42:452010新春纪念徽章
日期:2010-03-01 11:06:13BLOG每日发帖之星
日期:2010-03-28 01:01:02ITPUB9周年纪念徽章
日期:2010-10-08 09:31:222012新春纪念徽章
日期:2012-01-04 11:51:22
发表于 2007-6-7 11:24:02 |显示全部楼层
补充两点:
1对于10G模拟不出来结果是因为oracle已经不在使用
log_archive_start
这个参数了
2实际上仔细观察日志会发现实际上oracle可能采用的是队列机制
,在日志中可以看到arch0 arch1是交叉运行的,这样可以保证进程分配不会冲突

使用道具 举报

注册会员

老会员

精华贴数
1
技术积分
1774
社区积分
10
注册时间
2002-10-16
论坛徽章:
7
授权会员
日期:2005-10-30 17:05:332009日食纪念
日期:2009-07-22 09:30:00ITPUB8周年纪念徽章
日期:2009-09-27 10:21:20祖国60周年纪念徽章
日期:2009-10-09 08:28:002010新春纪念徽章
日期:2010-03-01 11:20:52ITPUB9周年纪念徽章
日期:2010-10-08 09:34:01ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41
发表于 2008-1-1 01:02:07 |显示全部楼层
Purpose

When archiving locally and remotely using the ARCH process where the remote destination is across a saturated or slow network you can receive the following errors in the alert log:



ARC0: Evaluating archive   log 2 thread 1 sequence 100

ARC0: Unable to archive log 2 thread 1 sequence 100

      Log actively being archived by another process



If the ARCH process is unable to archive at the rate at which online logs are switched then it is possible for the primary database to suspend while waiting for archiving to complete.  The following discussion describes how this can occur.


Default Behavior for 9iR2 and Below


The ARCH process sits in a very tight loop waiting for an update to the controlfile that states an online log needs to be archived.  Once the update occurs the ARCH process builds a list of archive destinations that need to be serviced.  Once this list is complete, the ARCH process will read a one megabyte chunk of data from the online log that is to be archived.  This one megabyte chunk is then sent to the first destination in the list.  When the write has completed, the same one megabyte chunk is written to the second destination.  This continues until all of the data from the online log being archived has been written to all destinations.  So it can be said that archiving is only as fast as the slowest destination.



A common misconception is that if the LOG_ARCHIVE_DEST_n parameter for a particular destination has the OPTIONAL attribute set, then that destination will not impede local archiving. This is true during error situations while archiving to that destination - e.g. a network disconnect error, but not during an archival over a slow network, which is not an error situation. In error situations, whether the destination is marked OPTIONAL or MANDATORY, Data Guard will close that destination and continue transmitting to all other valid destinations. Transmitting to the closed destination will be attempted again only after the time specified in the REOPEN attribute has expired and a log switch has occurred.  This process will continue for the number of times specified by the MAX_FAILURE attribute. During this time, it is possible that the log writer process recycles through the available online redo log groups and tries to use the online redo log file which has not yet been transmitted successfully to the remote destination. If the destination is marked OPTIONAL, log writer will reuse the online redo log file for the next set of redo. If the destination is marked MANDATORY,  log writer will not be able to reuse that online redo log file, and the primary database will delay processing until that online redo log file has been successfully transmitted to the remote destination.

However, the situation is very different if the transmission is being done over a slow network. In this case, no error is encountered and the destination is not closed. Transmission continues, but is very slow. Ultimately, with the unavailability of any more online redo log groups, Log writer may suspend because the archive process is taking a long time to complete its archival, including local archival.



Refining the Default Behavior


The following underscore parameter was introduced as of 9.2.0.5 to allow the DBA to change this default behavior:



_LOG_ARCHIVE_CALLOUT='LOCAL_FIRST=TRUE'



If the above parameter is set then the ARCH process will begin archiving to the local destination first.  Once the redo log has been completely and successfully archived to at least one local destination, it will then be transmitted to the remote destination. This is the default behavior beginning with Oracle Database 10g Release 1.





Starting in 9.2.0.7 patchsets, one ARCH process will begin acting as a 'dedicated' archiver, handling only local archival duties. It will not perform remote log shipping or service FAL requests. This is a backport of behavior from 10gR1 to 9iR2.



From Metalink: 260040.1
It all comes down to Oracle basics...

使用道具 举报

注册会员

秋风

精华贴数
1
技术积分
13604
社区积分
3805
注册时间
2004-5-8
论坛徽章:
24
生肖徽章2007版:龙
日期:2008-05-06 11:07:482012新春纪念徽章
日期:2012-01-04 11:49:54咸鸭蛋
日期:2011-10-19 10:09:12ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
发表于 2008-1-2 20:34:02 |显示全部楼层
学习

使用道具 举报

注册会员

弦乐之花

精华贴数
0
技术积分
3711
社区积分
20
注册时间
2006-7-13
论坛徽章:
19
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44ITPUB北京2009年会纪念徽章
日期:2009-02-09 11:42:452010新春纪念徽章
日期:2010-03-01 11:06:13BLOG每日发帖之星
日期:2010-03-28 01:01:02ITPUB9周年纪念徽章
日期:2010-10-08 09:31:222012新春纪念徽章
日期:2012-01-04 11:51:22
发表于 2008-1-4 14:10:08 |显示全部楼层
谢谢
具体原因eygle版主已经查明证实了
http://www.eygle.com/archives/20 ... e_process_more.html
我这里没有使用dg
database version 9204
另外可以
看看
v$archived_log.CREATOR
让一切都沉寂的最强小夜曲
绝对的力量,并不是决定命运的全部理由
绝对的意志,并不是决定命运的全部理由
杭州招聘资深MySQL DBA
个人Bloghttp://shiri512003.itpub.net/

使用道具 举报

相关内容推荐
您需要登录后才可以回帖 登录 | 注册

TOP技术积分榜 社区积分榜 徽章 电子杂志 团队 统计 邮箱 虎吧 老博客 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档 | IT博客
CopyRight 1999-2011 itpub.net All Right Reserved. 北京皓辰网域网络信息技术有限公司版权所有 联系我们 网站律师 隐私政策 知识产权声明
京ICP证:060528号 北京市公安局海淀分局网监中心备案编号:1101082001 广播电视节目制作经营许可证:编号(京)字第1149号
  
回顶部