RMAN備份異機恢復流程總結
測試環境資訊:
源:
IP地址:10.130.160.200
OS:RedHat as 5.5
:10.2.0.4 x64
ORACLE_SID=orcl
目的伺服器:
IP地址:10.130.171.29
OS: CentOS 5.4
Oracle:10.2.0.4 x64
ORACLE_SID=orcl
源伺服器RMAN備份:(包括資料檔案、歸檔日誌檔案、控制檔案和引數檔案)
--建立備份目錄:
[root@dba1 ~]# mkdir /backup
[root@dba1 ~]# chmod 775 /backup
[root@dba1 ~]# chown oracle.oinstall /backup
--生成pfile
[root@dba1 ~]# su – oracle
[oracle@dba1 ~]$sqlplus / as sysdba
SQL> create pfile=’/backup/pfile_orcl_2116.ora’ from spfile;
--Rman全備
[oracle@dba1 ~]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Dec 17 15:58:07 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1156269023)
RMAN> run{
allocate channel c1 device type disk;
backup as compressed backupset
format ' /backup/db_full_%d_%I_%u.bak'
tag '2011-12-16-full'
database plus archivelog;
release channel c1;
backup current controlfile format ' /backup/control_20111216.bak';
backup spfile format ' /backup/spfile_20111216.bak';
}
--使用SCP傳送到目的伺服器:10.130.171.29
[oracle@dba1 backup]$ scp *.*
目的伺服器做好恢復的相關準備工作:
--建立儲存Rman備份的目錄:
[root@dba2 ~]# mkdir /backup
[root@dba2 ~]# chmod 775 /backup
[root@dba2 ~]# chown oracle.oinstall /backup
--建立例項ORCL的相關目錄:
mkdir -p /oracle/admin/orcl/{adump,bdump,cdump,dpdump,pfile,udump}
mkdir -p $ORACLE_BASE/flash_recovery_area/
mkdir -p $ORACLE_BASE/oradata/orcl
--建立口令檔案:
[oracle@dba1]$ orapwd file=$ORACLE_HOME/dbs/orapworcl password=
[oracle@dba1]$ strings $ORACLE_HOME/dbs/orapworcl
--生產引數檔案
[oracle@dba1]$ export ORACLE_SID=orcl
[oracle@dba1]$ sqlplus / as sysdba
SQL> create spfile from pfile=’ /backup/pfile_orcl_2116.ora’;
--RMAN恢復
[oracle@dba1]$ export ORACLE_SID=orcl
[oracle@dba1]$ rman target/
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Dec 17 15:58:07 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORCL (not started)
RMAN> set dbid=1156269023; //指定DBID,需要和源伺服器的DBID一致
RMAN> starup nomount;
RMAN> restore controlfile from '/backup/control_20111216.bak'; --恢復控制檔案
RMAN> restore database; --還原資料庫檔案
RMAN> recover database; --恢復資料庫檔案,這裡將報錯
Starting recover at 17-DEC-11 using channel ORA_DISK_1 starting media recovery channel ORA_DISK_1: starting archive log restore to default destination channel ORA_DISK_1: restoring archive log archive log thread=1 sequence=5661 channel ORA_DISK_1: reading from backup piece / backup/db_full_orcl_1156269023_8umubkf5.bak channel ORA_DISK_1: restored backup piece 1 piece handle=/ backup/db_full_orcl_1156269023_8umubkf5.bak tag=2011-12-16-FULL channel ORA_DISK_1: restore complete, elapsed time: 00:00:03 archive log filename=/oracle/oraarch/1_5661_764212959.dbf thread=1 sequence=5661 unable to find archive log archive log thread=1 sequence=5662 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 12/17/2011 20:08:56 RMAN-06054: media recovery requesting unknown log: thread 1 seq 5662 lowscn 68375127548 |
--在sqlplus中對資料庫進行until cancel操作後以resetlogs open
[oracle@dba1 ~]$ sqlplus sys@orcl as sysdba
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 68375127548 generated at 12/16/2011 10:56:37 needed for
thread 1
ORA-00289: suggestion : /oracle/oraarch/1_5662_764212959.dbf
ORA-00280: change 68375127548 for thread 1 is in sequence #5662
Specify log: {
cancel
Media recovery cancelled.
SQL> alter database open resetlogs;
Database altered.
SQL> select status from v$instance;
STATUS
------------
OPEN
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/196700/viewspace-713555/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RMAN異機恢復總結
- oracle RMAN 備份恢復總結Oracle
- oracle RMAN 備份恢復總結Oracle
- [記錄]oracle RMAN 備份恢復總結Oracle
- 用 RMAN 備份異機恢復 遷移資料
- oracle 10.2.0.1 win 32 rman 備份異機恢復Oracle
- Oracle備份恢復之熱備份恢復及異機恢復Oracle
- 使用RMAN實現異機備份恢復(WIN平臺)
- standby全庫rman備份檔案恢復到異機
- oracle冷備份、恢復和異機恢復Oracle
- RMAN備份恢復原理
- Oracle的RMAN備份恢復,先從進入RMAN開始總結Oracle
- rman備份恢復-rman入門
- OceanBase-OB備份異地恢復流程
- 同平臺異機備份恢復
- 備份恢復總結(一則)
- Oracle RMAN異機恢復Oracle
- RMAN備份與恢復之加密備份加密
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- rman恢復方案和oracle異機恢復Oracle
- 資料庫備份與異機恢復——熱備份方式資料庫
- Oracle備份與恢復總結[轉]Oracle
- rman備份恢復-rman恢復資料檔案測試
- RMAN備份恢復典型案例——RMAN備份&系統變慢
- oracle的RMAN異機恢復Oracle
- RMAN備份恢復效能優化優化
- rman備份恢復命令之switch
- RMAN備份恢復整個庫
- oracle rman備份恢復的例子Oracle
- ORACLE RMAN異機異目錄恢復Oracle
- 楊廷琨大師總結:RMAN備份恢復--RAC環境資料庫的備份資料庫
- RMAN備份恢復——備份到帶庫的效能
- controlfile備份恢復總結(轉)
- G017-ORACLE-MIGRATION-01 RMAN備份異機不完全恢復Oracle
- ORACLE中採用rman備份異機恢復資料庫詳細過程Oracle資料庫
- windows主機下使用rman恢復備份到不同主機Windows
- RMAN備份恢復之控制檔案的恢復(三)
- RMAN備份恢復之控制檔案的恢復(二)