4.在这里指定了auxiliary destination子句让RMAN使用缺省值来管理辅助实例。只指定必须的选项。Oracle建议transport tablespace命令使用辅助目录秋简化辅助实例文件的管理。下面来执transport tablespace命令来传输tspitr,test两个表空间:
[oracle@oracle11g ~]$ export NLS_DATE_FORMATE='yyyy-mm-dd hh24:mi:ss';
[oracle@oracle11g ~]$ rman target sys/zzh_2046@test catalog rman/rman@jy
Recovery Manager: Release 10.2.0.5.0 - Production on Fri Mar 27 17:09:07 2015
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: TEST (DBID=2168949517)
connected to recovery catalog database
RMAN> transport tablespace "TSPITR","TEST" tablespace destination '/u02/transport' auxiliary destination '/u02/transport' until scn 1167731;
Creating automatic instance, with SID='kayd'
initialization parameters used for automatic instance:
db_name=TEST
compatible=10.2.0.5.0
db_block_size=8192
db_files=200
db_unique_name=tspitr_TEST_kayd
sga_target=180M
processes=50
#No auxiliary parameter file used
db_create_file_dest=/u02/transport
control_files=/u02/transport/cntrl_tspitr_TEST_kayd.f
starting up automatic instance TEST
Oracle instance started
Total System Global Area 188743680 bytes
Fixed Size 1272720 bytes
Variable Size 62915696 bytes
Database Buffers 121634816 bytes
Redo Buffers 2920448 bytes
Automatic instance created
contents of Memory Script:
{
# set the until clause
set until scn 1167731;
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log for tspitr to a resent until time
sql 'alter system archive log current';
# avoid unnecessary autobackups for structural changes during TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
# resync catalog after controlfile restore
resync catalog;
}
executing Memory Script
executing command: SET until clause
Starting restore at 27-MAR-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=47 devtype=DISK
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /u02/c-2168949517-20150326-07
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/u02/c-2168949517-20150326-07 tag=TAG20150326T203351
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output filename=/u02/transport/cntrl_tspitr_TEST_kayd.f
Finished restore at 27-MAR-15
sql statement: alter database mount clone database
sql statement: alter system archive log current
sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;
starting full resync of recovery catalog
full resync complete
contents of Memory Script:
{
# generated tablespace point-in-time recovery script
# set the until clause
set until scn 1167731;
# set an omf destination filename for restore
set newname for clone datafile 1 to new;
# set an omf destination filename for restore
set newname for clone datafile 2 to new;
# set an omf destination filename for restore
set newname for clone datafile 3 to new;
# set an omf destination tempfile
set newname for clone tempfile 1 to new;
# set a destination filename for restore
set newname for datafile 6 to
"/u02/transport/tspitr01.dbf";
# set a destination filename for restore
set newname for datafile 7 to
"/u02/transport/test01.dbf";
# rename all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set plus the auxilliary tablespaces
restore clone datafile 1, 2, 3, 6, 7;
switch clone datafile all;
#online the datafiles restored or flipped
sql clone "alter database datafile 1 online";
#online the datafiles restored or flipped
sql clone "alter database datafile 2 online";
#online the datafiles restored or flipped
sql clone "alter database datafile 3 online";
#online the datafiles restored or flipped
sql clone "alter database datafile 6 online";
#online the datafiles restored or flipped
sql clone "alter database datafile 7 online";
# make the controlfile point at the restored datafiles, then recover them
recover clone database tablespace "TSPITR", "TEST", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog;
alter clone database open resetlogs;
# PLUG HERE the creation of a temporary tablespace if export fails due to lack
# of temporary space.
# For example in Unix these two lines would do that:
#sql clone "create tablespace aux_tspitr_tmp
# datafile ''/tmp/aux_tspitr_tmp.dbf'' size 500K";
}
executing Memory Script
executing command: SET until clause
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 temporary file 1 to /u02/transport/TSPITR_TEST_KAYD/datafile/o1_mf_temp_%u_.tmp in control file
Starting restore at 27-MAR-15
using channel ORA_AUX_DISK_1