RMAN表空间时间点恢复,TSPITR

这里主要讲auxiliary set使用已有的image copy备份的情况。直接说结论,然后再放出操作过程。

先上脚本:

 run
 {
 set newname for datafile 10 to '/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_undotbs2_ddn500q2_.dbf';
set newname for datafile 6 to '/u01/data2/oradata/copy/dbfile06.dbf';
 set newname for datafile 1 to '/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_system_ddn5002l_.dbf';
 set newname for datafile 2 to '/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_sysaux_ddn5002o_.dbf';
 recover tablespace test_t until scn 104906647 auxiliary destination '/u01/data2/oradata/auxiliaryd';
}

大致讲下脚本内容。这里要恢复的是表空间test_t。包含两个数据文件datafile 6和3。脚本中设置auxiliary instance的system,sysaux,undo表空间以及datafile 6直接使用已有的image copy备份。datafile 3这里没有设置,意思是使用rman默认行为。

从下面的恢复日志可以看出,rman使用了datafile 6的image copy和datafile 3的原有文件作为auxiliary set和recover set。

TSPITR后的recover set,去除了datafile 6的数据库中原有的数据文件。也就是说导出和导入操作都发生在这两个文件上。这里一个值得注意的地方,datafile 3和datafile 6互换了。

TSPITR后,从repository中uncatalog 了datafile 1,2,10,6的image copy备份。其中6的image copy直接作为了恢复后的数据文件使用。而1,2,10被当做restore出来的auxiliary set直接remove掉了。

RMAN> report schema;



Report of database schema for database with db_unique_name ORCL2


List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    920      SYSTEM               ***     /home/oracle/app/oracle/oradata/orcl2/system01.dbf
2    970      SYSAUX               ***     /home/oracle/app/oracle/oradata/orcl2/sysaux01.dbf
3    10       TEST_T               ***     /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/test102.dbf
4    2048     USERS                ***     /home/oracle/app/oracle/oradata/orcl2/users01.dbf
5    338      EXAMPLE              ***     /home/oracle/app/oracle/oradata/orcl2/example01.dbf
6    20       TEST_T               ***     /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_test_t_dcrmrrph_.dbf3
10   2048     UNDOTBS2             ***     /home/oracle/app/oracle/oradata/orcl2/undotbs02.dbf


List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    4096     TEMP                 4096        /home/oracle/app/oracle/oradata/orcl2/temp01.dbf
2    10       TEMP                 10          /home/oracle/app/oracle/oradata/orcl2/temp02.dbf
3    10       TEMP                 10          /home/oracle/app/oracle/oradata/orcl2/temp03.dbf


RMAN> 


RMAN> list datafilecopy all;


List of Datafile Copies
=======================


Key     File S Completion Time     Ckp SCN    Ckp Time           
------- ---- - ------------------- ---------- -------------------
26      1    A 2017-03-16 12:28:44 104859253  2017-03-16 12:26:40
        Name: /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_system_ddn5002l_.dbf
        Tag: TAG20170316T122639


25      2    A 2017-03-16 12:28:21 104859251  2017-03-16 12:26:40
        Name: /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_sysaux_ddn5002o_.dbf
        Tag: TAG20170316T122639


28      3    A 2017-03-16 13:22:50 104905461  2017-03-16 13:16:25
        Name: /u01/data2/oradata/copy/test02.dbf


23      6    A 2017-03-16 12:15:27 104697796  2017-03-14 13:12:56
        Name: /u01/data2/oradata/copy/dbfile06.dbf
        Tag: TAG20170314T131213


20      6    A 2017-03-15 13:52:38 104697796  2017-03-14 13:12:56
        Name: /u01/data2/oradata/tmp/o1_mf_test_t_dcrmrrph_.dbf3
        Tag: TAG20170314T131213


1       8    A 2017-03-14 11:55:15 104689941  2017-03-14 11:55:13
        Name: /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_test_t1_ddgtf1wl_.dbf
        Tag: TAG20170314T115513


27      10   A 2017-03-16 12:28:58 104859252  2017-03-16 12:26:40
        Name: /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_undotbs2_ddn500q2_.dbf
        Tag: TAG20170316T122639




RMAN> @tspir.rman


