分享
 
 
 

使用过的rman备份集的变化

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

在Nocatalog的情况下,硬盘上的Rman备份集在使用一次后,控制文件发生了变化。

不但备份集中控制文件的文件时间发生了变化,我猜想内容也发生了变化。

之后再次使用这个备份集进行恢复操作,碰到错误。

本文记录了这个过程,以及如何解决。

恢复orapw文件 :

[Oracle@shdemo1 dbs]$ orapwd file=orapwdevb passWord=123456 entries=20

[oracle@shdemo1 dbs]$

[oracle@shdemo1 dbs]$ sqlplus /nolog

SQL*Plus: Release 9.2.0.4.0 - ProdUCtion on Wed May 10 15:54:49 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> conn sys/123456@devb as sysdba

Connected to an idle instance.

SQL> startup nomount

ORA-01031: insufficient privileges

SQL>

SQL> disc

Disconnected

SQL> conn / as sysdba

Connected to an idle instance.

SQL>

SQL> startup nomount

ORACLE instance started.

Total System Global Area 42742804 bytes

Fixed Size 451604 bytes

Variable Size 41943040 bytes

Database Buffers 204800 bytes

Redo Buffers 143360 bytes

SQL>

恢复 spfile:

[oracle@shdemo1 devb]$ rman nocatalog

Recovery Manager: Release 9.2.0.4.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

RMAN> connect target

connected to target database: devb (not mounted)

using target database controlfile instead of recovery catalog

RMAN> set DBID=1179520070

executing command: SET DBID

RMAN> restore spfile from autobackup;

Starting restore at 10-MAY-06

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=10 devtype=DISK

channel ORA_DISK_1: looking for autobackup on day: 20060510

channel ORA_DISK_1: looking for autobackup on day: 20060509

channel ORA_DISK_1: looking for autobackup on day: 20060508

channel ORA_DISK_1: looking for autobackup on day: 20060507

channel ORA_DISK_1: looking for autobackup on day: 20060506

channel ORA_DISK_1: looking for autobackup on day: 20060505

channel ORA_DISK_1: looking for autobackup on day: 20060504

channel ORA_DISK_1: no autobackup in 7 days found

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of restore command at 05/10/2006 15:57:57

RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

RMAN> restore spfile from '/home/oracle/backup/devb/c-1179520070-20060510-05';

Starting restore at 10-MAY-06

using channel ORA_DISK_1

channel ORA_DISK_1: autobackup found: /home/oracle/backup/devb/c-1179520070-20060510-05

channel ORA_DISK_1: SPFILE restore from autobackup complete

Finished restore at 10-MAY-06

RMAN>

恢复control file:

SQL> shutdown immediate

ORA-01507: database not mounted

ORACLE instance shut down.

SQL> conn / as sysdba

Connected to an idle instance.

SQL> startup nomount

ORACLE instance started.

Total System Global Area 236000356 bytes

Fixed Size 451684 bytes

Variable Size 201326592 bytes

Database Buffers 33554432 bytes

Redo Buffers 667648 bytes

SQL>

[oracle@shdemo1 devb]$

[oracle@shdemo1 devb]$

[oracle@shdemo1 devb]$ rman nocatalog

Recovery Manager: Release 9.2.0.4.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

RMAN> connect target

connected to target database: devb (not mounted)

using target database controlfile instead of recovery catalog

RMAN> set DBID=1179520070

executing command: SET DBID

RMAN> restore controlfile from '/home/oracle/backup/devb/c-1179520070-20060510-05';

Starting restore at 10-MAY-06

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=14 devtype=DISK

channel ORA_DISK_1: restoring controlfile

channel ORA_DISK_1: restore complete

replicating controlfile

input filename=/usr/app/oracle/oradata/devb/control01.ctl

output filename=/usr/app/oracle/oradata/devb/control02.ctl

output filename=/usr/app/oracle/oradata/devb/control03.ctl

Finished restore at 10-MAY-06

RMAN> restore database;

.....

RMAN>alter database open resetlogs;

数据库恢复完毕。

使用RMAN恢复,打开数据库使用alter database open resetlogs;

此备份放在硬盘上,只有一份。

此时做试验,将数据库相关文件全部删除后试图用RMAN再次恢复,结果:

spfile 和 controlfile 可以恢复,但是数据文件无法恢复了:

如下所示:

RMAN> restore database;

Starting restore at 10-MAY-06

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=14 devtype=DISK

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of restore command at 05/10/2006 16:21:43

RMAN-06026: some targets not found - aborting restore

RMAN-06023: no backup or copy of datafile 10 found to restore

RMAN-06023: no backup or copy of datafile 9 found to restore

RMAN-06023: no backup or copy of datafile 8 found to restore

RMAN-06023: no backup or copy of datafile 7 found to restore

RMAN-06023: no backup or copy of datafile 6 found to restore

RMAN-06023: no backup or copy of datafile 5 found to restore

RMAN-06023: no backup or copy of datafile 4 found to restore

RMAN-06023: no backup or copy of datafile 3 found to restore

RMAN-06023: no backup or copy of datafile 2 found to restore

RMAN-06023: no backup or copy of datafile 1 found to restore

网上查了一下,原来在尝试恢复中使用了_allow_resetlogs_corruption参数,resetlogs之后,Oracle使用当前的控制文件不答应从这个历史备份集中进行恢复。

