[oracle@dbserver ~]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Fri May 9 18:27:07 2014
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1372923444)
RMAN> run { 2> recover tablespace ts_sztech until time "to_date('2014-05-09 18:16:09','yyyy-mm-dd hh24:mi:ss')" auxiliary destination '/home/oracle/auxiliary'; 3> }
下面部分,全部是自动完成,不再需要手工操作:
Starting recover at 09-MAY-14 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=133 devtype=DISK 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 UNDOTBS1
Creating automatic instance, with SID='aBAz'
initialization parameters used for automatic instance: db_name=ORCL compatible=10.2.0.5.0 db_block_size=8192 db_files=200 db_unique_name=tspitr_ORCL_aBAz sga_target=180M processes=50 #No auxiliary parameter file used db_create_file_dest=/home/oracle/auxiliary control_files=/home/oracle/auxiliary/cntrl_tspitr_ORCL_aBAz.f
starting up automatic instance ORCL
Oracle instance started
Total System Global Area 188743680 bytes
Fixed Size 1272696 bytes Variable Size 62915720 bytes Database Buffers 117440512 bytes Redo Buffers 7114752 bytes Automatic instance created
contents of Memory Script: { # set the until clause set until time "to_date('2014-05-09 18:16:09','yyyy-mm-dd hh24:mi:ss')"; # 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;'; } executing Memory Script
executing command: SET until clause
Starting restore at 09-MAY-14 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 /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2014_05_09/o1_mf_s_847131214_9psblhhh_.bkp channel ORA_AUX_DISK_1: restored backup piece 1 piece handle=/u01/app/oracle/flash_recovery_area/ORCL/autobackup/2014_05_09/o1_mf_s_847131214_9psblhhh_.bkp tag=TAG20140509T181334 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02 output filename=/home/oracle/auxiliary/cntrl_tspitr_ORCL_aBAz.f Finished restore at 09-MAY-14
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: { # generated tablespace point-in-time recovery script # set the until clause set until time "to_date('2014-05-09 18:16:09','yyyy-mm-dd hh24:mi:ss')"; plsql <<<-- tspitr_2 declare sqlstatement varchar2(512); offline_not_needed exception; pragma exception_init(offline_not_needed, -01539); begin sqlstatement := 'alter tablespace '|| 'TS_SZTECH' ||' offline for recover'; krmicd.writeMsg(6162, sqlstatement); krmicd.execSql(sqlstatement); exception when offline_not_needed then null; end; >>>; # 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 tempfile set newname for clone tempfile 1 to new; # set an omf destination tempfile set newname for clone tempfile 2 to new; # set an omf destination tempfile set newname for clone tempfile 3 to new; # set an omf destination tempfile set newname for clone tempfile 4 to new; # set an omf destination tempfile set newname for clone tempfile 5 to new; # set an omf destination tempfile set newname for clone tempfile 6 to new; # set an omf destination tempfile set newname for clone tempfile 7 to new; # set a destination filename for restore set newname for datafile 8 to "/u01/app/oracle/oradata/orcl/ts_sztech.dba"; # rename all tempfiles switch clone tempfile all; # restore the tablespaces in the recovery set plus the auxilliary tablespaces restore clone datafile 1, 2, 8; 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 8 online"; # make the controlfile point at the restored datafiles, then recover them recover clone database tablespace "TS_SZTECH", "SYSTEM", "UNDOTBS1" 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
sql statement: alter tablespace TS_SZTECH offline for recover
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
|