1、确定auxiliary destination以及大小
确保auxiliary destination的大小能够容纳恢复过程中所产生的数据文件(建议大小至少为现有库大小的1.5倍)。
2、确保存在历史备份
RMAN> RESTORE DATABASE PREVIEW SUMMARY; Starting restore at 14-NOV-2017 14:38:51 using channel ORA_DISK_1 List of Backups =============== Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag ------- -- -- - ----------- -------------------- ------- ------- ---------- --- 29 B 0 A DISK 14-NOV-2017 09:48:40 1 1 YES HOT_DB_BK_LEVEL1 37 B 1 A DISK 14-NOV-2017 09:53:10 1 1 YES HOT_DB_BK_LEVEL1 30 B 0 A DISK 14-NOV-2017 09:49:18 1 1 YES HOT_DB_BK_LEVEL1 28 B 0 A DISK 14-NOV-2017 09:41:38 1 1 YES HOT_DB_BK_LEVEL1 36 B 1 A DISK 14-NOV-2017 09:52:25 1 1 YES HOT_DB_BK_LEVEL1 27 B 0 A DISK 14-NOV-2017 09:38:26 1 1 YES HOT_DB_BK_LEVEL1 35 B 1 A DISK 14-NOV-2017 09:51:21 1 1 YES HOT_DB_BK_LEVEL1 42 B F A DISK 14-NOV-2017 14:19:50 1 1 NO TAG20171114T141949 List of Backups =============== Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag ------- -- -- - ----------- -------------------- ------- ------- ---------- --- 39 B A A DISK 14-NOV-2017 09:53:23 1 1 NO TAG20171114T095323 List of Archived Log Copies for database with db_unique_name PROD ===================================================================== Key Thrd Seq S Low Time ------- ---- ------- - -------------------- 640 1 234 A 14-NOV-2017 09:53:20 Name: +FRA/PROD/ARCHIVELOG/2017_11_14/thread_1_seq_234.323.960041303 641 2 408 A 14-NOV-2017 09:53:22 Name: +FRA/PROD/ARCHIVELOG/2017_11_14/thread_2_seq_408.313.960041303 recovery will be done up to SCN 12096446396741 Media recovery start SCN is 12096446396741 Recovery must be done beyond SCN 12096446435002 to clear datafile fuzziness Finished restore at 14-NOV-2017 14:38:52 或者 RMAN> LIST BACKUPSET SUMMARY;
3、获取日志队列号
SELECT thread#, sequence#, first_time, next_time FROM gv$archived_log ORDER BY sequence#; ...... THREAD# SEQUENCE# FIRST_TIME NEXT_TIME ---------- ---------- ----------------------- ----------------------- 2 406 14-NOV-2017 09:50:01 14-NOV-2017 09:53:16 2 406 14-NOV-2017 09:50:01 14-NOV-2017 09:53:16 2 407 14-NOV-2017 09:53:16 14-NOV-2017 09:53:22 2 407 14-NOV-2017 09:53:16 14-NOV-2017 09:53:22 2 408 14-NOV-2017 09:53:22 14-NOV-2017 14:08:23 2 408 14-NOV-2017 09:53:22 14-NOV-2017 14:08:23
4、编写并执行RMAN的recover脚本
RECOVER TABLESPACE tbs UNTIL LOGSEQ 407 THREAD 2 AUXILIARY DESTINATION '/u03/resfile'; --recover日志 Starting recover at 14-NOV-2017 14:07:23 using channel ORA_DISK_1 RMAN-05026: warning: presuming following set of tablespaces applies to specified point-in-time List of tablespaces expected to have UNDO segments Tablespace SYSTEM Tablespace GZDB:SYSTEM Tablespace SDDB:SYSTEM Tablespace UNDOTBS1 Tablespace GZDB:UNDOTBS1 Tablespace SDDB:UNDOTBS1 Tablespace UNDOTBS2 Tablespace GZDB:UNDO_2 Tablespace SDDB:UNDO_2 Creating automatic instance, with SID='hDCt' initialization parameters used for automatic instance: db_name=PROD db_unique_name=hDCt_pitr_PROD compatible=12.2.0 db_block_size=8192 db_files=200 diagnostic_dest=/u01/app/oracle _system_trig_enabled=FALSE sga_target=3360M processes=200 db_create_file_dest=/u03/resfile log_archive_dest_1='location=/u03/resfile' enable_pluggable_database=true _clone_one_pdb_recovery=true #No auxiliary parameter file used starting up automatic instance PROD Oracle instance started Total System Global Area 3523215360 bytes Fixed Size 8798792 bytes Variable Size 721423800 bytes Database Buffers 2785017856 bytes Redo Buffers 7974912 bytes Automatic instance created Running TRANSPORT_SET_CHECK on recovery set tablespaces TRANSPORT_SET_CHECK completed successfully contents of Memory Script: { # set requested point in time set until logseq 407 thread 2; # restore the controlfile restore clone controlfile; # mount the controlfile sql clone 'alter database mount clone database'; # archive current online log sql 'alter system archive log current'; # avoid unnecessary autobackups for structural changes during TSPITR sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;'; } executing Memory Script executing command: SET until clause Starting restore at 14-NOV-2017 14:08:05 allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=92 device type=DISK channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: restoring control file channel ORA_AUX_DISK_1: reading from backup piece +FRA/PROD/AUTOBACKUP/2017_11_14/s_960025994.319.960025995 channel ORA_AUX_DISK_1: piece handle=+FRA/PROD/AUTOBACKUP/2017_11_14/s_960025994.319.960025995 tag=TAG20171114T095314 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:09 output file name=/u03/resfile/PROD/controlfile/o1_mf_f0o22hxv_.ctl Finished restore at 14-NOV-2017 14:08:17 sql statement: alter database mount clone database sql statement: alter system archive log current sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end; contents of Memory Script: { # set requested point in time set until logseq 407 thread 2; plsql <<<-- declare sqlstatement varchar2(512); pdbname varchar2(128); offline_not_needed exception; pragma exception_init(offline_not_needed, -01539); begin pdbname := null; -- pdbname sqlstatement := 'alter tablespace '|| 'TBS' ||' offline immediate'; krmicd.writeMsg(6162, sqlstatement); krmicd.execSql(sqlstatement, 0, pdbname); exception when offline_not_needed then null; end; >>>; # set destinations for recovery set and auxiliary set datafiles set newname for clone datafile 1 to new; set newname for clone datafile 16 to new; set newname for clone datafile 12 to new; set newname for clone datafile 4 to new; set newname for clone datafile 18 to new; set newname for clone datafile 14 to new; set newname for clone datafile 9 to new; set newname for clone datafile 19 to new; set newname for clone datafile 15 to new; set newname for clone datafile 3 to new; set newname for clone tempfile 1 to new; set newname for datafile 10 to "+DATA/PROD/DATAFILE/tbs.289.959527251"; # switch all tempfiles switch clone tempfile all; # restore the tablespaces in the recovery set and the auxiliary set restore clone datafile 1, 16, 12, 4, 18, 14, 9, 19, 15, 3, 10; switch clone datafile all; } executing Memory Script executing command: SET until clause sql statement: alter tablespace TBS offline immediate executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME renamed tempfile 1 to /u03/resfile/PROD/datafile/o1_mf_temp_%u_.tmp in control file Starting restore at 14-NOV-2017 14:08:25 using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set channel ORA_AUX_DISK_1: restoring datafile 00016 to /u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_system_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00018 to /u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_undotbs1_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00019 to /u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_undo_2_%u_.dbf channel ORA_AUX_DISK_1: reading from backup piece /u03/full_29_1_960025067 channel ORA_AUX_DISK_1: piece handle=/u03/full_29_1_960025067 tag=HOT_DB_BK_LEVEL1 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:03:35 channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set channel ORA_AUX_DISK_1: restoring datafile 00012 to /u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_system_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00014 to /u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_undotbs1_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00015 to /u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_undo_2_%u_.dbf channel ORA_AUX_DISK_1: reading from backup piece /u03/full_30_1_960025252 channel ORA_AUX_DISK_1: piece handle=/u03/full_30_1_960025252 tag=HOT_DB_BK_LEVEL1 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45 channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set channel ORA_AUX_DISK_1: restoring datafile 00001 to /u03/resfile/PROD/datafile/o1_mf_system_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00004 to /u03/resfile/PROD/datafile/o1_mf_undotbs1_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00009 to /u03/resfile/PROD/datafile/o1_mf_undotbs2_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00003 to /u03/resfile/PROD/datafile/o1_mf_sysaux_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00010 to +DATA/PROD/DATAFILE/tbs.289.959527251 channel ORA_AUX_DISK_1: reading from backup piece /u03/full_31_1_960025638 channel ORA_AUX_DISK_1: piece handle=/u03/full_31_1_960025638 tag=HOT_DB_BK_LEVEL1 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:45 Finished restore at 14-NOV-2017 14:14:33 datafile 1 switched to datafile copy input datafile copy RECID=14 STAMP=960041674 file name=/u03/resfile/PROD/datafile/o1_mf_system_f0o2c0lo_.dbf datafile 16 switched to datafile copy input datafile copy RECID=15 STAMP=960041674 file name=/u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_system_f0o22vtl_.dbf datafile 12 switched to datafile copy input datafile copy RECID=16 STAMP=960041674 file name=/u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_system_f0o29m9h_.dbf datafile 4 switched to datafile copy input datafile copy RECID=17 STAMP=960041674 file name=/u03/resfile/PROD/datafile/o1_mf_undotbs1_f0o2c0lq_.dbf datafile 18 switched to datafile copy input datafile copy RECID=18 STAMP=960041674 file name=/u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_undotbs1_f0o22vs5_.dbf datafile 14 switched to datafile copy input datafile copy RECID=19 STAMP=960041674 file name=/u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_undotbs1_f0o29mbm_.dbf datafile 9 switched to datafile copy input datafile copy RECID=20 STAMP=960041674 file name=/u03/resfile/PROD/datafile/o1_mf_undotbs2_f0o2c0kc_.dbf datafile 19 switched to datafile copy input datafile copy RECID=21 STAMP=960041674 file name=/u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_undo_2_f0o22vtj_.dbf datafile 15 switched to datafile copy input datafile copy RECID=22 STAMP=960041674 file name=/u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_undo_2_f0o29m9f_.dbf datafile 3 switched to datafile copy input datafile copy RECID=23 STAMP=960041674 file name=/u03/resfile/PROD/datafile/o1_mf_sysaux_f0o2c0k8_.dbf contents of Memory Script: { # set requested point in time set until logseq 407 thread 2; # online the datafiles restored or switched sql clone "alter database datafile 1 online"; sql clone 'GZDB' "alter database datafile 16 online"; sql clone 'SDDB' "alter database datafile 12 online"; sql clone "alter database datafile 4 online"; sql clone 'GZDB' "alter database datafile 18 online"; sql clone 'SDDB' "alter database datafile 14 online"; sql clone "alter database datafile 9 online"; sql clone 'GZDB' "alter database datafile 19 online"; sql clone 'SDDB' "alter database datafile 15 online"; sql clone "alter database datafile 3 online"; sql clone "alter database datafile 10 online"; # recover and open resetlogs recover clone database tablespace "TBS", "SYSTEM", "GZDB":"SYSTEM", "SDDB":"SYSTEM", "UNDOTBS1", "GZDB":"UNDOTBS1", "SDDB":"UNDOTBS1", "UNDOTBS2", "GZDB":"UNDO_2", "SDDB":"UNDO_2", "SYSAUX" delete archivelog; alter clone database open resetlogs; } executing Memory Script executing command: SET until clause sql statement: alter database datafile 1 online sql statement: alter database datafile 16 online sql statement: alter database datafile 12 online sql statement: alter database datafile 4 online sql statement: alter database datafile 18 online sql statement: alter database datafile 14 online sql statement: alter database datafile 9 online sql statement: alter database datafile 19 online sql statement: alter database datafile 15 online sql statement: alter database datafile 3 online sql statement: alter database datafile 10 online Starting recover at 14-NOV-2017 14:14:38 using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting incremental datafile backup set restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set destination for restore of datafile 00016: /u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_system_f0o22vtl_.dbf destination for restore of datafile 00018: /u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_undotbs1_f0o22vs5_.dbf destination for restore of datafile 00019: /u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_undo_2_f0o22vtj_.dbf channel ORA_AUX_DISK_1: reading from backup piece /u03/full_37_1_960025875 channel ORA_AUX_DISK_1: piece handle=/u03/full_37_1_960025875 tag=HOT_DB_BK_LEVEL1 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01 channel ORA_AUX_DISK_1: starting incremental datafile backup set restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set destination for restore of datafile 00012: /u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_system_f0o29m9h_.dbf destination for restore of datafile 00014: /u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_undotbs1_f0o29mbm_.dbf destination for restore of datafile 00015: /u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_undo_2_f0o29m9f_.dbf channel ORA_AUX_DISK_1: reading from backup piece /u03/full_38_1_960025941 channel ORA_AUX_DISK_1: piece handle=/u03/full_38_1_960025941 tag=HOT_DB_BK_LEVEL1 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01 channel ORA_AUX_DISK_1: starting incremental datafile backup set restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set destination for restore of datafile 00010: +DATA/PROD/DATAFILE/tbs.289.959527251 destination for restore of datafile 00001: /u03/resfile/PROD/datafile/o1_mf_system_f0o2c0lo_.dbf destination for restore of datafile 00004: /u03/resfile/PROD/datafile/o1_mf_undotbs1_f0o2c0lq_.dbf destination for restore of datafile 00009: /u03/resfile/PROD/datafile/o1_mf_undotbs2_f0o2c0kc_.dbf destination for restore of datafile 00003: /u03/resfile/PROD/datafile/o1_mf_sysaux_f0o2c0k8_.dbf channel ORA_AUX_DISK_1: reading from backup piece /u03/full_39_1_960025986 channel ORA_AUX_DISK_1: piece handle=/u03/full_39_1_960025986 tag=HOT_DB_BK_LEVEL1 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01 starting media recovery channel ORA_AUX_DISK_1: starting archived log restore to default destination channel ORA_AUX_DISK_1: restoring archived log archived log thread=1 sequence=232 channel ORA_AUX_DISK_1: restoring archived log archived log thread=2 sequence=406 channel ORA_AUX_DISK_1: reading from backup piece /u03/PROD_arch_42_1_1 channel ORA_AUX_DISK_1: piece handle=/u03/PROD_arch_42_1_1 tag=TAG20171114T095323 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01 archived log file name=/u03/resfile/1_232_959510681.dbf thread=1 sequence=232 archived log file name=/u03/resfile/2_406_959510681.dbf thread=2 sequence=406 channel clone_default: deleting archived log(s) archived log file name=/u03/resfile/2_406_959510681.dbf RECID=637 STAMP=960041686 channel clone_default: deleting archived log(s) archived log file name=/u03/resfile/1_232_959510681.dbf RECID=636 STAMP=960041686 media recovery complete, elapsed time: 00:00:00 Finished recover at 14-NOV-2017 14:14:48 database opened contents of Memory Script: { # make read only the tablespace that will be exported sql clone 'alter tablespace TBS read only'; # create directory for datapump import sql "create or replace directory TSPITR_DIROBJ_DPDIR as '' /u03/resfile''"; # create directory for datapump export sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as '' /u03/resfile''"; } executing Memory Script sql statement: alter tablespace TBS read only sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u03/resfile'' sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u03/resfile'' Performing export of metadata... EXPDP> Warning: Oracle Data Pump operations are not typically needed when connected to the root or seed of a container database. EXPDP> Starting "SYS"."TSPITR_EXP_hDCt_jlmc": EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK EXPDP> Master table "SYS"."TSPITR_EXP_hDCt_jlmc" successfully loaded/unloaded EXPDP> ****************************************************************************** EXPDP> Dump file set for SYS.TSPITR_EXP_hDCt_jlmc is: EXPDP> /u03/resfile/tspitr_hDCt_83837.dmp EXPDP> ****************************************************************************** EXPDP> Datafiles required for transportable tablespace TBS: EXPDP> +DATA/PROD/DATAFILE/tbs.289.959527251 EXPDP> Job "SYS"."TSPITR_EXP_hDCt_jlmc" successfully completed at Tue Nov 14 14:15:51 2017 elapsed 0 00:00:41 Export completed contents of Memory Script: { # shutdown clone before import shutdown clone abort # drop target tablespaces before importing them back sql 'drop tablespace TBS including contents keep datafiles cascade constraints'; } executing Memory Script Oracle instance shut down sql statement: drop tablespace TBS including contents keep datafiles cascade constraints Performing import of metadata... IMPDP> Warning: Oracle Data Pump operations are not typically needed when connected to the root or seed of a container database. IMPDP> Master table "SYS"."TSPITR_IMP_hDCt_pjBy" successfully loaded/unloaded IMPDP> Starting "SYS"."TSPITR_IMP_hDCt_pjBy": IMPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK IMPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK IMPDP> Job "SYS"."TSPITR_IMP_hDCt_pjBy" successfully completed at Tue Nov 14 14:16:26 2017 elapsed 0 00:00:11 Import completed contents of Memory Script: { # make read write and offline the imported tablespaces sql 'alter tablespace TBS read write'; sql 'alter tablespace TBS offline'; # enable autobackups after TSPITR is finished sql 'begin dbms_backup_restore.AutoBackupFlag(TRUE); end;'; } executing Memory Script sql statement: alter tablespace TBS read write sql statement: alter tablespace TBS offline sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end; Removing automatic instance Automatic instance removed auxiliary instance file /u03/resfile/PROD/datafile/o1_mf_temp_f0o2gyn1_.tmp deleted auxiliary instance file /u03/resfile/PROD/onlinelog/o1_mf_4_f0o2gsb3_.log deleted auxiliary instance file /u03/resfile/PROD/onlinelog/o1_mf_3_f0o2gs7x_.log deleted auxiliary instance file /u03/resfile/PROD/onlinelog/o1_mf_2_f0o2gs5r_.log deleted auxiliary instance file /u03/resfile/PROD/onlinelog/o1_mf_1_f0o2gs5b_.log deleted auxiliary instance file /u03/resfile/PROD/datafile/o1_mf_sysaux_f0o2c0k8_.dbf deleted auxiliary instance file /u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_undo_2_f0o29m9f_.dbf deleted auxiliary instance file /u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_undo_2_f0o22vtj_.dbf deleted auxiliary instance file /u03/resfile/PROD/datafile/o1_mf_undotbs2_f0o2c0kc_.dbf deleted auxiliary instance file /u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_undotbs1_f0o29mbm_.dbf deleted auxiliary instance file /u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_undotbs1_f0o22vs5_.dbf deleted auxiliary instance file /u03/resfile/PROD/datafile/o1_mf_undotbs1_f0o2c0lq_.dbf deleted auxiliary instance file /u03/resfile/PROD/5D74D63FD00D634BE0535278A8C01EB1/datafile/o1_mf_system_f0o29m9h_.dbf deleted auxiliary instance file /u03/resfile/PROD/5D74D63FD00F634BE0535278A8C01EB1/datafile/o1_mf_system_f0o22vtl_.dbf deleted auxiliary instance file /u03/resfile/PROD/datafile/o1_mf_system_f0o2c0lo_.dbf deleted auxiliary instance file /u03/resfile/PROD/controlfile/o1_mf_f0o22hxv_.ctl deleted auxiliary instance file tspitr_hDCt_83837.dmp deleted Finished recover at 14-NOV-2017 14:16:34 到此,recover执行完毕。但是,tbs表空间处于offline状态。
5、建议备份tbs表空间
RMAN> backup tablespace tbs; Starting backup at 14-NOV-2017 14:19:49 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00023 name=+DATA/PROD/DATAFILE/tbs.289.959527251 channel ORA_DISK_1: starting piece 1 at 14-NOV-2017 14:19:49 channel ORA_DISK_1: finished piece 1 at 14-NOV-2017 14:19:51 piece handle=+FRA/PROD/BACKUPSET/2017_11_14/nnndf0_tag20171114t141949_0.324.960041991 tag=TAG20171114T141949 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02 Finished backup at 14-NOV-2017 14:19:51 Starting Control File and SPFILE Autobackup at 14-NOV-2017 14:19:51 piece handle=+FRA/PROD/AUTOBACKUP/2017_11_14/s_960041991.328.960041991 comment=NONE Finished Control File and SPFILE Autobackup at 14-NOV-2017 14:19:52
6、更改TBS表空间状态为online
RMAN> alter tablespace tbs online;
参考文献:Database Backup and Recovery User's Guide