删除oe用户的表:
SQL> drop table ORDER_ITEMS purge;
恢复语法:
recover table OE.ORDER_ITEMS OF PLUGGABLE DATABASE PDBPROD1 UNTIL SEQUENCE 172 AUXILIARY DESTINATION '/tmp/backups';
恢复过程记录:
[oracle@host01 ~]$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jun 11 10:34:29 2017
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: PRODCDB (DBID=2891862819)
RMAN> recover table OE.ORDER_ITEMS OF PLUGGABLE DATABASE PDBPROD1 UNTIL SEQUENCE 172 AUXILIARY DESTINATION '/tmp/backups';
Starting recover at 11-JUN-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 device type=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='zncp'
initialization parameters used for automatic instance:
db_name=PRODCDB
db_unique_name=zncp_pitr_PDBPROD1_PRODCDB
compatible=12.1.0.2.0
db_block_size=8192
db_files=200
diagnostic_dest=/u01/app/oracle
_system_trig_enabled=FALSE
db_domain=example.com
sga_target=800M
processes=200
db_create_file_dest=/tmp/backups
log_archive_dest_1='location=/tmp/backups'
enable_pluggable_database=true
_clone_one_pdb_recovery=true
#No auxiliary parameter file used
starting up automatic instance PRODCDB
Oracle instance started
Total System Global Area 838860800 bytes
Fixed Size 2929936 bytes
Variable Size 230689520 bytes
Database Buffers 599785472 bytes
Redo Buffers 5455872 bytes
Automatic instance created
contents of Memory Script:
{
# set requested point in time
set until logseq 172 thread 1;
# 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';
}
executing Memory Script
executing command: SET until clause
Starting restore at 11-JUN-17
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=12 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
bkp
170611T093429
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/tmp/backups/PRODCDB/controlfile/o1_mf_dmsc24vw_.ctl
Finished restore at 11-JUN-17
sql statement: alter database mount clone database
sql statement: alter system archive log current
contents of Memory Script:
{
# set requested point in time
set until logseq 172 thread 1;
# set destinations for recovery set and auxiliary set datafiles
set newname for clone datafile 1 to new;
set newname for clone datafile 5 to new;
set newname for clone datafile 3 to new;
set newname for clone datafile 7 to new;
set newname for clone datafile 8 to new;
set newname for clone tempfile 1 to new;
set newname for clone tempfile 3 to new;
# switch all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile 1, 5, 3, 7, 8;
switch clone datafile all;
}
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
executing command: SET NEWNAME
renamed tempfile 1 to /tmp/backups/PRODCDB/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 3 to /tmp/backups/PRODCDB/datafile/o1_mf_temp_%u_.tmp in control file
Starting restore at 11-JUN-17
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 00001 to /tmp/backups/PRODCDB/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005 to /tmp/backups/PRODCDB/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /tmp/backups/PRODCDB/datafile/o1_mf_sysaux_%u_.dbf
7_dms79643_.bkp
kp tag=TAG20170611T093007
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 00007 to /tmp/backups/PRODCDB/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00008 to /tmp/backups/PRODCDB/datafile/o1_mf_sysaux_%u_.dbf
_11/o1_mf_nnndf_TAG20170611T093332_dms7hfxj_.bkp
df_TAG20170611T093332_dms7hfxj_.bkp tag=TAG20170611T093332
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 11-JUN-17
datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=946377361 file name=/tmp/backups/PRODCDB/datafile/o1_mf_system_dmsc2c83_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=946377361 file name=/tmp/backups/PRODCDB/datafile/o1_mf_undotbs1_dmsc2c8r_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=946377361 file name=/tmp/backups/PRODCDB/datafile/o1_mf_sysaux_dmsc2c9g_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=9 STAMP=946377361 file name=/tmp/backups/PRODCDB/datafile/o1_mf_system_dmsc3rbc_.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=10 STAMP=946377361 file name=/tmp/backups/PRODCDB/datafile/o1_mf_sysaux_dmsc3r97_.dbf
contents of Memory Script:
{
# set requested point in time
set until logseq 172 thread 1;
# online the datafiles restored or switched
sql clone "alter database datafile 1 online";
sql clone "alter database datafile 5 online";
sql clone "alter database datafile 3 online";
sql clone 'PDBPROD1' "alter database datafile
7 online";
sql clone 'PDBPROD1' "alter database datafile
8 online";
# recover and open database read only
recover clone database tablespace "SYSTEM", "UNDOTBS1", "SYSAUX", "PDBPROD1":"SYSTEM", "PDBPROD1":"SYSAUX";
sql clone 'alter database open read only';
}
executing Memory Script
executing command: SET until clause
sql statement: alter database datafile 1 online
sql statement: alter database datafile 5 online
sql statement: alter database datafile 3 online
sql statement: alter database datafile 7 online
sql statement: alter database datafile 8 online
Starting recover at 11-JUN-17
using channel ORA_AUX_DISK_1
starting media recovery
_168_dms7lyrk_.arc
_169_dms7sf40_.arc
_170_dms994bn_.arc
_171_dms99wg9_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_168_dms7lyrk_.arc thread=1 sequence=168
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_169_dms7sf40_.arc thread=1 sequence=169
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_170_dms994bn_.arc thread=1 sequence=170
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_171_dms99wg9_.arc thread=1 sequence=171
media recovery complete, elapsed time: 00:00:04
Finished recover at 11-JUN-17
sql statement: alter database open read only
contents of Memory Script:
{
sql clone 'alter pluggable database PDBPROD1 open read only';
}
executing Memory Script
sql statement: alter pluggable database PDBPROD1 open read only
contents of Memory Script:
{
sql clone "create spfile from memory";
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set control_files =
''/tmp/backups/PRODCDB/controlfile/o1_mf_dmsc24vw_.ctl'' comment=
''RMAN set'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
# mount database
sql clone 'alter database mount clone database';
}
executing Memory Script
sql statement: create spfile from memory
database closed
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 838860800 bytes
Fixed Size 2929936 bytes
Variable Size 230689520 bytes
Database Buffers 599785472 bytes
Redo Buffers 5455872 bytes
sql statement: alter system set control_files = ''/tmp/backups/PRODCDB/controlfile/o1_mf_dmsc24vw_.ctl'' comment= ''RMAN set'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 838860800 bytes
Fixed Size 2929936 bytes
Variable Size 230689520 bytes
Database Buffers 599785472 bytes
Redo Buffers 5455872 bytes
sql statement: alter database mount clone database
contents of Memory Script:
{
# set requested point in time
set until logseq 172 thread 1;
# set destinations for recovery set and auxiliary set datafiles
set newname for datafile 13 to new;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile 13;
switch clone datafile all;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
Starting restore at 11-JUN-17
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=12 device type=DISK
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 00013 to /tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/datafile/o1_mf_example_%u_.dbf
_11/o1_mf_nnndf_TAG20170611T093332_dms7hfxj_.bkp
df_TAG20170611T093332_dms7hfxj_.bkp tag=TAG20170611T093332
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 11-JUN-17
datafile 13 switched to datafile copy
input datafile copy RECID=12 STAMP=946377437 file name=/tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/datafile/o1_mf_example_dmsc6gt9_.dbf
contents of Memory Script:
{
# set requested point in time
set until logseq 172 thread 1;
# online the datafiles restored or switched
sql clone 'PDBPROD1' "alter database datafile
13 online";
# recover and open resetlogs
elog;
alter clone database open resetlogs;
}
executing Memory Script
executing command: SET until clause
sql statement: alter database datafile 13 online
Starting recover at 11-JUN-17
using channel ORA_AUX_DISK_1
starting media recovery
_170_dms994bn_.arc
_171_dms99wg9_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_170_dms994bn_.arc thread=1 sequence=170
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_171_dms99wg9_.arc thread=1 sequence=171
media recovery complete, elapsed time: 00:00:01
Finished recover at 11-JUN-17
database opened
contents of Memory Script:
{
sql clone 'alter pluggable database PDBPROD1 open';
}
executing Memory Script
sql statement: alter pluggable database PDBPROD1 open
contents of Memory Script:
{
# create directory for datapump import
sql 'PDBPROD1' "create or replace directory
TSPITR_DIROBJ_DPDIR as ''
/tmp/backups''";
# create directory for datapump export
sql clone 'PDBPROD1' "create or replace directory
TSPITR_DIROBJ_DPDIR as ''
/tmp/backups''";
}
executing Memory Script
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp/backups''
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp/backups''
Performing export of tables...
EXPDP> Starting "SYS"."TSPITR_EXP_zncp_Ctqn":
EXPDP> Estimate in progress using BLOCKS method...
EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
EXPDP> Total estimation using BLOCKS method: 64 KB
EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE
EXPDP> Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
EXPDP> Processing object type TABLE_EXPORT/TABLE/COMMENT
EXPDP> Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
EXPDP> Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
EXPDP> Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
EXPDP> Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
EXPDP> Processing object type TABLE_EXPORT/TABLE/TRIGGER
EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
EXPDP> . . exported "OE"."ORDER_ITEMS" 21.01 KB 665 rows
EXPDP> Master table "SYS"."TSPITR_EXP_zncp_Ctqn" successfully loaded/unloaded
EXPDP> ******************************************************************************
EXPDP> Dump file set for SYS.TSPITR_EXP_zncp_Ctqn is:
EXPDP> /tmp/backups/tspitr_zncp_46427.dmp
EXPDP> Job "SYS"."TSPITR_EXP_zncp_Ctqn" successfully completed at Sun Jun 11 10:38:27 2017 elapsed 0 00:00:26
Export completed
contents of Memory Script:
{
# shutdown clone before import
shutdown clone abort
}
executing Memory Script
Oracle instance shut down
Performing import of tables...
IMPDP> Master table "SYS"."TSPITR_IMP_zncp_syjv" successfully loaded/unloaded
IMPDP> Starting "SYS"."TSPITR_IMP_zncp_syjv":
IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE
IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
IMPDP> . . imported "OE"."ORDER_ITEMS" 21.01 KB 665 rows
IMPDP> Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
IMPDP> Processing object type TABLE_EXPORT/TABLE/COMMENT
IMPDP> Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
IMPDP> Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
IMPDP> Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
IMPDP> Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
IMPDP> Processing object type TABLE_EXPORT/TABLE/TRIGGER
IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
IMPDP> Job "SYS"."TSPITR_IMP_zncp_syjv" successfully completed at Sun Jun 11 10:39:06 2017 elapsed 0 00:00:29
Import completed
Removing automatic instance
Automatic instance removed
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_temp_dmsc4xvf_.tmp deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_temp_dmsc4rmm_.tmp deleted
auxiliary instance file /tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/onlinelog/o1_mf_3_dmsc720l_.log deleted
auxiliary instance file /tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/onlinelog/o1_mf_2_dmsc71j3_.log deleted
auxiliary instance file /tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/onlinelog/o1_mf_1_dmsc710r_.log deleted
auxiliary instance file /tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/datafile/o1_mf_example_dmsc6gt9_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_sysaux_dmsc3r97_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_system_dmsc3rbc_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_sysaux_dmsc2c9g_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_undotbs1_dmsc2c8r_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_system_dmsc2c83_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/controlfile/o1_mf_dmsc24vw_.ctl deleted
auxiliary instance file tspitr_zncp_46427.dmp deleted
Finished recover at 11-JUN-17
SQL> drop table ORDER_ITEMS purge;
恢复语法:
recover table OE.ORDER_ITEMS OF PLUGGABLE DATABASE PDBPROD1 UNTIL SEQUENCE 172 AUXILIARY DESTINATION '/tmp/backups';
恢复过程记录:
[oracle@host01 ~]$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jun 11 10:34:29 2017
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: PRODCDB (DBID=2891862819)
RMAN> recover table OE.ORDER_ITEMS OF PLUGGABLE DATABASE PDBPROD1 UNTIL SEQUENCE 172 AUXILIARY DESTINATION '/tmp/backups';
Starting recover at 11-JUN-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 device type=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='zncp'
initialization parameters used for automatic instance:
db_name=PRODCDB
db_unique_name=zncp_pitr_PDBPROD1_PRODCDB
compatible=12.1.0.2.0
db_block_size=8192
db_files=200
diagnostic_dest=/u01/app/oracle
_system_trig_enabled=FALSE
db_domain=example.com
sga_target=800M
processes=200
db_create_file_dest=/tmp/backups
log_archive_dest_1='location=/tmp/backups'
enable_pluggable_database=true
_clone_one_pdb_recovery=true
#No auxiliary parameter file used
starting up automatic instance PRODCDB
Oracle instance started
Total System Global Area 838860800 bytes
Fixed Size 2929936 bytes
Variable Size 230689520 bytes
Database Buffers 599785472 bytes
Redo Buffers 5455872 bytes
Automatic instance created
contents of Memory Script:
{
# set requested point in time
set until logseq 172 thread 1;
# 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';
}
executing Memory Script
executing command: SET until clause
Starting restore at 11-JUN-17
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=12 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
bkp
170611T093429
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/tmp/backups/PRODCDB/controlfile/o1_mf_dmsc24vw_.ctl
Finished restore at 11-JUN-17
sql statement: alter database mount clone database
sql statement: alter system archive log current
contents of Memory Script:
{
# set requested point in time
set until logseq 172 thread 1;
# set destinations for recovery set and auxiliary set datafiles
set newname for clone datafile 1 to new;
set newname for clone datafile 5 to new;
set newname for clone datafile 3 to new;
set newname for clone datafile 7 to new;
set newname for clone datafile 8 to new;
set newname for clone tempfile 1 to new;
set newname for clone tempfile 3 to new;
# switch all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile 1, 5, 3, 7, 8;
switch clone datafile all;
}
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
executing command: SET NEWNAME
renamed tempfile 1 to /tmp/backups/PRODCDB/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 3 to /tmp/backups/PRODCDB/datafile/o1_mf_temp_%u_.tmp in control file
Starting restore at 11-JUN-17
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 00001 to /tmp/backups/PRODCDB/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005 to /tmp/backups/PRODCDB/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /tmp/backups/PRODCDB/datafile/o1_mf_sysaux_%u_.dbf
7_dms79643_.bkp
kp tag=TAG20170611T093007
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 00007 to /tmp/backups/PRODCDB/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00008 to /tmp/backups/PRODCDB/datafile/o1_mf_sysaux_%u_.dbf
_11/o1_mf_nnndf_TAG20170611T093332_dms7hfxj_.bkp
df_TAG20170611T093332_dms7hfxj_.bkp tag=TAG20170611T093332
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 11-JUN-17
datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=946377361 file name=/tmp/backups/PRODCDB/datafile/o1_mf_system_dmsc2c83_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=946377361 file name=/tmp/backups/PRODCDB/datafile/o1_mf_undotbs1_dmsc2c8r_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=946377361 file name=/tmp/backups/PRODCDB/datafile/o1_mf_sysaux_dmsc2c9g_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=9 STAMP=946377361 file name=/tmp/backups/PRODCDB/datafile/o1_mf_system_dmsc3rbc_.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=10 STAMP=946377361 file name=/tmp/backups/PRODCDB/datafile/o1_mf_sysaux_dmsc3r97_.dbf
contents of Memory Script:
{
# set requested point in time
set until logseq 172 thread 1;
# online the datafiles restored or switched
sql clone "alter database datafile 1 online";
sql clone "alter database datafile 5 online";
sql clone "alter database datafile 3 online";
sql clone 'PDBPROD1' "alter database datafile
7 online";
sql clone 'PDBPROD1' "alter database datafile
8 online";
# recover and open database read only
recover clone database tablespace "SYSTEM", "UNDOTBS1", "SYSAUX", "PDBPROD1":"SYSTEM", "PDBPROD1":"SYSAUX";
sql clone 'alter database open read only';
}
executing Memory Script
executing command: SET until clause
sql statement: alter database datafile 1 online
sql statement: alter database datafile 5 online
sql statement: alter database datafile 3 online
sql statement: alter database datafile 7 online
sql statement: alter database datafile 8 online
Starting recover at 11-JUN-17
using channel ORA_AUX_DISK_1
starting media recovery
_168_dms7lyrk_.arc
_169_dms7sf40_.arc
_170_dms994bn_.arc
_171_dms99wg9_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_168_dms7lyrk_.arc thread=1 sequence=168
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_169_dms7sf40_.arc thread=1 sequence=169
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_170_dms994bn_.arc thread=1 sequence=170
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_171_dms99wg9_.arc thread=1 sequence=171
media recovery complete, elapsed time: 00:00:04
Finished recover at 11-JUN-17
sql statement: alter database open read only
contents of Memory Script:
{
sql clone 'alter pluggable database PDBPROD1 open read only';
}
executing Memory Script
sql statement: alter pluggable database PDBPROD1 open read only
contents of Memory Script:
{
sql clone "create spfile from memory";
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set control_files =
''/tmp/backups/PRODCDB/controlfile/o1_mf_dmsc24vw_.ctl'' comment=
''RMAN set'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
# mount database
sql clone 'alter database mount clone database';
}
executing Memory Script
sql statement: create spfile from memory
database closed
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 838860800 bytes
Fixed Size 2929936 bytes
Variable Size 230689520 bytes
Database Buffers 599785472 bytes
Redo Buffers 5455872 bytes
sql statement: alter system set control_files = ''/tmp/backups/PRODCDB/controlfile/o1_mf_dmsc24vw_.ctl'' comment= ''RMAN set'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 838860800 bytes
Fixed Size 2929936 bytes
Variable Size 230689520 bytes
Database Buffers 599785472 bytes
Redo Buffers 5455872 bytes
sql statement: alter database mount clone database
contents of Memory Script:
{
# set requested point in time
set until logseq 172 thread 1;
# set destinations for recovery set and auxiliary set datafiles
set newname for datafile 13 to new;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile 13;
switch clone datafile all;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
Starting restore at 11-JUN-17
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=12 device type=DISK
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 00013 to /tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/datafile/o1_mf_example_%u_.dbf
_11/o1_mf_nnndf_TAG20170611T093332_dms7hfxj_.bkp
df_TAG20170611T093332_dms7hfxj_.bkp tag=TAG20170611T093332
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 11-JUN-17
datafile 13 switched to datafile copy
input datafile copy RECID=12 STAMP=946377437 file name=/tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/datafile/o1_mf_example_dmsc6gt9_.dbf
contents of Memory Script:
{
# set requested point in time
set until logseq 172 thread 1;
# online the datafiles restored or switched
sql clone 'PDBPROD1' "alter database datafile
13 online";
# recover and open resetlogs
elog;
alter clone database open resetlogs;
}
executing Memory Script
executing command: SET until clause
sql statement: alter database datafile 13 online
Starting recover at 11-JUN-17
using channel ORA_AUX_DISK_1
starting media recovery
_170_dms994bn_.arc
_171_dms99wg9_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_170_dms994bn_.arc thread=1 sequence=170
archived log file name=/u01/app/oracle/fast_recovery_area/PRODCDB/archivelog/2017_06_11/o1_mf_1_171_dms99wg9_.arc thread=1 sequence=171
media recovery complete, elapsed time: 00:00:01
Finished recover at 11-JUN-17
database opened
contents of Memory Script:
{
sql clone 'alter pluggable database PDBPROD1 open';
}
executing Memory Script
sql statement: alter pluggable database PDBPROD1 open
contents of Memory Script:
{
# create directory for datapump import
sql 'PDBPROD1' "create or replace directory
TSPITR_DIROBJ_DPDIR as ''
/tmp/backups''";
# create directory for datapump export
sql clone 'PDBPROD1' "create or replace directory
TSPITR_DIROBJ_DPDIR as ''
/tmp/backups''";
}
executing Memory Script
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp/backups''
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/tmp/backups''
Performing export of tables...
EXPDP> Starting "SYS"."TSPITR_EXP_zncp_Ctqn":
EXPDP> Estimate in progress using BLOCKS method...
EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
EXPDP> Total estimation using BLOCKS method: 64 KB
EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE
EXPDP> Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
EXPDP> Processing object type TABLE_EXPORT/TABLE/COMMENT
EXPDP> Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
EXPDP> Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
EXPDP> Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
EXPDP> Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
EXPDP> Processing object type TABLE_EXPORT/TABLE/TRIGGER
EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
EXPDP> . . exported "OE"."ORDER_ITEMS" 21.01 KB 665 rows
EXPDP> Master table "SYS"."TSPITR_EXP_zncp_Ctqn" successfully loaded/unloaded
EXPDP> ******************************************************************************
EXPDP> Dump file set for SYS.TSPITR_EXP_zncp_Ctqn is:
EXPDP> /tmp/backups/tspitr_zncp_46427.dmp
EXPDP> Job "SYS"."TSPITR_EXP_zncp_Ctqn" successfully completed at Sun Jun 11 10:38:27 2017 elapsed 0 00:00:26
Export completed
contents of Memory Script:
{
# shutdown clone before import
shutdown clone abort
}
executing Memory Script
Oracle instance shut down
Performing import of tables...
IMPDP> Master table "SYS"."TSPITR_IMP_zncp_syjv" successfully loaded/unloaded
IMPDP> Starting "SYS"."TSPITR_IMP_zncp_syjv":
IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE
IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
IMPDP> . . imported "OE"."ORDER_ITEMS" 21.01 KB 665 rows
IMPDP> Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
IMPDP> Processing object type TABLE_EXPORT/TABLE/COMMENT
IMPDP> Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
IMPDP> Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
IMPDP> Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
IMPDP> Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
IMPDP> Processing object type TABLE_EXPORT/TABLE/TRIGGER
IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
IMPDP> Job "SYS"."TSPITR_IMP_zncp_syjv" successfully completed at Sun Jun 11 10:39:06 2017 elapsed 0 00:00:29
Import completed
Removing automatic instance
Automatic instance removed
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_temp_dmsc4xvf_.tmp deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_temp_dmsc4rmm_.tmp deleted
auxiliary instance file /tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/onlinelog/o1_mf_3_dmsc720l_.log deleted
auxiliary instance file /tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/onlinelog/o1_mf_2_dmsc71j3_.log deleted
auxiliary instance file /tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/onlinelog/o1_mf_1_dmsc710r_.log deleted
auxiliary instance file /tmp/backups/ZNCP_PITR_PDBPROD1_PRODCDB/datafile/o1_mf_example_dmsc6gt9_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_sysaux_dmsc3r97_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_system_dmsc3rbc_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_sysaux_dmsc2c9g_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_undotbs1_dmsc2c8r_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/datafile/o1_mf_system_dmsc2c83_.dbf deleted
auxiliary instance file /tmp/backups/PRODCDB/controlfile/o1_mf_dmsc24vw_.ctl deleted
auxiliary instance file tspitr_zncp_46427.dmp deleted
Finished recover at 11-JUN-17
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20747382/viewspace-2140583/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/20747382/viewspace-2140583/