由于我没有使用catalog,所以尝试使用dbms_backup_restore进行恢复。

[oracle@shdemo1 devb]$ sqlplus /nolog

SQL*Plus: Release 9.2.0.4.0 - Production on Wed May 10 16:29:26 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL>

SQL> shutdown immediate

ORA-01012: not logged on

SQL> conn / as sysdba

Connected.

SQL> shutdown immediate

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

SQL> startup nomount

ORACLE instance started.

Total System Global Area 236000356 bytes

Fixed Size 451684 bytes

Variable Size 201326592 bytes

Database Buffers 33554432 bytes

Redo Buffers 667648 bytes

SQL> DECLARE

2 devtype varchar2(256);

3 done boolean;

4 BEGIN

5 devtype:=sys.dbms_backup_restore.deviceAllocate (type=>'',ident=>'t1');

6 sys.dbms_backup_restore.restoreSetDatafile;

7 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>01, toname=>'/usr/app/oracle/oradata/devb/system01.dbf');

8 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>02, toname=>'/usr/app/oracle/oradata/devb/undotbs01.dbf');

9 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>03, toname=>'/usr/app/oracle/oradata/devb/cwmlite01.dbf');

10 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>04, toname=>'/usr/app/oracle/oradata/devb/drsys01.dbf');

11 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>05, toname=>'/usr/app/oracle/oradata/devb/example01.dbf');

12 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>06, toname=>'/usr/app/oracle/oradata/devb/indx01.dbf');

13 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>07, toname=>'/usr/app/oracle/oradata/devb/odm01.dbf');

14 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>08, toname=>'/usr/app/oracle/oradata/devb/tools01.dbf');

15 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>09, toname=>'/usr/app/oracle/oradata/devb/users01.dbf');

16 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>10, toname=>'/usr/app/oracle/oradata/devb/xdb01.dbf');

17 sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'/home/oracle/backup/devb/df_DEVB_43_1_1.bak', params=>null);

18 sys.dbms_backup_restore.deviceDeallocate;

19 END;

20 /

PL/SQL procedure successfully completed.

SQL> alter database mount;

Database altered.

SQL> recover database;

ORA-00283: recovery session canceled due to errors

ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

SQL> recover database using backup controlfile until cancel;

ORA-00283: recovery session canceled due to errors

ORA-01190: controlfile or data file 1 is from before the last RESETLOGS

ORA-01110: data file 1: '/usr/app/oracle/oradata/devb/system01.dbf'

SQL>

SQL>

SQL>

SQL>

SQL> alter database backup controlfile to trace;

Database altered.

SQL>

原来的controlfile 已不能使用,所以重建controlfile;

trace文件在 user_dump_desc 下。

即 /usr/app/oracle/admin/devb/udump

找到最新的trc文件

SQL>

SQL> shutdown immediate

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

SQL> startup nomount

ORACLE instance started.

Total System Global Area 236000356 bytes

Fixed Size 451684 bytes

Variable Size 201326592 bytes

Database Buffers 33554432 bytes

Redo Buffers 667648 bytes

SQL>

SQL> CREATE CONTROLFILE REUSE DATABASE "DEVB" RESETLOGS ARCHIVELOG

2 -- SET STANDBY TO MAXIMIZE PERFORMANCE

3 MAXLOGFILES 50

4 MAXLOGMEMBERS 5

5 MAXDATAFILES 100

6 MAXINSTANCES 1

7 MAXLOGHISTORY 226

8 LOGFILE

9 GROUP 1 '/usr/app/oracle/oradata/devb/redo01.log' SIZE 100M,

10 GROUP 2 '/usr/app/oracle/oradata/devb/redo02.log' SIZE 100M,

11 GROUP 3 '/usr/app/oracle/oradata/devb/redo03.log' SIZE 100M

12 -- STANDBY LOGFILE

13 DATAFILE

14 '/usr/app/oracle/oradata/devb/system01.dbf',

15 '/usr/app/oracle/oradata/devb/undotbs01.dbf',

16 '/usr/app/oracle/oradata/devb/cwmlite01.dbf',

17 '/usr/app/oracle/oradata/devb/drsys01.dbf',

18 '/usr/app/oracle/oradata/devb/example01.dbf',

19 '/usr/app/oracle/oradata/devb/indx01.dbf',

20 '/usr/app/oracle/oradata/devb/odm01.dbf',

21 '/usr/app/oracle/oradata/devb/tools01.dbf',

22 '/usr/app/oracle/oradata/devb/users01.dbf',

23 '/usr/app/oracle/oradata/devb/xdb01.dbf'

24 CHARACTER SET ZHS16GBK

25 ;

Control file created.

SQL> recover database;

ORA-00283: recovery session canceled due to errors

ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

SQL> recover database using backup controlfile until cancel;

ORA-00279: change 20469549 generated at 05/10/2006 11:52:29 needed for thread 1

ORA-00289: suggestion : /usr/app/oracle/product/9.2.0.4/dbs/arch1_3.dbf

ORA-00280: change 20469549 for thread 1 is in sequence #3

Specify log: {<

RET>=suggested filename AUTO CANCEL}

CANCEL

Media recovery cancelled.

SQL>

SQL> alter database open resetlogs;

Database altered.

SQL>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有