應對RMAN-06026錯誤,使用dbms_backup_restore進行恢復
在做從dcfxhy資料庫異地恢復至本機遇到的問題,在主要是在rman下list backup中看到了該備份,但是restore的時候無法恢復。
後來看到了Eygle 的一篇文章,跟我的問題一致,引用下,算是個總結:
昨天做一個實驗,結果把資料庫搞壞了,當試圖進行恢復時居然報了RMAN-06026錯誤。 回想一下,原來在嘗試恢復中使用了_allow_resetlogs_corruption引數,resetlogs之後,Oracle使用當前的控制檔案不允許從這個歷史備份集中進行恢復。
由於我沒有使用catalog,所以嘗試使用dbms_backup_restore進行恢復。
1.錯誤資訊
我們看到雖然list backup可以顯示備份集,但是無法進行恢復,錯誤為RMAN-06026,RMAN-06026。
[oracle@jumper oradata]$ rman target /
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: CONNER (DBID=3152029224)
RMAN> restore database;
Starting restore at 11-JUN-05
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=11 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/11/2005 01:19:01
RMAN-06026: some targets not found - aborting 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
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
13 Full 1G DISK 00:03:20 09-JUN-05
BP Key: 13 Status: AVAILABLE Tag: TAG20050609T173346
Piece Name: /opt/oracle/product/9.2.0/dbs/0ggmiabq_1_1
SPFILE Included: Modification time: 08-JUN-05
List of Datafiles in backup set 13
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 240560269 09-JUN-05 /opt/oracle/oradata/conner/system01.dbf
2 Full 240560269 09-JUN-05 /opt/oracle/oradata/conner/undotbs01.dbf
3 Full 240560269 09-JUN-05 /opt/oracle/oradata/conner/users01.dbf
RMAN> exit
Recovery Manager complete.
2.使用dbms_backup_restore進行恢復
dbms_backup_restore是一個非常強大的package,可以在資料庫nomount下使用,用於從備份集中讀取各類檔案。
本例使用如下指令碼:
DECLARE
devtype varchar2(256);
done boolean;
BEGIN
devtype:=sys.dbms_backup_restore.deviceAllocate (type=>'',ident=>'t1');
sys.dbms_backup_restore.restoreSetDatafile;
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>01,toname=>'/opt/oracle/oradata/conner/system01.dbf');
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>02,toname=>'/opt/oracle/oradata/conner/undotbs01.dbf');
sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>03,toname=>'/opt/oracle/oradata/conner/users01.dbf');
sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'/opt/oracle/product/9.2.0/dbs/0ggmiabq_1_1', params=>null);
sys.dbms_backup_restore.deviceDeallocate;
END;
/
3.執行恢復
[oracle@jumper conner]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Sat Jun 11 01:24:34 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 101782828 bytes
Fixed Size 451884 bytes
Variable Size 37748736 bytes
Database Buffers 62914560 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=>'/opt/oracle/oradata/conner/system01.dbf');
8 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>02,toname=>'/opt/oracle/oradata/conner/undotbs01.dbf');
9 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>03,toname=>'/opt/oracle/oradata/conner/users01.dbf');
10 sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'/opt/oracle/product/9.2.0/dbs/0ggmiabq_1_1',
params=>null);
11 sys.dbms_backup_restore.deviceDeallocate;
12 END;
13 /
PL/SQL procedure successfully completed.
SQL>
至此,從備份集中讀取檔案完畢。
4.恢復控制檔案
由於大意,也沒有備份控制檔案,所以只好重建控制檔案。
SQL> alter database mount;
Database altered.
SQL> alter database backup controlfile to trace;
Database altered.
找到trace檔案,編輯、執行重建控制檔案需要部分:
[oracle@jumper oracle]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Sat Jun 11 01:30:50 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 101782828 bytes
Fixed Size 451884 bytes
Variable Size 37748736 bytes
Database Buffers 62914560 bytes
Redo Buffers 667648 bytes
SQL> set echo on
SQL> @ctl
SQL>
SQL> CREATE CONTROLFILE REUSE DATABASE "CONNER" RESETLOGS ARCHIVELOG
2 -- SET STANDBY TO MAXIMIZE PERFORMANCE
3 MAXLOGFILES 5
4 MAXLOGMEMBERS 3
5 MAXDATAFILES 100
6 MAXINSTANCES 1
7 MAXLOGHISTORY 1361
8 LOGFILE
9 GROUP 1 '/opt/oracle/oradata/conner/redo01.log' SIZE 10M,
10 GROUP 2 '/opt/oracle/oradata/conner/redo02.log' SIZE 10M,
11 GROUP 3 '/opt/oracle/oradata/conner/redo03.log' SIZE 10M
12 -- STANDBY LOGFILE
13 DATAFILE
14 '/opt/oracle/oradata/conner/system01.dbf',
15 '/opt/oracle/oradata/conner/undotbs01.dbf',
16 '/opt/oracle/oradata/conner/users01.dbf'
17 CHARACTER SET ZHS16GBK
18 ;
Control file created.
5.執行恢復
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 240560269 generated at 06/09/2005 17:33:48 needed for thread 1
ORA-00289: suggestion : /opt/oracle/oradata/conner/archive/1_7.dbf
ORA-00280: change 240560269 for thread 1 is in sequence #7
Specify log: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00279: change 240600632 generated at 06/10/2005 10:42:26 needed for thread 1
ORA-00289: suggestion : /opt/oracle/oradata/conner/archive/1_8.dbf
ORA-00280: change 240600632 for thread 1 is in sequence #8
ORA-00278: log file '/opt/oracle/oradata/conner/archive/1_7.dbf' no longer needed for this recovery
Specify log: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00279: change 240620884 generated at 06/10/2005 10:45:42 needed for thread 1
ORA-00289: suggestion : /opt/oracle/oradata/conner/archive/1_9.dbf
ORA-00280: change 240620884 for thread 1 is in sequence #9
ORA-00278: log file '/opt/oracle/oradata/conner/archive/1_8.dbf' no longer needed for this recovery
ORA-00283: recovery session canceled due to errors
ORA-00600: internal error code, arguments: [3020], [4242465], [1], [9], [314], [272], [], []
ORA-10567: Redo is inconsistent with data block (file# 1, block# 48161)
ORA-10564: tablespace SYSTEM
ORA-01110: data file 1: '/opt/oracle/oradata/conner/system01.dbf'
ORA-10560: block type 'DATA SEGMENT HEADER - UNLIMITED'
ORA-01112: media recovery not started
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 240620949 generated at 06/10/2005 10:45:44 needed for thread 1
ORA-00289: suggestion : /opt/oracle/oradata/conner/archive/1_9.dbf
ORA-00280: change 240620949 for thread 1 is in sequence #9
Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> alter database open resetlogs;
Database altered.
SQL> select name from v$datafile;
NAME
------------------------------------------------------------
/opt/oracle/oradata/conner/system01.dbf
/opt/oracle/oradata/conner/undotbs01.dbf
/opt/oracle/oradata/conner/users01.dbf
SQL>
至此恢復完畢。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/196700/viewspace-740529/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Mysql 誤刪資料進行恢復MySql
- 深入理解 HDFS 錯誤恢復
- DM7使用DMRAMN對多次故障恢復後使用不同資料庫的歸檔進行恢復資料庫
- DBMS_BACKUP_RESTORE用於特殊情況下的恢復(轉)REST
- 【Mongo】Mongodump 與 mongorestore對mongo進行備份恢復GoREST
- 使用describe命令進行Kubernetes pod錯誤排查
- 【NetApp資料恢復案例】針對NetApp誤刪除資料的恢復APP資料恢復
- 使用ErrorStack進行錯誤跟蹤及診斷Error
- Flink 容錯恢復 2.0 2022 最新進展
- Hadoop錯誤之namenode當機的資料恢復Hadoop資料恢復
- rman恢復控制檔案的一個小錯誤
- 如何在HarmonyOS對資料庫進行備份,恢復與加密資料庫加密
- 【北亞伺服器資料恢復】LUN對映出錯導致檔案系統一致性錯誤的資料恢復案例伺服器資料恢復
- 使用 SAP ABAP Memory Inspector 對應用程式消耗記憶體進行檢測時常犯的錯誤試讀版記憶體
- Oracle 不完全恢復遇到的ORA-600錯誤Oracle
- 使用錯誤的運算子進行字串比較缺陷漏洞字串
- 歸檔路徑更改後,如何對資料庫進行恢復(轉)資料庫
- Mysql update誤操作恢復MySql
- hbase 恢復 誤刪除
- oracle 12c 針對cdb的差異0備與對pdb進行恢復Oracle
- react中進一步封裝axios,對錯誤資訊進行攔截React封裝iOS
- 對MediaPlayer的錯誤使用總結
- 如何使用Nginx對Artifactory進行http應用NginxHTTP
- 資料庫資料恢復—附加資料庫錯誤823的SQL Server資料恢復案例資料庫資料恢復SQLServer
- 【資料庫資料恢復】磁碟空間不足導致sql server錯誤的資料恢復資料庫資料恢復SQLServer
- 如何進行RAID0資料恢復AI資料恢復
- 在Linux中,如何進行資料恢復?Linux資料恢復
- 如何進行SQL Server容災恢復WISQLServer
- psql: 錯誤: 致命錯誤: 對使用者“postgres“的對等認證失敗SQL
- Oracle恢復誤刪資料Oracle
- eclipse 恢復誤刪檔案Eclipse
- mysql誤刪資料恢復MySql資料恢復
- 如何從釋出者和消費者方面使用rabbitmq進行恢復MQ
- SQL Server中使用臨時表進行資料備份與恢復SQLServer
- 恢復MySQL資料庫建立儲存過程是遇到錯誤MySql資料庫儲存過程
- ORA-01031: 資料庫恢復時的insufficient privileges錯誤QS資料庫
- 在Linux中,如何進行系統故障恢復?Linux
- 電腦照片誤刪了怎麼恢復?電腦誤刪檔案照片恢復教程
- Sybase ASE資料庫恢復,Sybase資料恢復,資料誤刪除恢復工具READSYBDEVICE資料庫資料恢復dev