RMAN>  run
2>  {
3>  set newname for datafile 10 to '/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_undotbs2_ddn500q2_.dbf';
4> set newname for datafile 6 to '/u01/data2/oradata/copy/dbfile06.dbf';
5>  set newname for datafile 1 to '/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_system_ddn5002l_.dbf';
6>  set newname for datafile 2 to '/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_sysaux_ddn5002o_.dbf';
7>  recover tablespace test_t until scn 104906647 auxiliary destination '/u01/data2/oradata/auxiliaryd';
8> }
executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


Starting recover at 2017-03-16 13:32:39
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
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 UNDOTBS2


Creating automatic instance, with SID='wxfa'


initialization parameters used for automatic instance:
db_name=ORCL2
db_unique_name=wxfa_tspitr_ORCL2
compatible=11.2.0.4.0
db_block_size=8192
db_files=200
sga_target=1G
processes=80
db_create_file_dest=/u01/data2/oradata/auxiliaryd
log_archive_dest_1='location=/u01/data2/oradata/auxiliaryd'
#No auxiliary parameter file used




starting up automatic instance ORCL2


Oracle instance started


Total System Global Area    1068937216 bytes


Fixed Size                     2260088 bytes
Variable Size                285213576 bytes
Database Buffers             775946240 bytes
Redo Buffers                   5517312 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  scn 104906647;
# 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 2017-03-16 13:32:45
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=109 device type=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: SID=5 device type=DISK
allocated channel: ORA_AUX_DISK_3
channel ORA_AUX_DISK_3: SID=41 device type=DISK
allocated channel: ORA_AUX_DISK_4
channel ORA_AUX_DISK_4: SID=78 device type=DISK
allocated channel: ORA_AUX_DISK_5
channel ORA_AUX_DISK_5: SID=114 device type=DISK


channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: copied control file copy
input file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/controlfile/o1_mf_TAG20170316T133155_ddn8tcf7_.ctl
output file name=/u01/data2/oradata/auxiliaryd/ORCL2/controlfile/o1_mf_ddn8vylz_.ctl
Finished restore at 2017-03-16 13:32:47


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  scn 104906647;
# switch to valid datafilecopies
switch clone datafile  1 to datafilecopy 
 "/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_system_ddn5002l_.dbf";
switch clone datafile  10 to datafilecopy 
 "/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_undotbs2_ddn500q2_.dbf";
switch clone datafile  2 to datafilecopy 
 "/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_sysaux_ddn5002o_.dbf";
switch clone datafile  6 to datafilecopy 
 "/u01/data2/oradata/copy/dbfile06.dbf";
set newname for clone tempfile  1 to new;
set newname for clone tempfile  2 to new;
set newname for clone tempfile  3 to new;
set newname for datafile  3 to 
 "/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/test102.dbf";
# switch all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile  3;
switch clone datafile all;
}
executing Memory Script


executing command: SET until clause


datafile 1 switched to datafile copy
input datafile copy RECID=29 STAMP=938784773 file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_system_ddn5002l_.dbf


datafile 10 switched to datafile copy
input datafile copy RECID=30 STAMP=938784773 file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_undotbs2_ddn500q2_.dbf


datafile 2 switched to datafile copy
input datafile copy RECID=31 STAMP=938784773 file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_sysaux_ddn5002o_.dbf


datafile 6 switched to datafile copy
input datafile copy RECID=32 STAMP=938784773 file name=/u01/data2/oradata/copy/dbfile06.dbf


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


renamed tempfile 1 to /u01/data2/oradata/auxiliaryd/ORCL2/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 2 to /u01/data2/oradata/auxiliaryd/ORCL2/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 3 to /u01/data2/oradata/auxiliaryd/ORCL2/datafile/o1_mf_temp_%u_.tmp in control file


Starting restore at 2017-03-16 13:32:52
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3
using channel ORA_AUX_DISK_4
using channel ORA_AUX_DISK_5


channel ORA_AUX_DISK_1: restoring datafile 00003
input datafile copy RECID=28 STAMP=938784170 file name=/u01/data2/oradata/copy/test02.dbf
destination for restore of datafile 00003: /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/test102.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00003
output file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/test102.dbf RECID=0 STAMP=0
Finished restore at 2017-03-16 13:32:53




