用RMAN備份archivelog的一個疑惑!

[复制链接]
查看11 | 回复4 | 2005-10-30 17:05:33 | 显示全部楼层 |阅读模式
為什麼用:RMAN> run{
2> allocate channel c1 type disk;
3> backup archivelog all format 'd:\rmanbak\%T_%s_%p.arc' delete input;
4> }
會失敗,但是加上一句sql 'alter system archive log current';
RMAN> run{
2> sql 'alter system archive log current';
3> allocate channel c1 type disk;
4> backup archivelog all format 'd:\rmanbak\%T_%s_%p.arc' delete input;
5> }
之後又成功呢?

RMAN> run{
2> allocate channel c1 type disk;
3> backup archivelog all format 'd:\rmanbak\%T_%s_%p.arc' delete input;
4> }
RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: c1
RMAN-08500: channel c1: sid=15 devtype=DISK
RMAN-03022: compiling command: backup
RMAN-03026: error recovery releasing channel resources
RMAN-08031: released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure during compilation of command
RMAN-03013: command type: backup
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20242: specification does not match any archivelog in the recovery catalog
RMAN> run{
2> sql 'alter system archive log current';
3> allocate channel c1 type disk;
4> backup archivelog all format 'd:\rmanbak\%T_%s_%p.arc' delete input;
5> }
RMAN-03022: compiling command: sql
RMAN-06162: sql statement: alter system archive log current
RMAN-03023: executing command: sql
RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: c1
RMAN-08500: channel c1: sid=15 devtype=DISK
RMAN-03022: compiling command: backup
RMAN-03025: performing implicit partial resync of recovery catalog
RMAN-03023: executing command: partial resync
RMAN-08003: starting partial resync of recovery catalog
RMAN-08005: partial resync complete
RMAN-03023: executing command: backup
RMAN-08009: channel c1: starting archivelog backupset
RMAN-08502: set_count=51 set_stamp=546712530 creation_time=20050104163530
RMAN-08014: channel c1: specifying archivelog(s) in backup set
RMAN-08504: input archivelog thread=1 sequence=27 recid=46 stamp=546712530
RMAN-08013: channel c1: piece 1 created
RMAN-08503: piece handle=D:\RMANBAK\%T_51_1.ARC comment=NONE
RMAN-08525: backup set complete, elapsed time: 00:00:02
RMAN-08071: channel c1: deleting archivelog(s)
RMAN-08514: archivelog filename=D:\ORACLE\ORADATA\ORAPLUS\ARCHIVE\ORAPLUST001S00027.ARC recid=46 stamp=546712530
RMAN-03023: executing command: partial resync
RMAN-08003: starting partial resync of recovery catalog
RMAN-08005: partial resync complete
RMAN-08031: released channel: c1
RMAN>
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
我知道了,報錯是因為我在跑run{
2> allocate channel c1 type disk;
3> backup archivelog all format 'd:\rmanbak\%T_%s_%p.arc' delete input;
4> }
的時候由於數據庫當前沒有archivelog,所以報錯。
而第二種方法可以是因為有一句sql 'alter system archive log current';
產生了archivelog 所以沒有報錯。
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
alter system archive log current;是将当前使用的日志手工归档,你的数据库是什么版本?
备份不成功可能是你根本就还没有生成归档日志时却进行归档日志的备份啊?
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
呵呵,你的分析是對的。
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
it's only becuase rman catalog get confused. If you don't use catalog,
"alter system archive log crurrent" will be automatically done.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行