Oracle 11G 備份與恢復 使用RMAN建立映象拷貝舉例
--1. 檢視歸檔目的地 sys@TESTDB11>show parameter log_archive_dest_
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ log_archive_dest_1 string log_archive_dest_10 string log_archive_dest_11 string log_archive_dest_12 string log_archive_dest_13 string log_archive_dest_14 string log_archive_dest_15 string log_archive_dest_16 string log_archive_dest_17 string ......
--2. 配置2個歸檔目的地(否則預設歸檔日誌將儲存在快速恢復區) --2.1 建立目錄並授權 [root@OL54.cuug.net: /root]$ mkdir -p /arch_dest1 [root@OL54.cuug.net: /root]$ mkdir -p /arch_dest2 [root@OL54.cuug.net: /root]$ chown -R oracle:oinstall /arch_dest1 [root@OL54.cuug.net: /root]$ chown -R oracle:oinstall /arch_dest2 [root@OL54.cuug.net: /root]$ chmod -R 775 /arch_dest1 [root@OL54.cuug.net: /root]$ chmod -R 775 /arch_dest2
--2.2 設定新的歸檔目的地 sys@TESTDB11>alter system set log_archive_dest_1 = 'location=/arch_dest1';
System altered.
sys@TESTDB11>alter system set log_archive_dest_2 = 'location=/arch_dest2';
System altered.
--2.3 切換3次歸檔日誌 sys@TESTDB11>alter system switch logfile;
System altered.
sys@TESTDB11>/
System altered.
sys@TESTDB11>/
System altered.
--2.4 檢視生成的歸檔日誌 [oracle@OL54.cuug.net:/arch_dest1]$ ls -l total 30368 -rw-r----- 1 oracle dba 31045120 Aug 9 12:13 1_23_855020031.dbf -rw-r----- 1 oracle dba 1024 Aug 9 12:13 1_24_855020031.dbf -rw-r----- 1 oracle dba 6144 Aug 9 12:13 1_25_855020031.dbf
[oracle@OL54.cuug.net:/arch_dest2]$ ls -l total 30368 -rw-r----- 1 oracle dba 31045120 Aug 9 12:13 1_23_855020031.dbf -rw-r----- 1 oracle dba 1024 Aug 9 12:13 1_24_855020031.dbf -rw-r----- 1 oracle dba 6144 Aug 9 12:13 1_25_855020031.dbf
--3. 對資料檔案進行備份,產生映象拷貝 RMAN> backup as copy datafile '+DISKGROUP01/testdb11/users01.dbf';
Starting backup at 09-AUG-14 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile copy input datafile file number=00004 name=+DISKGROUP01/testdb11/users01.dbf output file name=/backup01/data_D-TESTDB11_I-2620210741_TS-USERS_FNO-4_10pfgt5l tag=TAG20140809T115325 RECID=3 STAMP=855143607 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 Finished backup at 09-AUG-14
--3.1 檢視產生的備份檔案 [oracle@OL54.cuug.net:/backup01]$ ls -l total 5140 -rw-r----- 1 oracle dba 5251072 Aug 9 11:53 data_D-TESTDB11_I-2620210741_TS-USERS_FNO-4_10pfgt5l
--4. 對歸檔日誌進行備份,產生映象拷貝 --4.1 對恢復目錄進行同步 RMAN> resync catalog;
starting full resync of recovery catalog full resync complete
--4.2 備份在/arch_dest1目錄下的歸檔日誌 RMAN> backup as copy archivelog like '/arch_dest1%';
Starting backup at 09-AUG-14 using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log copy input archived log thread=1 sequence=23 RECID=11 STAMP=855144794 output file name=/backup01/arch_D-TESTDB11_id-2620210741_S-23_T-1_A-855020031_11pfguk9 RECID=17 STAMP=855145099 channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting archived log copy input archived log thread=1 sequence=24 RECID=13 STAMP=855144794 output file name=/backup01/arch_D-TESTDB11_id-2620210741_S-24_T-1_A-855020031_12pfgukc RECID=18 STAMP=855145100 channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting archived log copy input archived log thread=1 sequence=25 RECID=15 STAMP=855144799 output file name=/backup01/arch_D-TESTDB11_id-2620210741_S-25_T-1_A-855020031_13pfgukd RECID=19 STAMP=855145101 channel ORA_DISK_1: archived log copy
--4.3 檢視生成的備份 [oracle@OL54.cuug.net:/backup01]$ ls arch_D-TESTDB11_id-2620210741_S-23_T-1_A-855020031_11pfguk9 arch_D-TESTDB11_id-2620210741_S-24_T-1_A-855020031_12pfgukc arch_D-TESTDB11_id-2620210741_S-25_T-1_A-855020031_13pfgukd data_D-TESTDB11_I-2620210741_TS-USERS_FNO-4_10pfgt5l
--5. 刪除上面練習中生成的所有映象拷貝型別的備份 RMAN> delete copy;
released channel: ORA_DISK_1 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=23 device type=DISK specification does not match any control file copy in the repository List of Datafile Copies =======================
Key File S Completion Time Ckp SCN Ckp Time ------- ---- - --------------- ---------- --------------- 616 4 A 09-AUG-14 1111774 09-AUG-14 Name: /backup01/data_D-TESTDB11_I-2620210741_TS-USERS_FNO-4_10pfgt5l Tag: TAG20140809T115325
List of Archived Log Copies for database with db_unique_name TESTDB11 =====================================================================
Key Thrd Seq S Low Time ------- ---- ------- - --------- 676 1 23 A 09-AUG-14 Name: /backup01/arch_D-TESTDB11_id-2620210741_S-23_T-1_A-855020031_11pfguk9
645 1 23 A 09-AUG-14 Name: /arch_dest2/1_23_855020031.dbf
644 1 23 A 09-AUG-14 Name: /arch_dest1/1_23_855020031.dbf
677 1 24 A 09-AUG-14 Name: /backup01/arch_D-TESTDB11_id-2620210741_S-24_T-1_A-855020031_12pfgukc
646 1 24 A 09-AUG-14 Name: /arch_dest1/1_24_855020031.dbf
647 1 24 A 09-AUG-14 Name: /arch_dest2/1_24_855020031.dbf
678 1 25 A 09-AUG-14 Name: /backup01/arch_D-TESTDB11_id-2620210741_S-25_T-1_A-855020031_13pfgukd
649 1 25 A 09-AUG-14 Name: /arch_dest2/1_25_855020031.dbf
648 1 25 A 09-AUG-14 Name: /arch_dest1/1_25_855020031.dbf
Do you really want to delete the above objects (enter YES or NO)? yes deleted datafile copy datafile copy file name=/backup01/data_D-TESTDB11_I-2620210741_TS-USERS_FNO-4_10pfgt5l RECID=3 STAMP=855143607 deleted archived log archived log file name=/backup01/arch_D-TESTDB11_id-2620210741_S-23_T-1_A-855020031_11pfguk9 RECID=17 STAMP=855145099 deleted archived log archived log file name=/arch_dest2/1_23_855020031.dbf RECID=12 STAMP=855144794 deleted archived log archived log file name=/arch_dest1/1_23_855020031.dbf RECID=11 STAMP=855144794 deleted archived log archived log file name=/backup01/arch_D-TESTDB11_id-2620210741_S-24_T-1_A-855020031_12pfgukc RECID=18 STAMP=855145100 deleted archived log archived log file name=/arch_dest1/1_24_855020031.dbf RECID=13 STAMP=855144794 deleted archived log archived log file name=/arch_dest2/1_24_855020031.dbf RECID=14 STAMP=855144794 deleted archived log archived log file name=/backup01/arch_D-TESTDB11_id-2620210741_S-25_T-1_A-855020031_13pfgukd RECID=19 STAMP=855145101 deleted archived log archived log file name=/arch_dest2/1_25_855020031.dbf RECID=16 STAMP=855144799 deleted archived log archived log file name=/arch_dest1/1_25_855020031.dbf RECID=15 STAMP=855144799 Deleted 10 objects |
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17013648/viewspace-1259685/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11G 備份與恢復 使用RMAN建立備份集舉例Oracle
- 循序漸進oracle第7章:備份與恢復之RMAN映象拷貝完全恢復Oracle
- 循序漸進oracle第7章:備份與恢復之RMAN映象拷貝不完全恢復Oracle
- Backup And Recovery User's Guide-RMAN備份概念-RMAN建立的映象拷貝GUIIDE
- Backup And Recovery User's Guide-備份RMAN備份-用RMAN備份映象拷貝備份GUIIDE
- RMAN例項備份與恢復詳解
- RMAN備份與恢復之加密備份加密
- oracle RMAN 備份恢復總結Oracle
- oracle RMAN 備份恢復總結Oracle
- oracle rman備份恢復的例子Oracle
- Oracle資料庫備份與恢復之RMANOracle資料庫
- 循序漸進oracle第7章:備份與恢復之RMAN的簡單備份與恢復Oracle
- Backup And Recovery User's Guide-RMAN備份概念-使用者管理的映象拷貝GUIIDE
- Rman的映象拷貝指令碼指令碼
- ORACLE DG從庫 Rman備份恢復Oracle
- Oracle 11g R2 備份與恢復Oracle
- Windows oracle 11g rman備份恢復到linux系統WindowsOracleLinux
- RMAN 備份與恢復深入解析(二)
- RMAN 備份與恢復深入解析(一)
- 【轉】 RMAN備份與恢復實踐
- RMAN備份恢復原理
- rman備份恢復-rman入門
- Oracle資料庫備份與恢復之RMAN2Oracle資料庫
- Oracle 備份 與 恢復 概述Oracle
- Oracle RAC備份與恢復Oracle
- Oracle備份與恢復 (zt)Oracle
- Oracle備份與恢復案例Oracle
- Oracle備份與恢復(轉)Oracle
- Oracle 備份恢復篇之RMAN catalogOracle
- oracle 10g RMAN備份及恢復Oracle 10g
- Oracle塊損壞恢復(有rman備份)Oracle
- [記錄]oracle RMAN 備份恢復總結Oracle
- Oracle中使用RMAN備份及一些恢復方法Oracle
- Oracle資料庫備份與恢復之三:OS備份/使用者管理的備份與恢復Oracle資料庫
- 【備份恢復】Oracle 資料備份與恢復微實踐Oracle
- Backup And Recovery User's Guide-RMAN備份概念-RMAN備份的多個拷貝-備份的備份GUIIDE
- 【RMAN】RMAN備份恢復3 RMAN增量備份指令碼與crontab計劃任務指令碼
- 12 使用RMAN備份和恢復檔案