RMAN使用备份传输表空间的各种自定义操作(五)

2015-04-07 14:09:47 · 作者: · 浏览: 141
: Ckp SCN: 1145329? ? ? Ckp time: 2015-03-26 20:33:51
? SPFILE Included: Modification time: 2015-03-26 19:31:13


?


4.创建一个数据库目录对象用来执行Data Pump导出
SQL> create or replace directory test_dump as '/u02/dump_test';


Directory created.


SQL> grant read,write on directory test_dump to public;


Grant succeeded.


RMAN> transport tablespace "TSPITR","TEST"
tablespace destination '/u02/transport'
auxiliary destination '/u02/transport'
2> 3> 4> datapump directory test_dump
5> dump file 'test.dmp'
6> import script 'importtest.sql'
7> export log 'testexport.log';



Creating automatic instance, with SID='meiB'


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_meiB
sga_target=180M
processes=50
#No auxiliary parameter file used
db_create_file_dest=/u02/transport
control_files=/u02/transport/cntrl_tspitr_TEST_meiB.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 1202258;
# 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 28-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:02
output filename=/u02/transport/cntrl_tspitr_TEST_meiB.f
Finished restore at 28-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 1202258;
# 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 flippe