使用RMAN對CDB的root執行完全恢復
如果資料損壞或使用者錯誤隻影響CDB的root容器,那麼可能只會考慮恢復root容器。然而,Oracle強烈建議你在恢復root容器後恢復所有的PDB來阻止root與PDB中的後設資料不一致的情況。在這種情況下,更好的方法是對整個CDB執行恢復操作。
使用RMAN對root執行完全恢復的操作如下:
2.將整個CDB啟動到mount狀態
3.可選操作,使用configure命令來配置預設的裝置型別與自動通道。
4.執行以下命令來還原與恢復root容器
5.檢查輸出結果檢視是否介質恢復成功。如果介質恢復成功繼續下面的操作
6.強烈建議的操作,恢復所有PDB,包括CDB seed
檢查輸出結果檢視是否介質恢復成功。如果介質恢復成功繼續下面的操作
7.open CDB與所有的PDB
1.啟動RMAN並以有sysdba或sysbackup許可權的公共使用者連線到root容器。
[oracle@jytest1 ~]$ rman target/ catalog rco/xxxxxx@jypdb
Recovery Manager: Release 12.2.0.1.0 - Production on Mon Dec 11 15:55:18 2017
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: JY (DBID=979425723, not open)
connected to recovery catalog database
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 6442450944 bytes
Fixed Size 8807168 bytes
Variable Size 1895828736 bytes
Database Buffers 4529848320 bytes
Redo Buffers 7966720 bytes
Database mounted.
SQL> select name from v$pdbs;
NAME
--------------------------------------------------------------------------------
PDB$SEED
JYPDB
RMAN> restore database root;
Starting restore at 11-DEC-17
starting full resync of recovery catalog
full resync complete
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1521 instance=jy1 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/JY/DATAFILE/system.317.962209603
channel ORA_DISK_1: restoring datafile 00003 to +DATA/JY/DATAFILE/sysaux.298.962209605
channel ORA_DISK_1: restoring datafile 00004 to +DATA/JY/DATAFILE/undotbs1.277.962209605
channel ORA_DISK_1: restoring datafile 00007 to +DATA/JY/DATAFILE/users.301.962209605
channel ORA_DISK_1: restoring datafile 00009 to +DATA/JY/DATAFILE/undotbs2.312.962209605
channel ORA_DISK_1: reading from backup piece +TEST/rman_backup/jy_979425723_20171208_0fslkbg2_1_1
channel ORA_DISK_1: piece handle=+TEST/rman_backup/jy_979425723_20171208_0fslkbg2_1_1 tag=TAG20171208T165528
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 11-DEC-17
RMAN> recover database root;
Starting recover at 11-DEC-17
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 14 is already on disk as file +TEST/arch/1_14_961976319.dbf
archived log for thread 1 with sequence 15 is already on disk as file +TEST/arch/1_15_961976319.dbf
archived log for thread 1 with sequence 16 is already on disk as file +TEST/arch/1_16_961976319.dbf
archived log for thread 1 with sequence 17 is already on disk as file +TEST/arch/1_17_961976319.dbf
archived log for thread 1 with sequence 18 is already on disk as file +TEST/arch/1_18_961976319.dbf
archived log for thread 1 with sequence 19 is already on disk as file +TEST/arch/1_19_961976319.dbf
archived log for thread 1 with sequence 20 is already on disk as file +TEST/arch/1_20_961976319.dbf
archived log for thread 1 with sequence 21 is already on disk as file +TEST/arch/1_21_961976319.dbf
archived log for thread 1 with sequence 22 is already on disk as file +TEST/arch/1_22_961976319.dbf
archived log for thread 1 with sequence 23 is already on disk as file +TEST/arch/1_23_961976319.dbf
archived log for thread 1 with sequence 24 is already on disk as file +TEST/arch/1_24_961976319.dbf
archived log for thread 1 with sequence 25 is already on disk as file +TEST/arch/1_25_961976319.dbf
archived log for thread 1 with sequence 26 is already on disk as file +TEST/arch/1_26_961976319.dbf
archived log for thread 1 with sequence 27 is already on disk as file +TEST/arch/1_27_961976319.dbf
archived log for thread 2 with sequence 12 is already on disk as file +TEST/arch/2_12_961976319.dbf
archived log for thread 2 with sequence 13 is already on disk as file +TEST/arch/2_13_961976319.dbf
archived log for thread 2 with sequence 14 is already on disk as file +TEST/arch/2_14_961976319.dbf
archived log for thread 2 with sequence 15 is already on disk as file +TEST/arch/2_15_961976319.dbf
archived log for thread 2 with sequence 16 is already on disk as file +TEST/arch/2_16_961976319.dbf
archived log for thread 2 with sequence 17 is already on disk as file +TEST/arch/2_17_961976319.dbf
archived log for thread 2 with sequence 18 is already on disk as file +TEST/arch/2_18_961976319.dbf
archived log for thread 2 with sequence 19 is already on disk as file +TEST/arch/2_19_961976319.dbf
archived log for thread 2 with sequence 20 is already on disk as file +TEST/arch/2_20_961976319.dbf
archived log file name=+TEST/arch/1_14_961976319.dbf thread=1 sequence=14
archived log file name=+TEST/arch/2_12_961976319.dbf thread=2 sequence=12
archived log file name=+TEST/arch/1_15_961976319.dbf thread=1 sequence=15
archived log file name=+TEST/arch/2_13_961976319.dbf thread=2 sequence=13
archived log file name=+TEST/arch/1_16_961976319.dbf thread=1 sequence=16
archived log file name=+TEST/arch/1_17_961976319.dbf thread=1 sequence=17
archived log file name=+TEST/arch/2_14_961976319.dbf thread=2 sequence=14
archived log file name=+TEST/arch/1_18_961976319.dbf thread=1 sequence=18
archived log file name=+TEST/arch/1_19_961976319.dbf thread=1 sequence=19
archived log file name=+TEST/arch/1_20_961976319.dbf thread=1 sequence=20
archived log file name=+TEST/arch/2_15_961976319.dbf thread=2 sequence=15
archived log file name=+TEST/arch/1_21_961976319.dbf thread=1 sequence=21
archived log file name=+TEST/arch/1_22_961976319.dbf thread=1 sequence=22
archived log file name=+TEST/arch/2_16_961976319.dbf thread=2 sequence=16
archived log file name=+TEST/arch/1_23_961976319.dbf thread=1 sequence=23
archived log file name=+TEST/arch/1_24_961976319.dbf thread=1 sequence=24
archived log file name=+TEST/arch/2_17_961976319.dbf thread=2 sequence=17
archived log file name=+TEST/arch/1_25_961976319.dbf thread=1 sequence=25
archived log file name=+TEST/arch/2_18_961976319.dbf thread=2 sequence=18
archived log file name=+TEST/arch/1_26_961976319.dbf thread=1 sequence=26
media recovery complete, elapsed time: 00:06:07
Finished recover at 11-DEC-17
starting full resync of recovery catalog
full resync complete
RMAN> restore pluggable database 'PDB$SEED',jypdb;
Starting restore at 11-DEC-17
using channel ORA_DISK_1
skipping datafile 5; already restored to file +DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/system.256.962209675
skipping datafile 6; already restored to file +DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/sysaux.270.962209675
skipping datafile 8; already restored to file +DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/undotbs1.296.962209675
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00010 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649
channel ORA_DISK_1: restoring datafile 00011 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.962209649
channel ORA_DISK_1: restoring datafile 00012 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.962209649
channel ORA_DISK_1: restoring datafile 00013 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.268.962209649
channel ORA_DISK_1: restoring datafile 00014 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649
channel ORA_DISK_1: restoring datafile 00015 to +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.962210609
channel ORA_DISK_1: reading from backup piece +TEST/rman_backup/jy_979425723_20171208_0gslkbie_1_1
channel ORA_DISK_1: piece handle=+TEST/rman_backup/jy_979425723_20171208_0gslkbie_1_1 tag=TAG20171208T165528
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 11-DEC-17
RMAN> recover pluggable database 'PDB$SEED',jypdb;
Starting recover at 11-DEC-17
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 14 is already on disk as file +TEST/arch/1_14_961976319.dbf
archived log for thread 1 with sequence 15 is already on disk as file +TEST/arch/1_15_961976319.dbf
archived log for thread 1 with sequence 16 is already on disk as file +TEST/arch/1_16_961976319.dbf
archived log for thread 1 with sequence 17 is already on disk as file +TEST/arch/1_17_961976319.dbf
archived log for thread 1 with sequence 18 is already on disk as file +TEST/arch/1_18_961976319.dbf
archived log for thread 1 with sequence 19 is already on disk as file +TEST/arch/1_19_961976319.dbf
archived log for thread 1 with sequence 20 is already on disk as file +TEST/arch/1_20_961976319.dbf
archived log for thread 1 with sequence 21 is already on disk as file +TEST/arch/1_21_961976319.dbf
archived log for thread 1 with sequence 22 is already on disk as file +TEST/arch/1_22_961976319.dbf
archived log for thread 1 with sequence 23 is already on disk as file +TEST/arch/1_23_961976319.dbf
archived log for thread 1 with sequence 24 is already on disk as file +TEST/arch/1_24_961976319.dbf
archived log for thread 1 with sequence 25 is already on disk as file +TEST/arch/1_25_961976319.dbf
archived log for thread 1 with sequence 26 is already on disk as file +TEST/arch/1_26_961976319.dbf
archived log for thread 1 with sequence 27 is already on disk as file +TEST/arch/1_27_961976319.dbf
archived log for thread 2 with sequence 12 is already on disk as file +TEST/arch/2_12_961976319.dbf
archived log for thread 2 with sequence 13 is already on disk as file +TEST/arch/2_13_961976319.dbf
archived log for thread 2 with sequence 14 is already on disk as file +TEST/arch/2_14_961976319.dbf
archived log for thread 2 with sequence 15 is already on disk as file +TEST/arch/2_15_961976319.dbf
archived log for thread 2 with sequence 16 is already on disk as file +TEST/arch/2_16_961976319.dbf
archived log for thread 2 with sequence 17 is already on disk as file +TEST/arch/2_17_961976319.dbf
archived log for thread 2 with sequence 18 is already on disk as file +TEST/arch/2_18_961976319.dbf
archived log for thread 2 with sequence 19 is already on disk as file +TEST/arch/2_19_961976319.dbf
archived log for thread 2 with sequence 20 is already on disk as file +TEST/arch/2_20_961976319.dbf
archived log file name=+TEST/arch/1_14_961976319.dbf thread=1 sequence=14
archived log file name=+TEST/arch/2_12_961976319.dbf thread=2 sequence=12
archived log file name=+TEST/arch/1_15_961976319.dbf thread=1 sequence=15
archived log file name=+TEST/arch/2_13_961976319.dbf thread=2 sequence=13
archived log file name=+TEST/arch/1_16_961976319.dbf thread=1 sequence=16
archived log file name=+TEST/arch/1_17_961976319.dbf thread=1 sequence=17
archived log file name=+TEST/arch/2_14_961976319.dbf thread=2 sequence=14
archived log file name=+TEST/arch/1_18_961976319.dbf thread=1 sequence=18
archived log file name=+TEST/arch/1_19_961976319.dbf thread=1 sequence=19
archived log file name=+TEST/arch/1_20_961976319.dbf thread=1 sequence=20
archived log file name=+TEST/arch/2_15_961976319.dbf thread=2 sequence=15
archived log file name=+TEST/arch/1_21_961976319.dbf thread=1 sequence=21
archived log file name=+TEST/arch/1_22_961976319.dbf thread=1 sequence=22
archived log file name=+TEST/arch/2_16_961976319.dbf thread=2 sequence=16
archived log file name=+TEST/arch/1_23_961976319.dbf thread=1 sequence=23
archived log file name=+TEST/arch/1_24_961976319.dbf thread=1 sequence=24
archived log file name=+TEST/arch/2_17_961976319.dbf thread=2 sequence=17
archived log file name=+TEST/arch/1_25_961976319.dbf thread=1 sequence=25
archived log file name=+TEST/arch/2_18_961976319.dbf thread=2 sequence=18
archived log file name=+TEST/arch/1_26_961976319.dbf thread=1 sequence=26
media recovery complete, elapsed time: 00:02:52
Finished recover at 11-DEC-17
starting full resync of recovery catalog
full resync complete
RMAN> alter database open;
Statement processed
RMAN> alter pluggable database all open;
Statement processed
starting full resync of recovery catalog
full resync complete
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2148528/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用RMAN對CDB執行按時間點恢復
- 使用RMAN來PDB執行完全恢復
- RMAN中使用until time子句對Non-CDB中的表執行按時間點恢復
- 使用RMAN對PDB中的表空間或資料檔案執行完全恢復
- 使用RMAN對PDB執行按時間點恢復
- RMAN恢復 執行重要檔案RMAN恢復
- 12C針對cdb全備與 PDB執行不完全恢復(基於SCN)
- 使用RMAN對CDB執行閃回資料庫操作資料庫
- RMAN恢復 執行不重要檔案的RMAN恢復
- RMAN全庫【完全恢復/不完全恢復brief version】
- 用rman執行塊恢復
- 使用RMAN恢復完全損壞的資料庫資料庫
- Backup And Recovery User's Guide-執行完全資料庫恢復-執行表空間的完全恢復GUIIDE資料庫
- Oracle 12c使用RMAN備份對Non-CDB中的表按時間點進行恢復Oracle
- Oracle RMAN 表空間的完全恢復Oracle
- rman恢復 使用switch映像副本進行恢復
- Backup And Recovery User's Guide-執行完全資料庫恢復-執行整個資料庫的完全恢復GUIIDE資料庫
- OCP課程48:管理II之使用RMAN執行恢復
- 12C PDB使用RMAN的4種完全恢復場景
- Oracle 12C使用UNTIL SEQUENCE子句對Non-CDB中的表執行按時間點恢復Oracle
- RMAN完全恢復丟失的資料檔案
- Oracle Rman 資料庫的不完全恢復Oracle資料庫
- Oracle 基於 RMAN 的不完全恢復(incomplete recovery by RMAN)Oracle
- Backup And Recovery User's Guide-執行不完全資料庫恢復-執行Cancel-Based不完全恢復GUIIDE資料庫
- 用RMAN執行表空間及時點恢復——RMAN使用者手冊
- Backup And Recovery User's Guide-執行完全資料庫恢復-執行開啟的資料庫的恢復GUIIDE資料庫
- Backup And Recovery User's Guide-執行完全資料庫恢復-執行關閉的資料庫的恢復GUIIDE資料庫
- 使用RMAN的不完全恢復-基於時間/SCN/日誌序列
- Backup And Recovery User's Guide-執行完全資料庫恢復-關於完全資料庫恢復GUIIDE資料庫
- RMAN一次RMAN將資料庫不完全恢復資料庫
- 【Mysql】完全恢復與不完全恢復MySql
- oracle 12c 針對cdb的差異0備與對pdb進行恢復Oracle
- rman中三個不完全恢復場景
- RMAN學習小結1:不完全恢復
- 執行RMAN表空間及時點恢復——使用者管理備份和恢復手冊
- 獲取rman備份/恢復執行進度資訊
- 備份與恢復:用rman方式基於日誌序列的不完全恢復
- 【RMAN】使用RMAN備份將資料庫不完全恢復到指定時間點資料庫