Backup And Recovery User's Guide-執行完全資料庫恢復-執行表空間的完全恢復
執行表空間的完全恢復
場景:
資料庫處於OPEN狀態,只有部分並不是所有的資料檔案損壞了。
當在資料庫處於開啟狀態時還原和恢復損壞的表空間,這樣資料庫的其它部分仍然可用。
這裡假設trgt資料庫丟失了users表空間。
練習:還原和恢復表空間
--1. 啟動RMAN連線到目標資料庫 --2. 如果資料庫是OPEN狀態,則使需要恢復的資料檔案離線 SQL "ALTER TABLESPACE users OFFLINE IMMEDIATE"; --3. 使用SHOW命令檢視預先配置的channel -- 如果需要的裝置和通道已經被配置了,則不需要其它的操作;否則 使用CONFIGURE命令配置自動通道或在RUN塊中包含ALLOCATE CHANNEL命令 SHOW ALL;
RMAN configuration parameters for database with db_unique_name PROD1 are: . . . CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS "SBT_LIBRARY=/usr/local/oracle/backup/lib/libobk.so"; --4. 如果還原口令加密的備份,則指定口令; 如果使用了多個不同的口令建立備份,則需要執行SET DECRYPTION IDENTIFIED BY多次 -- 指定還原備份可能需要的所有口令。 SET DECRYPTION IDENTIFIED BY password; --5. 還原和恢復表空間 --5.1 如果還原資料檔案到原來的位置,則執行RESTORE TABLESPACE和RECOVER TABLESPACE命令 RMAN> RESTORE TABLESPACE users;
Starting restore at 20-JUN-06 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=37 device type=DISK allocated channel: ORA_SBT_TAPE_1 channel ORA_SBT_TAPE_1: SID=38 device type=SBT_TAPE channel ORA_SBT_TAPE_1: Oracle Secure Backup
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 00012 to /disk1/oracle/dbs/users01.f channel ORA_DISK_1: restoring datafile 00013 to /disk1/oracle/dbs/users02.f channel ORA_DISK_1: restoring datafile 00021 to /disk1/oracle/dbs/users03.f channel ORA_DISK_1: reading from backup piece /disk1/oracle/work/orcva/TKRM/backupset/2007_06_20/o1_mf_nnndf_TAG20070620T105435_29jflwor_.bkp channel ORA_DISK_1: piece handle=/disk1/oracle/work/orcva/TKRM/backupset/2007_06_20/o1_mf_nnndf_TAG20070620T105435_29jflwor_.bkp tag=TAG20070620T105435 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 Finished restore at 20-JUN-06
RMAN> RECOVER TABLESPACE users;
Starting recover at 20-JUN-06 using channel ORA_DISK_1 using channel ORA_SBT_TAPE_1
starting media recovery
archived log for thread 1 with sequence 27 is already on disk as file /disk1/oracle/work/orcva/TKRM/archivelog/2007_06_20/o1_mf_1_27_29jjmtc9_.arc archived log for thread 1 with sequence 28 is already on disk as file /disk1/oracle/work/orcva/TKRM/archivelog/2007_06_20/o1_mf_1_28_29jjnc5x_.arc . . . channel ORA_DISK_1: starting archived log restore to default destination channel ORA_DISK_1: restoring archived log archived log thread=1 sequence=5 channel ORA_DISK_1: restoring archived log archived log thread=1 sequence=6 channel ORA_DISK_1: restoring archived log archived log thread=1 sequence=7 . . . channel ORA_DISK_1: reading from backup piece /disk1/oracle/work/orcva/TKRM/backupset/2007_06_20/o1_mf_annnn_TAG20070620T113128_29jhr197_.bkp channel ORA_DISK_1: piece handle=/disk1/oracle/work/orcva/TKRM/backupset/2007_06_20/o1_mf_annnn_TAG20070620T113128_29jhr197_.bkp tag=TAG20070620T113128 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:02 archived log file name=/disk1/oracle/work/orcva/TKRM/archivelog/2007_06_20/o1_mf_1_5_29jkdvjq_.arc thread=1 sequence=5 channel default: deleting archived log(s) archived log file name=/disk1/oracle/work/orcva/TKRM/archivelog/2007_06_20/o1_mf_1_5_29jkdvjq_.arc RECID=91 STAMP=593611179 archived log file name=/disk1/oracle/work/orcva/TKRM/archivelog/2007_06_20/o1_mf_1_6_29jkdvbz_.arc thread=1 sequence=6 channel default: deleting archived log(s) . . . media recovery complete, elapsed time: 00:00:01 Finished recover at 20-JUN-06
--5.2 還原資料檔案到新的位置,則必須在RUN塊中執行RESTORE和RECOVER命令,使用SET NEWNAME來重新命名資料檔案。 RUN { # 對每個資料檔案指定新的位置 SET NEWNAME FOR DATAFILE '/disk1/oracle/dbs/users01.f' TO '/disk2/users01.f'; SET NEWNAME FOR DATAFILE '/disk1/oracle/dbs/users02.f' TO &n |
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17013648/viewspace-1093860/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Backup And Recovery User's Guide-執行完全資料庫恢復-執行整個資料庫的完全恢復GUIIDE資料庫
- Backup And Recovery User's Guide-執行完全資料庫恢復GUIIDE資料庫
- Backup And Recovery User's Guide-執行完全資料庫恢復-關於完全資料庫恢復GUIIDE資料庫
- Backup And Recovery User's Guide-執行完全資料庫恢復-執行開啟的資料庫的恢復GUIIDE資料庫
- Backup And Recovery User's Guide-執行完全資料庫恢復-執行關閉的資料庫的恢復GUIIDE資料庫
- Backup And Recovery User's Guide-執行不完全資料庫恢復GUIIDE資料庫
- Backup And Recovery User's Guide-執行不完全資料庫恢復-執行Cancel-Based不完全恢復GUIIDE資料庫
- Backup And Recovery User's Guide-執行資料庫時間點恢復GUIIDE資料庫
- Backup And Recovery User's Guide-執行完全資料庫恢復-切換到資料庫拷貝GUIIDE資料庫
- Backup And Recovery User's Guide-執行RMAN表空間時間點恢復(TSPIRT)GUIIDE
- Backup And Recovery User's Guide-為完全資料庫恢復做準備GUIIDE資料庫
- Backup And Recovery User's Guide-執行完全資料庫恢復-還原資料檔案到非預設的位置GUIIDE資料庫
- Backup And Recovery User's Guide-執行基於時間的或基於改變的不完全恢復GUIIDE
- Backup And Recovery User's Guide-在切換到一個拷貝之後執行完全恢復GUIIDE
- Backup And Recovery User's Guide-恢復的取消(並行介質恢復)GUIIDE並行
- Backup And Recovery User's Guide-介質恢復問題解決-執行試驗恢復GUIIDE
- Backup And Recovery User's Guide-從RMAN開始-恢復表空間GUIIDE
- (Les16 執行資料庫恢復)-表空間恢復資料庫
- Backup And Recovery User's Guide-為完全資料庫恢復做準備-確定資料庫的DBIDGUIIDE資料庫
- Backup And Recovery User's Guide-執行完全自動的RMAN TSPITRGUIIDE
- 基於時間執行資料庫不完全恢復資料庫
- Backup And Recovery User's Guide-恢復資料庫到祖先incarnationGUIIDE資料庫
- Backup And Recovery User's Guide-執行使用者管理的資料庫閃回和恢復GUIIDE資料庫
- Backup And Recovery User's Guide-閃回和資料庫時間點恢復的目的GUIIDE資料庫
- 使用RMAN對PDB中的表空間或資料檔案執行完全恢復
- Backup And Recovery User's Guide-使用SET AUTORECOVERY進行自動恢復GUIIDE
- Backup And Recovery User's Guide-閃回和資料庫時間點恢復場景GUIIDE資料庫
- Backup And Recovery User's Guide-介質恢復問題解決-執行RECOVER…TEST語句GUIIDE
- Backup And Recovery User's Guide-時間點恢復的基本概念GUIIDE
- Backup And Recovery User's Guide-從RMAN開始-恢復整個資料庫GUIIDE資料庫
- Backup And Recovery User's Guide-恢復處於非歸檔模式的資料庫GUIIDE模式資料庫
- Oracle RMAN 表空間的完全恢復Oracle
- Backup And Recovery User's Guide-閃回和資料庫時間點恢復的基本概念GUIIDE資料庫
- 使用RMAN來PDB執行完全恢復
- Backup And Recovery User's Guide-備份和恢復介紹-資料恢復指導(advisor)GUIIDE資料恢復
- Backup And Recovery User's Guide-使用RECOVER命令的自動恢復GUIIDE
- Backup And Recovery User's Guide-保證的還原點和快速恢復區空間的使用GUIIDE
- Backup And Recovery User's Guide-備份和恢復介紹-備份和恢復的目的-資料傳輸GUIIDE