oracle rac 在asm下的備份與恢復
oracle 10g rac+asm 的備份與恢復,因為asm 磁碟管理是兩個例項都可以訪問的,並且是共享的,
歸檔日誌檔案也是放在asm磁碟上,所以備份與恢復的操作和單例項差不多,只需要在一個節點上做可以了,
以下是測試過程:
SQL> show parameter log_archive_dest_1
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1 string location=+DISKGROUP
log_archive_dest_10 string
1.備份
[oracle@rac1 ~]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Jan 3 20:30:40 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: RAC (DBID=2257786532)
RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oradata/%U';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/db_1/dbs/snapcf_rac1.f'; # default
RMAN> backup database plus archivelog delete all input;
Starting backup at 03-JAN-09
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=46 recid=70 stamp=674701009
input archive log thread=1 sequence=47 recid=73 stamp=674701367
input archive log thread=1 sequence=48 recid=74 stamp=674701585
input archive log thread=1 sequence=49 recid=76 stamp=675201928
input archive log thread=1 sequence=50 recid=79 stamp=675203712
input archive log thread=2 sequence=34 recid=71 stamp=674701052
input archive log thread=2 sequence=35 recid=72 stamp=674701368
input archive log thread=2 sequence=36 recid=75 stamp=674701587
input archive log thread=2 sequence=37 recid=77 stamp=675203284
input archive log thread=2 sequence=38 recid=78 stamp=675203700
channel ORA_DISK_1: starting piece 1 at 03-JAN-09
channel ORA_DISK_1: finished piece 1 at 03-JAN-09
piece handle=/oradata/0lk3tik2_1_1 tag=TAG20090103T203513 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
channel ORA_DISK_1: deleting archive log(s)
archive log filename=+DISKGROUP/rac/archivelog/2008_12_29/thread_1_seq_46.288.674701007 recid=70 stamp=674701009
archive log filename=+DISKGROUP/rac/archivelog/2008_12_29/thread_1_seq_47.281.674701367 recid=73 stamp=674701367
archive log filename=+DISKGROUP/rac/archivelog/2008_12_29/thread_1_seq_48.287.674701585 recid=74 stamp=674701585
archive log filename=+DISKGROUP/rac/archivelog/2009_01_03/thread_1_seq_49.280.675201927 recid=76 stamp=675201928
archive log filename=+DISKGROUP/rac/archivelog/2009_01_03/thread_1_seq_50.282.675203705 recid=79 stamp=675203712
archive log filename=+DISKGROUP/rac/archivelog/2008_12_29/thread_2_seq_34.283.674701051 recid=71 stamp=674701052
archive log filename=+DISKGROUP/rac/archivelog/2008_12_29/thread_2_seq_35.286.674701369 recid=72 stamp=674701368
archive log filename=+DISKGROUP/rac/archivelog/2008_12_29/thread_2_seq_36.279.674701587 recid=75 stamp=674701587
archive log filename=+DISKGROUP/rac/archivelog/2009_01_03/thread_2_seq_37.285.675203283 recid=77 stamp=675203284
archive log filename=+DISKGROUP/rac/archivelog/2009_01_03/thread_2_seq_38.284.675203701 recid=78 stamp=675203700
Finished backup at 03-JAN-09
Starting backup at 03-JAN-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00007 name=/oradata/paul01.dbf
input datafile fno=00003 name=+DISKGROUP/rac/datafile/sysaux.270.669804585
input datafile fno=00005 name=+DISKGROUP/rac/datafile/users.278.672888597
input datafile fno=00002 name=+DISKGROUP/rac/datafile/undotbs1.269.669804571
channel ORA_DISK_1: starting piece 1 at 03-JAN-09
channel ORA_DISK_1: finished piece 1 at 03-JAN-09
piece handle=/oradata/0mk3tikd_1_1 tag=TAG20090103T203524 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DISKGROUP/rac/datafile/system.268.669804533
channel ORA_DISK_1: starting piece 1 at 03-JAN-09
channel ORA_DISK_1: finished piece 1 at 03-JAN-09
piece handle=/oradata/0nk3tilq_1_1 tag=TAG20090103T203524 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=+DISKGROUP/rac/datafile/undotbs2.272.669804611
channel ORA_DISK_1: starting piece 1 at 03-JAN-09
channel ORA_DISK_1: finished piece 1 at 03-JAN-09
piece handle=/oradata/0ok3timu_1_1 tag=TAG20090103T203524 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00006 name=+DISKGROUP/rac/datafile/test.277.669863437
channel ORA_DISK_1: starting piece 1 at 03-JAN-09
channel ORA_DISK_1: finished piece 1 at 03-JAN-09
piece handle=/oradata/0pk3tin1_1_1 tag=TAG20090103T203524 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 03-JAN-09
channel ORA_DISK_1: finished piece 1 at 03-JAN-09
piece handle=/oradata/0qk3tin2_1_1 tag=TAG20090103T203524 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
Finished backup at 03-JAN-09
Starting backup at 03-JAN-09
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=51 recid=81 stamp=675203822
input archive log thread=2 sequence=39 recid=80 stamp=675203817
channel ORA_DISK_1: starting piece 1 at 03-JAN-09
channel ORA_DISK_1: finished piece 1 at 03-JAN-09
piece handle=/oradata/0rk3ting_1_1 tag=TAG20090103T203703 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: deleting archive log(s)
archive log filename=+DISKGROUP/rac/archivelog/2009_01_03/thread_1_seq_51.285.675203823 recid=81 stamp=675203822
archive log filename=+DISKGROUP/rac/archivelog/2009_01_03/thread_2_seq_39.284.675203817 recid=80 stamp=675203817
Finished backup at 03-JAN-09
RMAN>
2.加入測試資料
rac1
[oracle@rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sat Jan 3 20:51:30 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>
SQL> select count(*) from t;
COUNT(*)
----------
160688
SQL> insert into t select * from t;
160688 rows created.
SQL> commit;
Commit complete.
SQL> alter system switch logfile;
System altered.
rac2
[oracle@rac2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sat Jan 3 20:53:00 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> insert into t select * from t;
321376 rows created.
SQL> commit;
Commit complete.
SQL> alter system switch logfile;
System altered.
SQL> select count(*) from t;
COUNT(*)
----------
642752
3.恢復:
注意恢復時另外一個節點資料庫一定要關閉,
要不然在恢復時會報如下錯誤:
Recovery Manager complete.
[oracle@rac1 ~]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Jan 3 21:02:48 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup mount;
Oracle instance started
database mounted
Total System Global Area 285212672 bytes
Fixed Size 1267068 bytes
Variable Size 104860292 bytes
Database Buffers 176160768 bytes
Redo Buffers 2924544 bytes
RMAN> restore database;
Starting restore at 03-JAN-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=150 instance=rac1 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: 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 ORA_DISK_1: reading from backup piece /oradata/0mk3tikd_1_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 01/03/2009 21:06:08
ORA-19870: error reading backup piece /oradata/0mk3tikd_1_1
ORA-19573: cannot obtain exclusive enqueue for datafile 2
以下是關閉另外一個例項後的恢復過程
RMAN>
[oracle@rac1 ~]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Jan 3 21:02:48 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup mount;
Oracle instance started
database mounted
Total System Global Area 285212672 bytes
Fixed Size 1267068 bytes
Variable Size 104860292 bytes
Database Buffers 176160768 bytes
Redo Buffers 2924544 bytes
RMAN> restore database
2> ;
Starting restore at 03-JAN-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: 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 ORA_DISK_1: reading from backup piece /oradata/0mk3tikd_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/0mk3tikd_1_1 tag=TAG20090103T203524
channel ORA_DISK_1: restore complete, elapsed time: 00:01:09
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +DISKGROUP/rac/datafile/system.268.669804533
channel ORA_DISK_1: reading from backup piece /oradata/0nk3tilq_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/0nk3tilq_1_1 tag=TAG20090103T203524
channel ORA_DISK_1: restore complete, elapsed time: 00:01:20
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to +DISKGROUP/rac/datafile/undotbs2.272.669804611
channel ORA_DISK_1: reading from backup piece /oradata/0ok3timu_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/0ok3timu_1_1 tag=TAG20090103T203524
channel ORA_DISK_1: restore complete, elapsed time: 00:00:37
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00006 to +DISKGROUP/rac/datafile/test.277.669863437
channel ORA_DISK_1: reading from backup piece /oradata/0pk3tin1_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/0pk3tin1_1_1 tag=TAG20090103T203524
channel ORA_DISK_1: restore complete, elapsed time: 00:00:18
Finished restore at 03-JAN-09
RMAN> recover database;
Starting recover at 03-JAN-09
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 52 is already on disk as file +DISKGROUP/rac/archivelog/2009_01_03/thread_1_seq_52.284.675204727
archive log thread 2 sequence 40 is already on disk as file +DISKGROUP/rac/archivelog/2009_01_03/thread_2_seq_40.285.675204811
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=51
channel ORA_DISK_1: restoring archive log
archive log thread=2 sequence=39
channel ORA_DISK_1: reading from backup piece /oradata/0rk3ting_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/0rk3ting_1_1 tag=TAG20090103T203703
channel ORA_DISK_1: restore complete, elapsed time: 00:00:08
archive log filename=+DISKGROUP/rac/archivelog/2009_01_03/thread_1_seq_51.279.675206019 thread=1 sequence=51
archive log filename=+DISKGROUP/rac/archivelog/2009_01_03/thread_2_seq_39.286.675206019 thread=2 sequence=39 ---可以看到 兩個例項下的歸檔日誌都可以恢復
media recovery complete, elapsed time: 00:00:09
Finished recover at 03-JAN-09
RMAN> alter database open;
database opened
RMAN>
啟動另外個節點,驗證資料
SQL> startup
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1267068 bytes
Variable Size 92277380 bytes
Database Buffers 188743680 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL>
SQL> select count(*) from t;
COUNT(*)
----------
642752
一致 恢復完成
總結:10g rac+asm的備份與恢復和單例項差不多,很方便管理,
目前我們客戶是9irac+裸裝置的方式,由於歸檔日誌檔案不能放在裸裝置上,只能放在檔案系統上,
所以備份與恢復相對就麻煩些,必須在各個節點上備份各自的歸檔日誌檔案,和相應恢復各自的歸檔
日誌檔案
下面一篇文章就介紹歸檔放在檔案系統上的備份與恢復方法
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-526462/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle RAC備份與恢復Oracle
- Oracle RAC ASM disk header 備份 恢復 與 重建 示例說明OracleASMHeader
- Oracle 10g rac+asm 磁碟頭備份與恢復實驗Oracle 10gASM
- Oracle RAC OCR 和 VotingDisk 的備份與恢復Oracle
- ORACLE RAC資料庫的備份與恢復(6)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(5)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(4)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(3)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(2)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(1)Oracle資料庫
- Oracle OCR的備份與恢復Oracle
- Oracle 備份 與 恢復 概述Oracle
- Oracle備份與恢復 (zt)Oracle
- Oracle備份與恢復案例Oracle
- Oracle備份與恢復(轉)Oracle
- ASM後設資料備份與恢復ASM
- 【備份恢復】Oracle 資料備份與恢復微實踐Oracle
- Oracle 10G RAC的ocr備份恢復Oracle 10g
- Oracle SCN機制———在備份與恢復中Oracle
- 備份&恢復之四:非歸檔模式下的備份與恢復模式
- Oracle 10g RAC OCR 和 VotingDisk 的備份與恢復Oracle 10g
- 備份與恢復oracle_homeOracle
- Oracle 備份與恢復(一):概念Oracle
- oracle備份與恢復雜記Oracle
- Oracle備份與恢復入門Oracle
- Oracle備份與恢復案例 (zt)Oracle
- Oracle資料庫備份與恢復之三:OS備份/使用者管理的備份與恢復Oracle資料庫
- ASM 磁碟頭資訊備份與恢復--有空研究一下ASM
- oracle rac在裸裝置下的恢復Oracle
- 備份與恢復--利用備份的控制檔案恢復
- 備份與恢復系列 十一 控制檔案的備份與恢復
- Oracle備份恢復之熱備份恢復及異機恢復Oracle
- Oracle備份與恢復【丟失控制檔案的恢復】Oracle
- Oracle資料泵的備份與恢復Oracle
- oracle資料庫的備份與恢復Oracle資料庫
- oracle rac在裸裝置下的備份Oracle
- Oracle 12c 備份與恢復Oracle
- oracle備份與恢復測試(五)Oracle