contents of Memory Script:
{
# set requested point in time
set until  scn 104906647;
# online the datafiles restored or switched
sql clone "alter database datafile  1 online";
sql clone "alter database datafile  10 online";
sql clone "alter database datafile  2 online";
sql clone "alter database datafile  3 online";
sql clone "alter database datafile  6 online";
# recover and open resetlogs
recover clone database tablespace  "TEST_T", "SYSTEM", "UNDOTBS2", "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  10 online


sql statement: alter database datafile  2 online


sql statement: alter database datafile  3 online


sql statement: alter database datafile  6 online


Starting recover at 2017-03-16 13:32:53
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3
using channel ORA_AUX_DISK_4
using channel ORA_AUX_DISK_5


starting media recovery


archived log for thread 1 with sequence 11 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_11_938481054.dbf
archived log for thread 1 with sequence 12 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_12_938481054.dbf
archived log for thread 1 with sequence 13 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_13_938481054.dbf
archived log for thread 1 with sequence 14 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_14_938481054.dbf
archived log for thread 1 with sequence 15 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_15_938481054.dbf
archived log for thread 1 with sequence 16 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_16_938481054.dbf
archived log for thread 1 with sequence 17 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_17_938481054.dbf
archived log for thread 1 with sequence 18 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_18_938481054.dbf
archived log for thread 1 with sequence 19 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_19_938481054.dbf
archived log for thread 1 with sequence 20 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_20_938481054.dbf
archived log for thread 1 with sequence 21 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_21_938481054.dbf
archived log for thread 1 with sequence 22 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_22_938481054.dbf
archived log for thread 1 with sequence 23 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_23_938481054.dbf
archived log for thread 1 with sequence 24 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_24_938481054.dbf
archived log for thread 1 with sequence 25 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_25_938481054.dbf
archived log for thread 1 with sequence 26 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_26_938481054.dbf
archived log for thread 1 with sequence 27 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_27_938481054.dbf
archived log for thread 1 with sequence 28 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_28_938481054.dbf
archived log for thread 1 with sequence 29 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_29_938481054.dbf
archived log for thread 1 with sequence 30 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_30_938481054.dbf
archived log for thread 1 with sequence 31 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_31_938481054.dbf
archived log for thread 1 with sequence 32 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_32_938481054.dbf
archived log for thread 1 with sequence 33 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_33_938481054.dbf
archived log for thread 1 with sequence 34 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_34_938481054.dbf
archived log for thread 1 with sequence 35 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_35_938481054.dbf
archived log for thread 1 with sequence 36 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_36_938481054.dbf
archived log for thread 1 with sequence 37 is already on disk as file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_37_938481054.dbf
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_11_938481054.dbf thread=1 sequence=11
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_12_938481054.dbf thread=1 sequence=12
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_13_938481054.dbf thread=1 sequence=13
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_14_938481054.dbf thread=1 sequence=14
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_15_938481054.dbf thread=1 sequence=15
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_16_938481054.dbf thread=1 sequence=16
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_17_938481054.dbf thread=1 sequence=17
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_18_938481054.dbf thread=1 sequence=18
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_19_938481054.dbf thread=1 sequence=19
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_20_938481054.dbf thread=1 sequence=20
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_21_938481054.dbf thread=1 sequence=21
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_22_938481054.dbf thread=1 sequence=22
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_23_938481054.dbf thread=1 sequence=23
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_24_938481054.dbf thread=1 sequence=24
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_25_938481054.dbf thread=1 sequence=25
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_26_938481054.dbf thread=1 sequence=26
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_27_938481054.dbf thread=1 sequence=27
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_28_938481054.dbf thread=1 sequence=28
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_29_938481054.dbf thread=1 sequence=29
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_30_938481054.dbf thread=1 sequence=30
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_31_938481054.dbf thread=1 sequence=31
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_32_938481054.dbf thread=1 sequence=32
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_33_938481054.dbf thread=1 sequence=33
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_34_938481054.dbf thread=1 sequence=34
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_35_938481054.dbf thread=1 sequence=35
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_36_938481054.dbf thread=1 sequence=36
archived log file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/log_archive_dest/1_37_938481054.dbf thread=1 sequence=37
media recovery complete, elapsed time: 00:00:21
Finished recover at 2017-03-16 13:33:15


database opened


contents of Memory Script:
{
# online the tablespaces that will be exported
sql clone 'alter tablespace  TEST_T online';
# make read only the tablespace that will be exported
sql clone 'alter tablespace  TEST_T read only';
# create directory for datapump import
sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/u01/data2/oradata/auxiliaryd''";
# create directory for datapump export
sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/u01/data2/oradata/auxiliaryd''";
}
executing Memory Script


sql statement: alter tablespace  TEST_T online


sql statement: alter tablespace  TEST_T read only


sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/data2/oradata/auxiliaryd''


sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/data2/oradata/auxiliaryd''


Performing export of metadata...
   EXPDP> Starting "SYS"."TSPITR_EXP_wxfa":  
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   EXPDP> Master table "SYS"."TSPITR_EXP_wxfa" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TSPITR_EXP_wxfa is:
   EXPDP>   /u01/data2/oradata/auxiliaryd/tspitr_wxfa_96772.dmp
   EXPDP> ******************************************************************************
   EXPDP> Datafiles required for transportable tablespace TEST_T:
   EXPDP>   /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/test102.dbf
   EXPDP>   /u01/data2/oradata/copy/dbfile06.dbf
   EXPDP> Job "SYS"."TSPITR_EXP_wxfa" successfully completed at Thu Mar 16 13:34:28 2017 elapsed 0 00:00:38
Export completed




contents of Memory Script:
{
# shutdown clone before import
shutdown clone immediate
# uncatalog used datafilecopies
change datafilecopy  "/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_system_ddn5002l_.dbf" uncatalog;
change datafilecopy  "/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_undotbs2_ddn500q2_.dbf" uncatalog;
change datafilecopy  "/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_sysaux_ddn5002o_.dbf" uncatalog;
change datafilecopy  "/u01/data2/oradata/copy/dbfile06.dbf" uncatalog;
# drop target tablespaces before importing them back
sql 'drop tablespace  TEST_T including contents keep datafiles cascade constraints';
}
executing Memory Script


database closed
database dismounted
Oracle instance shut down


uncataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_system_ddn5002l_.dbf RECID=26 STAMP=938780924
Uncataloged 1 objects




uncataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_undotbs2_ddn500q2_.dbf RECID=27 STAMP=938780938
Uncataloged 1 objects




uncataloged datafile copy
datafile copy file name=/home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_sysaux_ddn5002o_.dbf RECID=25 STAMP=938780901
Uncataloged 1 objects




uncataloged datafile copy
datafile copy file name=/u01/data2/oradata/copy/dbfile06.dbf RECID=23 STAMP=938780127
Uncataloged 1 objects




sql statement: drop tablespace  TEST_T including contents keep datafiles cascade constraints


Performing import of metadata...
   IMPDP> Master table "SYS"."TSPITR_IMP_wxfa" successfully loaded/unloaded
   IMPDP> Starting "SYS"."TSPITR_IMP_wxfa":  
   IMPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   IMPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
   IMPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
   IMPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   IMPDP> Job "SYS"."TSPITR_IMP_wxfa" successfully completed at Thu Mar 16 13:34:47 2017 elapsed 0 00:00:02
Import completed




contents of Memory Script:
{
# make read write and offline the imported tablespaces
sql 'alter tablespace  TEST_T read write';
sql 'alter tablespace  TEST_T offline';
# enable autobackups after TSPITR is finished
sql 'begin dbms_backup_restore.AutoBackupFlag(TRUE); end;';
}
executing Memory Script


sql statement: alter tablespace  TEST_T read write


sql statement: alter tablespace  TEST_T offline


sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end;


Removing automatic instance
Automatic instance removed
auxiliary instance file /u01/data2/oradata/auxiliaryd/ORCL2/datafile/o1_mf_temp_ddn8x6jj_.tmp deleted
auxiliary instance file /u01/data2/oradata/auxiliaryd/ORCL2/datafile/o1_mf_temp_ddn8x6jv_.tmp deleted
auxiliary instance file /u01/data2/oradata/auxiliaryd/ORCL2/datafile/o1_mf_temp_ddn8x6k5_.tmp deleted
auxiliary instance file /u01/data2/oradata/auxiliaryd/ORCL2/onlinelog/o1_mf_5_ddn8x4h7_.log deleted
auxiliary instance file /u01/data2/oradata/auxiliaryd/ORCL2/onlinelog/o1_mf_4_ddn8wxow_.log deleted
auxiliary instance file /u01/data2/oradata/auxiliaryd/ORCL2/onlinelog/o1_mf_3_ddn8wwky_.log deleted
auxiliary instance file /u01/data2/oradata/auxiliaryd/ORCL2/onlinelog/o1_mf_2_ddn8wvtb_.log deleted
auxiliary instance file /u01/data2/oradata/auxiliaryd/ORCL2/onlinelog/o1_mf_1_ddn8wv55_.log deleted
auxiliary instance file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_sysaux_ddn5002o_.dbf deleted
auxiliary instance file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_undotbs2_ddn500q2_.dbf deleted
auxiliary instance file /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_system_ddn5002l_.dbf deleted
auxiliary instance file /u01/data2/oradata/auxiliaryd/ORCL2/controlfile/o1_mf_ddn8vylz_.ctl deleted
Finished recover at 2017-03-16 13:34:48


RMAN> **end-of-file**


RMAN> report schema;


Report of database schema for database with db_unique_name ORCL2


List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    920      SYSTEM               ***     /home/oracle/app/oracle/oradata/orcl2/system01.dbf
2    970      SYSAUX               ***     /home/oracle/app/oracle/oradata/orcl2/sysaux01.dbf
3    0        TEST_T               ***     /u01/data2/oradata/copy/dbfile06.dbf
4    2048     USERS                ***     /home/oracle/app/oracle/oradata/orcl2/users01.dbf
5    338      EXAMPLE              ***     /home/oracle/app/oracle/oradata/orcl2/example01.dbf
6    0        TEST_T               ***     /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/test102.dbf
10   2048     UNDOTBS2             ***     /home/oracle/app/oracle/oradata/orcl2/undotbs02.dbf


List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    4096     TEMP                 4096        /home/oracle/app/oracle/oradata/orcl2/temp01.dbf
2    10       TEMP                 10          /home/oracle/app/oracle/oradata/orcl2/temp02.dbf
3    10       TEMP                 10          /home/oracle/app/oracle/oradata/orcl2/temp03.dbf


RMAN> 


RMAN> 


RMAN> 


RMAN> report schema;


Report of database schema for database with db_unique_name ORCL2


List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    920      SYSTEM               ***     /home/oracle/app/oracle/oradata/orcl2/system01.dbf
2    970      SYSAUX               ***     /home/oracle/app/oracle/oradata/orcl2/sysaux01.dbf
3    20       TEST_T               ***     /u01/data2/oradata/copy/dbfile06.dbf
4    2048     USERS                ***     /home/oracle/app/oracle/oradata/orcl2/users01.dbf
5    338      EXAMPLE              ***     /home/oracle/app/oracle/oradata/orcl2/example01.dbf
6    10       TEST_T               ***     /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/test102.dbf
10   2048     UNDOTBS2             ***     /home/oracle/app/oracle/oradata/orcl2/undotbs02.dbf


List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    4096     TEMP                 4096        /home/oracle/app/oracle/oradata/orcl2/temp01.dbf
2    10       TEMP                 10          /home/oracle/app/oracle/oradata/orcl2/temp02.dbf
3    10       TEMP                 10          /home/oracle/app/oracle/oradata/orcl2/temp03.dbf


RMAN> 


RMAN> 


RMAN> 


RMAN> 


RMAN> 


RMAN> list datafilecopy all;


List of Datafile Copies
=======================


Key     File S Completion Time     Ckp SCN    Ckp Time           
------- ---- - ------------------- ---------- -------------------
28      3    A 2017-03-16 13:22:50 104905461  2017-03-16 13:16:25
        Name: /u01/data2/oradata/copy/test02.dbf


20      6    A 2017-03-15 13:52:38 104697796  2017-03-14 13:12:56
        Name: /u01/data2/oradata/tmp/o1_mf_test_t_dcrmrrph_.dbf3
        Tag: TAG20170314T131213


1       8    A 2017-03-14 11:55:15 104689941  2017-03-14 11:55:13
        Name: /home/oracle/app/oracle/fast_recovery_area1/ORCL2/datafile/o1_mf_test_t1_ddgtf1wl_.dbf
        Tag: TAG20170314T115513

猜你喜欢

转载自blog.csdn.net/w1346561235/article/details/62422141