国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

使用過的rman備份集的變化

2024-07-21 02:33:00
字體:
來源:轉載
供稿:網友
    在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>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 清河县| 满洲里市| 页游| 田林县| 奉化市| 卢龙县| 屯门区| 枣强县| 襄城县| 云浮市| 玉门市| 准格尔旗| 德格县| 漳州市| 江门市| 云龙县| 莆田市| 鄄城县| 鄂托克旗| 仁怀市| 义乌市| 蒙自县| 诸暨市| 南华县| 陵水| 九江市| 高台县| 呼和浩特市| 霍州市| 内黄县| 确山县| 高清| 丽水市| 宁津县| 湘阴县| 怀柔区| 永丰县| 崇明县| 获嘉县| 汝阳县| 南靖县|