oracle rac在裸裝置下的恢復
上一篇已經介紹了oracle rac在裸裝置下的備份,這一篇介紹在oracle rac在裸裝置下的恢復
首先備份並刪除上次全備份以來的歸檔日誌,然後準備開始恢復:
RMAN> run
2> {
3> allocate channel c1 device type disk format '/oradata/%U' connect ;
4> allocate channel c2 device type disk format '/oradata/%U' connect ;
5> backup archivelog all delete all input;
6> }
然後兩個節點都啟動到mount狀態:
rac1
rman target /
startup mount;
rac2
rman target /
startup mount;
如果只啟動其中一個節點,恢復資料檔案會不成功
RMAN> run
2> {
3> allocate channel c1 device type disk format '/oradata/U%' connect ;
4> allocate channel c2 device type disk format '/oradata/U%' connect ;
5> restore database;
6> }
allocated channel: c1
channel c1: sid=145 instance=rac1 devtype=DISK
allocated channel: c2
channel c2: sid=144 instance=rac2 devtype=DISK
Starting restore at 04-JAN-09
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to +DISKGROUP/rac/datafile/undotbs1.269.669804571
restoring datafile 00003 to +DISKGROUP/rac/datafile/sysaux.270.669804585
restoring datafile 00005 to +DISKGROUP/rac/datafile/users.278.672888597
restoring datafile 00007 to /oradata/paul01.dbf
channel c1: reading from backup piece /oradata/19k3trip_1_1
channel c2: starting datafile backupset restore
channel c2: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +DISKGROUP/rac/datafile/system.268.669804533
channel c2: reading from backup piece /oradata/1ak3trjc_1_1
channel c1: restored backup piece 1
piece handle=/oradata/19k3trip_1_1 tag=TAG20090103T230808
channel c1: restore complete, elapsed time: 00:00:52
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to +DISKGROUP/rac/datafile/undotbs2.272.669804611
channel c1: reading from backup piece /oradata/1bk3trjr_1_1
channel c2: restored backup piece 1
piece handle=/oradata/1ak3trjc_1_1 tag=TAG20090103T230808
channel c2: restore complete, elapsed time: 00:00:54
channel c1: restored backup piece 1
piece handle=/oradata/1bk3trjr_1_1 tag=TAG20090103T230808
channel c1: restore complete, elapsed time: 00:00:20
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00006 to +DISKGROUP/rac/datafile/test.277.669863437
channel c1: reading from backup piece /oradata/1ck3trk0_1_1
channel c1: restored backup piece 1
piece handle=/oradata/1ck3trk0_1_1 tag=TAG20090103T230808
channel c1: restore complete, elapsed time: 00:00:07
Finished restore at 04-JAN-09
released channel: c1
released channel: c2
現在連線到兩個例項恢復歸檔日誌檔案
RMAN> run
2> {
3> allocate channel c1 device type disk format '/oradata/U%' connect ;
allocate channel c2 device type disk format '/oradata/U%' connect ;
restore (archivelog sequence between 9 and 11 thread 1)
(archivelog sequence between 9 and 11 thread 2);4> 5> 6>
7> }
allocated channel: c1
channel c1: sid=145 instance=rac1 devtype=DISK
allocated channel: c2
channel c2: sid=144 instance=rac2 devtype=DISK
Starting restore at 04-JAN-09
channel c1: starting archive log restore to default destination
channel c1: restoring archive log
archive log thread=1 sequence=9
channel c1: restoring archive log
archive log thread=1 sequence=10
channel c1: restoring archive log
archive log thread=1 sequence=11
channel c1: reading from backup piece /oradata/1gk3u31j_1_1
channel c2: starting archive log restore to default destination
channel c2: restoring archive log
archive log thread=2 sequence=9
channel c2: restoring archive log
archive log thread=2 sequence=10
channel c2: reading from backup piece /oradata/1hk3u311_1_1
channel c1: restored backup piece 1
piece handle=/oradata/1gk3u31j_1_1 tag=TAG20090104T011530
channel c1: restore complete, elapsed time: 00:00:04
channel c2: restored backup piece 1
piece handle=/oradata/1hk3u311_1_1 tag=TAG20090104T011530
channel c2: restore complete, elapsed time: 00:00:05
channel c2: starting archive log restore to default destination
channel c2: restoring archive log
archive log thread=2 sequence=11
channel c2: reading from backup piece /oradata/1ik3u318_1_1
channel c2: restored backup piece 1
piece handle=/oradata/1ik3u318_1_1 tag=TAG20090104T011530
channel c2: restore complete, elapsed time: 00:00:00
Finished restore at 04-JAN-09
released channel: c1
released channel: c2
介質恢復
RMAN> run
{
allocate channel c1 device type disk format '/oradata/U%' connect ;
allocate channel c2 device type disk format '/oradata/U%' connect ; 2> 3> 4>
5> recover database;
6> }
allocated channel: c1
channel c1: sid=145 instance=rac1 devtype=DISK
allocated channel: c2
channel c2: sid=144 instance=rac2 devtype=DISK
Starting recover at 04-JAN-09
starting media recovery
archive log thread 1 sequence 9 is already on disk as file /arch/1_9_675209275.dbf
archive log thread 1 sequence 10 is already on disk as file /arch/1_10_675209275.dbf
archive log thread 1 sequence 11 is already on disk as file /arch/1_11_675209275.dbf
channel c1: starting archive log restore to default destination
channel c1: restoring archive log
archive log thread=1 sequence=8
channel c1: reading from backup piece /oradata/1dk3trkt_1_1
channel c1: restored backup piece 1
piece handle=/oradata/1dk3trkt_1_1 tag=TAG20090103T230917
channel c1: restore complete, elapsed time: 00:00:01
archive log filename=/arch/1_8_675209275.dbf thread=1 sequence=8
channel c2: starting archive log restore to default destination
channel c1: starting archive log restore to default destination
channel c2: restoring archive log
archive log thread=2 sequence=9
channel c1: restoring archive log
archive log thread=2 sequence=8
channel c1: reading from backup piece /oradata/1ek3trkv_1_1
channel c2: restoring archive log
archive log thread=2 sequence=10
channel c2: reading from backup piece /oradata/1hk3u311_1_1
channel c1: restored backup piece 1
piece handle=/oradata/1ek3trkv_1_1 tag=TAG20090103T230917
channel c1: restore complete, elapsed time: 00:00:02
archive log filename=/arch/2_8_675209275.dbf thread=2 sequence=8
archive log filename=/arch/1_9_675209275.dbf thread=1 sequence=9
channel c2: restored backup piece 1
piece handle=/oradata/1hk3u311_1_1 tag=TAG20090104T011530
channel c2: restore complete, elapsed time: 00:00:03
failover to previous backup
archive log filename=/arch/2_9_675209275.dbf thread=2 sequence=9
released channel: c1
released channel: c2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/04/2009 01:38:24
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/arch/2_9_675209275.dbf'
ORA-00308: cannot open archived log '/arch/2_9_675209275.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
但是對於恢復(RECOVER)操作,只能一個例項完成。
這是因為一個例項必須能同時看到兩個例項的歸檔日誌,這裡採用最簡單的方法,將節點2上的歸檔複製到節點1的歸檔目錄下。 拷過去恢復就可以了
RMAN> run
{
allocate channel c1 device type disk format '/oradata/U%' connect ;
allocate channel c2 device type disk format '/oradata/U%' connect ; 2> 3> 4>
5> recover database;
6> }
allocated channel: c1
channel c1: sid=145 instance=rac1 devtype=DISK
allocated channel: c2
channel c2: sid=144 instance=rac2 devtype=DISK
Starting recover at 04-JAN-09
starting media recovery
archive log thread 1 sequence 9 is already on disk as file /arch/1_9_675209275.dbf
archive log thread 1 sequence 10 is already on disk as file /arch/1_10_675209275.dbf
archive log thread 1 sequence 11 is already on disk as file /arch/1_11_675209275.dbf
archive log thread 2 sequence 9 is already on disk as file /arch/2_9_675209275.dbf
archive log thread 2 sequence 10 is already on disk as file /arch/2_10_675209275.dbf
archive log thread 2 sequence 11 is already on disk as file /arch/2_11_675209275.dbf
archive log filename=/arch/2_9_675209275.dbf thread=2 sequence=9
archive log filename=/arch/1_9_675209275.dbf thread=1 sequence=9
archive log filename=/arch/2_10_675209275.dbf thread=2 sequence=10
archive log filename=/arch/1_10_675209275.dbf thread=1 sequence=10
media recovery complete, elapsed time: 00:00:15
Finished recover at 04-JAN-09
released channel: c1
released channel: c2
RMAN> alter database open;
database opened
RMAN> exit
Recovery Manager complete.
sql[oracle@rac1 arch]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jan 4 01:49:53 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select count(*) from t;
COUNT(*)
----------
3856515
SQL>
恢復完成
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-526491/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle rac在裸裝置下的備份Oracle
- Oracle RAC--在Linux中建立裸裝置OracleLinux
- 玩轉裸裝置的備份恢復
- 安裝 oracle 10g rac 與 裸裝置Oracle 10g
- udev 裸裝置 安裝racdev
- oracle rac 在asm下的備份與恢復OracleASM
- Oracle RAC安裝前的磁碟分割槽及裸裝置配置Oracle
- oracle 9i 裸裝置資料檔案損壞的恢復過程Oracle
- RAC 10g下從裸裝置遷移到ASMASM
- Linux AS 4.0下Oracle10g RAC搭建(虛擬機器+裸裝置)LinuxOracle虛擬機
- 用裸裝置安裝RAC 10g
- oracle 裸裝置(轉載)Oracle
- linux下裸裝置的使用Linux
- LINUX下裸裝置的操作Linux
- 在unix下和linux下建立裸裝置總結Linux
- linux下新增裸裝置Linux
- linux下配置裸裝置Linux
- 【儲存】裸裝置和OracleOracle
- VM 6+linux4.4+裸裝置+ORACLE10G RAC 安裝LinuxOracle
- oracle9.2.0在RHEL中建庫使用裸裝置Oracle
- linux下使用裸裝置建立oracle表空間LinuxOracle
- oracle安裝使用裸裝置問題Oracle
- vmware + 裸裝置 + crs + oracle10g RAC搭建步驟(二):安裝linuxOracleLinux
- 字元裝置、塊裝置與裸裝置字元
- 字元裝置、塊裝置、裸裝置、RAW裝置 .字元
- 裸裝置與塊裝置的區別
- 裸裝置和Oracle問答20例Oracle
- AIX中的裸裝置AI
- 用裸裝置與Oracle資料庫的效能Oracle資料庫
- Oracle RAC備份與恢復Oracle
- 在UNIX裸裝置和檔案系統之間移動ORACLEOracle
- 建立裸裝置庫
- 11gR2 單機RAC+Linux+裸裝置Linux
- Oracle 12G將不再支援裸裝置Oracle
- 裸裝置和Oracle問答20例(zt)Oracle
- Solaris裸裝置安裝三節點RAC102(六)
- Solaris裸裝置安裝三節點RAC102(五)
- Solaris裸裝置安裝三節點RAC102(四)