Oracle 12c 新特性 --- RMAN实现表级恢复时可以将表remap 至新SCHEMA

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/leo__1990/article/details/90179656

概念

The Oracle Recovery Manager (RMAN) table recovery feature offers REMAP TABLE and REMAP TABLESPACE options. The REMAP TABLE option is followed by a list of logical objects to be remapped with their new names. It can be used to rename entire tables or to rename table partitions. The REMAP TABLESPACE option, similarly, remaps all of the specified objects in the existing tablespace into a new one. These options, however, do not offer the flexibility of cross-schema table recovery. This feature adds the REMAP SCHEMA option to the RECOVER TABLE command, which is then passed to the Oracle Data Pump import operation. This feature allows a list of tables and table partitions to be recovered to an alternative schema other than the original schema of the table.
Oracle 12c R2 新特性可以将表还原到新的SCHEMA中
This feature adds more flexibility to import or recover tables across different schemas, which provides more freedom to users and may also provide a better understanding of table-related indexes, triggers, constraints, and so on, if these object names are already existing under the same schema.

Recovering tables or table partitions into a different schema enables you to avoid name conflicts that may be caused by constraint, index, or trigger names that already existing in the source schema.

Starting with Oracle Database 12c Release 2 (12.2), you can recover tables or table partitions into a schema that is different from the source schema (the schema in which they originally existed). While recovering objects into a different schema, you can either retain their original names or rename them. You can rename tables and remap the schema in a single recovery operation. For example, you can recover the HR.EMPLOYEES table either into the NEW_HR.EMPLOYEES table, the HR.NEW_EMPLOYEES table, or the NEW_HR.NEW_EMPLOYEES table. The REMAP TABLE clause enables you to rename objects and recover them into a different schema.

During table recovery, use the REMAP TABLE clause of the RECOVER TABLE command to map the source schema to a new schema. The new schema must exist in the target database before you perform the recovery.
新SCHEMA 必须已经存在。

实验

1)准备数据,创建用户test 用户及表,并创建新用用户test2
CREATE TABLESPACE test
  DATAFILE '/u01/app/oracle/oradata/cndba/pdbcndba/test01.dbf'
  SIZE 1M AUTOEXTEND ON NEXT 1M;

CREATE USER test IDENTIFIED BY test
  DEFAULT TABLESPACE test
  QUOTA UNLIMITED ON test;
  
SQL>  CREATE USER test IDENTIFIED BY test
  QUOTA UNLIMITED ON users;
User created.

SQL>  GRANT CREATE SESSION, CREATE TABLE,unlimited tablespace TO test;

Grant succeeded.

SQL> conn test/test@pdbcndba
Connected.
SQL> CREATE TABLE t1 (id NUMBER);

Table created.

SQL> INSERT INTO t1 VALUES (1);

1 row created.

SQL> commit;

Commit complete.

SQL> INSERT INTO t1 VALUES (2);

1 row created.

SQL> commit;

Commit complete.

SQL> SELECT * FROM t1;

	ID
----------
	 1
	 2

SQL> conn /as sysdba
Connected.
SQL> alter session set container=pdbcndba;

Session altered.

SQL> CREATE USER test2 IDENTIFIED BY test2
  QUOTA UNLIMITED ON users;  2  

User created.

SQL> GRANT CREATE SESSION, CREATE TABLE,unlimited tablespace TO test2;

Grant succeeded.

2) 创建辅助AUXILIARY DESTINATION 目录全备数据库

[oracle@host1 ~]$ mkdir /u01/aux

[oracle@host1 ~]$ rman target / Recovery Manager: Release 12.2.0.1.0 - Production on Thu Aug 10 14:57:23 2017 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. connected to target database: CNDBA (DBID=215561032) RMAN> backup database; Starting backup at 10-AUG-17 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=66 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u01/app/oracle/oradata/cndba/system01.dbf input datafile file number=00003 name=/u01/app/oracle/oradata/cndba/sysaux01.dbf input datafile file number=00004 name=/u01/app/oracle/oradata/cndba/undotbs01.dbf input datafile file number=00007 name=/u01/app/oracle/oradata/cndba/users01.dbf channel ORA_DISK_1: starting piece 1 at 10-AUG-17 channel ORA_DISK_1: finished piece 1 at 10-AUG-17 piece handle=/u01/backup/0jsbieqr_1_1_CNDBA tag=TAG20170810T145731 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:02:35 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00010 name=/u01/app/oracle/oradata/cndba/pdbcndba/sysaux01.dbf input datafile file number=00009 name=/u01/app/oracle/oradata/cndba/pdbcndba/system01.dbf input datafile file number=00011 name=/u01/app/oracle/oradata/cndba/pdbcndba/undotbs01.dbf input datafile file number=00012 name=/u01/app/oracle/oradata/cndba/pdbcndba/users01.dbf channel ORA_DISK_1: starting piece 1 at 10-AUG-17 channel ORA_DISK_1: finished piece 1 at 10-AUG-17 piece handle=/u01/backup/0ksbievm_1_1_CNDBA tag=TAG20170810T145731 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00006 name=/u01/app/oracle/oradata/cndba/pdbseed/sysaux01.dbf input datafile file number=00005 name=/u01/app/oracle/oradata/cndba/pdbseed/system01.dbf input datafile file number=00008 name=/u01/app/oracle/oradata/cndba/pdbseed/undotbs01.dbf channel ORA_DISK_1: starting piece 1 at 10-AUG-17 channel ORA_DISK_1: finished piece 1 at 10-AUG-17 piece handle=/u01/backup/0lsbif1e_1_1_CNDBA tag=TAG20170810T145731 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05 Finished backup at 10-AUG-17 Starting Control File and SPFILE Autobackup at 10-AUG-17 piece handle=/u01/backup/conf_c-215561032-20170810-05 comment=NONE Finished Control File and SPFILE Autobackup at 10-AUG-17

3) 查询当前数据库的SCN ,在这个SCN 之后插入数据

SQL> conn /as sysdba

Connected. SQL> SELECT DBMS_FLASHBACK.get_system_change_number FROM dual; GET_SYSTEM_CHANGE_NUMBER ------------------------ 1697134 SQL> conn test/test@pdbcndba Connected. SQL> INSERT INTO t1 VALUES (3); 1 row created. SQL> commit; Commit complete.

4) 基于时间点的恢复,并remap schema,新schema 要先存在,才可以恢复到新schema,否则出现以下问题,因为 基于时间点还原表,是基于data dump 实现,从执行过程可以看到是先expdp 表然后在impdp 表

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_fuAh_rAbx" successfully loaded/unloaded IMPDP> Starting "SYS"."TSPITR_IMP_fuAh_rAbx": IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE IMPDP> ORA-39083: Object type TABLE:"TEST2"."T1_PREV" failed to create with error: ORA-01918: user 'TEST2' does not exist [oracle@host1 ~]$ rman target / Recovery Manager: Release 12.2.0.1.0 - Production on Thu Aug 10 15:50:40 2017 Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved. connected to target database: CNDBA (DBID=215561032) RMAN> RECOVER TABLE 'TEST'.'T1' OF PLUGGABLE DATABASE pdbcndba UNTIL SCN 1697134 AUXILIARY DESTINATION '/u01/aux' REMAP TABLE 'TEST'.'T1':'TEST2'.'T1_PREV';2> 3> 4> Starting recover at 10-AUG-17 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=71 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 PDBCNDBA:SYSTEM Tablespace UNDOTBS1 Tablespace PDBCNDBA:UNDOTBS1 Creating automatic instance, with SID='qBsp' initialization parameters used for automatic instance: db_name=CNDBA db_unique_name=qBsp_pitr_pdbcndba_CNDBA compatible=12.2.0 db_block_size=8192 db_files=200 diagnostic_dest=/u01/app/oracle _system_trig_enabled=FALSE sga_target=1520M processes=200 db_create_file_dest=/u01/aux log_archive_dest_1='location=/u01/aux' enable_pluggable_database=true _clone_one_pdb_recovery=true #No auxiliary parameter file used starting up automatic instance CNDBA Oracle instance started Total System Global Area 1593835520 bytes Fixed Size 8793256 bytes Variable Size 402654040 bytes Database Buffers 1174405120 bytes Redo Buffers 7983104 bytes Automatic instance created contents of Memory Script: { # set requested point in time set until scn 1697134; # 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 10-AUG-17 allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=35 device type=DISK channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: restoring control file channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/conf_c-215561032-20170810-05 channel ORA_AUX_DISK_1: piece handle=/u01/backup/conf_c-215561032-20170810-05 tag=TAG20170810T150207 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03 output file name=/u01/aux/CNDBA/controlfile/o1_mf_drr435z4_.ctl Finished restore at 10-AUG-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 scn 1697134; # set destinations for recovery set and auxiliary set datafiles set newname for clone datafile 1 to new; set newname for clone datafile 9 to new; set newname for clone datafile 4 to new; set newname for clone datafile 11 to new; set newname for clone datafile 3 to new; set newname for clone datafile 10 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, 9, 4, 11, 3, 10; 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 executing command: SET NEWNAME renamed tempfile 1 to /u01/aux/CNDBA/datafile/o1_mf_temp_%u_.tmp in control file renamed tempfile 3 to /u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_temp_%u_.tmp in control file Starting restore at 10-AUG-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 /u01/aux/CNDBA/datafile/o1_mf_system_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/aux/CNDBA/datafile/o1_mf_undotbs1_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/aux/CNDBA/datafile/o1_mf_sysaux_%u_.dbf channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/0jsbieqr_1_1_CNDBA channel ORA_AUX_DISK_1: piece handle=/u01/backup/0jsbieqr_1_1_CNDBA tag=TAG20170810T145731 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:57 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 00009 to /u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_system_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00011 to /u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_undotbs1_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00010 to /u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_sysaux_%u_.dbf channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/0ksbievm_1_1_CNDBA channel ORA_AUX_DISK_1: piece handle=/u01/backup/0ksbievm_1_1_CNDBA tag=TAG20170810T145731 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35 Finished restore at 10-AUG-17 datafile 1 switched to datafile copy input datafile copy RECID=14 STAMP=951666827 file name=/u01/aux/CNDBA/datafile/o1_mf_system_drr43jwv_.dbf datafile 9 switched to datafile copy input datafile copy RECID=15 STAMP=951666827 file name=/u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_system_drr476q3_.dbf datafile 4 switched to datafile copy input datafile copy RECID=16 STAMP=951666827 file name=/u01/aux/CNDBA/datafile/o1_mf_undotbs1_drr43jyt_.dbf datafile 11 switched to datafile copy input datafile copy RECID=17 STAMP=951666827 file name=/u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_undotbs1_drr476q7_.dbf datafile 3 switched to datafile copy input datafile copy RECID=18 STAMP=951666827 file name=/u01/aux/CNDBA/datafile/o1_mf_sysaux_drr43jyq_.dbf datafile 10 switched to datafile copy input datafile copy RECID=19 STAMP=951666827 file name=/u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_sysaux_drr476pz_.dbf contents of Memory Script: { # set requested point in time set until scn 1697134; # online the datafiles restored or switched sql clone "alter database datafile 1 online"; sql clone 'PDBCNDBA' "alter database datafile 9 online"; sql clone "alter database datafile 4 online"; sql clone 'PDBCNDBA' "alter database datafile 11 online"; sql clone "alter database datafile 3 online"; sql clone 'PDBCNDBA' "alter database datafile 10 online"; # recover and open database read only recover clone database tablespace "SYSTEM", "PDBCNDBA":"SYSTEM", "UNDOTBS1", "PDBCNDBA":"UNDOTBS1", "SYSAUX", "PDBCNDBA":"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 9 online sql statement: alter database datafile 4 online sql statement: alter database datafile 11 online sql statement: alter database datafile 3 online sql statement: alter database datafile 10 online Starting recover at 10-AUG-17 using channel ORA_AUX_DISK_1 starting media recovery archived log for thread 1 with sequence 5 is already on disk as file /u01/app/oracle/product/12.2.0/db_1/dbs/arch1_5_951098251.dbf archived log file name=/u01/app/oracle/product/12.2.0/db_1/dbs/arch1_5_951098251.dbf thread=1 sequence=5 media recovery complete, elapsed time: 00:00:05 Finished recover at 10-AUG-17 sql statement: alter database open read only contents of Memory Script: { sql clone 'alter pluggable database PDBCNDBA open read only'; } executing Memory Script sql statement: alter pluggable database PDBCNDBA 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 = ''/u01/aux/CNDBA/controlfile/o1_mf_drr435z4_.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 1593835520 bytes Fixed Size 8793256 bytes Variable Size 402654040 bytes Database Buffers 1174405120 bytes Redo Buffers 7983104 bytes sql statement: alter system set control_files = ''/u01/aux/CNDBA/controlfile/o1_mf_drr435z4_.ctl'' comment= ''RMAN set'' scope=spfile Oracle instance shut down connected to auxiliary database (not started) Oracle instance started Total System Global Area 1593835520 bytes Fixed Size 8793256 bytes Variable Size 402654040 bytes Database Buffers 1174405120 bytes Redo Buffers 7983104 bytes sql statement: alter database mount clone database contents of Memory Script: { # set requested point in time set until scn 1697134; # set destinations for recovery set and auxiliary set datafiles set newname for datafile 12 to new; # restore the tablespaces in the recovery set and the auxiliary set restore clone datafile 12; switch clone datafile all; } executing Memory Script executing command: SET until clause executing command: SET NEWNAME Starting restore at 10-AUG-17 allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=35 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 00012 to /u01/aux/QBSP_PITR_PDBCNDBA_CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_users_%u_.dbf channel ORA_AUX_DISK_1: reading from backup piece /u01/backup/0ksbievm_1_1_CNDBA channel ORA_AUX_DISK_1: piece handle=/u01/backup/0ksbievm_1_1_CNDBA tag=TAG20170810T145731 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03 Finished restore at 10-AUG-17 datafile 12 switched to datafile copy input datafile copy RECID=21 STAMP=951666924 file name=/u01/aux/QBSP_PITR_PDBCNDBA_CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_users_drr4c9oh_.dbf contents of Memory Script: { # set requested point in time set until scn 1697134; # online the datafiles restored or switched sql clone 'PDBCNDBA' "alter database datafile 12 online"; # recover and open resetlogs recover clone database tablespace "PDBCNDBA":"USERS", "SYSTEM", "PDBCNDBA":"SYSTEM", "UNDOTBS1", "PDBCNDBA":"UNDOTBS1", "SYSAUX", "PDBCNDBA":"SYSAUX" delete archivelog; alter clone database open resetlogs; } executing Memory Script executing command: SET until clause sql statement: alter database datafile 12 online Starting recover at 10-AUG-17 using channel ORA_AUX_DISK_1 starting media recovery archived log for thread 1 with sequence 5 is already on disk as file /u01/app/oracle/product/12.2.0/db_1/dbs/arch1_5_951098251.dbf archived log file name=/u01/app/oracle/product/12.2.0/db_1/dbs/arch1_5_951098251.dbf thread=1 sequence=5 media recovery complete, elapsed time: 00:00:01 Finished recover at 10-AUG-17 database opened contents of Memory Script: { sql clone 'alter pluggable database PDBCNDBA open'; } executing Memory Script sql statement: alter pluggable database PDBCNDBA open contents of Memory Script: { # create directory for datapump import sql 'PDBCNDBA' "create or replace directory TSPITR_DIROBJ_DPDIR as '' /u01/aux''"; # create directory for datapump export sql clone 'PDBCNDBA' "create or replace directory TSPITR_DIROBJ_DPDIR as '' /u01/aux''"; } executing Memory Script sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/aux'' sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/aux'' Performing export of tables... EXPDP> Starting "SYS"."TSPITR_EXP_qBsp_kmwx": EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS EXPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER EXPDP> Processing object type TABLE_EXPORT/TABLE/TABLE EXPDP> . . exported "TEST"."T1" 5.054 KB 2 rows EXPDP> Master table "SYS"."TSPITR_EXP_qBsp_kmwx" successfully loaded/unloaded EXPDP> ****************************************************************************** EXPDP> Dump file set for SYS.TSPITR_EXP_qBsp_kmwx is: EXPDP> /u01/aux/tspitr_qBsp_25691.dmp EXPDP> Job "SYS"."TSPITR_EXP_qBsp_kmwx" successfully completed at Thu Aug 10 15:59:36 2017 elapsed 0 00:00:39 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_qBsp_twyl" successfully loaded/unloaded IMPDP> Starting "SYS"."TSPITR_IMP_qBsp_twyl": IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA IMPDP> . . imported "TEST2"."T1_PREV" 5.054 KB 2 rows IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER IMPDP> Job "SYS"."TSPITR_IMP_qBsp_twyl" successfully completed at Thu Aug 10 16:00:08 2017 elapsed 0 00:00:24 Import completed Removing automatic instance Automatic instance removed auxiliary instance file /u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_temp_drr496s8_.tmp deleted auxiliary instance file /u01/aux/CNDBA/datafile/o1_mf_temp_drr48qtd_.tmp deleted auxiliary instance file /u01/aux/QBSP_PITR_PDBCNDBA_CNDBA/onlinelog/o1_mf_3_drr4dg7k_.log deleted auxiliary instance file /u01/aux/QBSP_PITR_PDBCNDBA_CNDBA/onlinelog/o1_mf_2_drr4cjrm_.log deleted auxiliary instance file /u01/aux/QBSP_PITR_PDBCNDBA_CNDBA/onlinelog/o1_mf_1_drr4cjrl_.log deleted auxiliary instance file /u01/aux/QBSP_PITR_PDBCNDBA_CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_users_drr4c9oh_.dbf deleted auxiliary instance file /u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_sysaux_drr476pz_.dbf deleted auxiliary instance file /u01/aux/CNDBA/datafile/o1_mf_sysaux_drr43jyq_.dbf deleted auxiliary instance file /u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_undotbs1_drr476q7_.dbf deleted auxiliary instance file /u01/aux/CNDBA/datafile/o1_mf_undotbs1_drr43jyt_.dbf deleted auxiliary instance file /u01/aux/CNDBA/55DE454E1CE24B30E055BABBBA18D4BF/datafile/o1_mf_system_drr476q3_.dbf deleted auxiliary instance file /u01/aux/CNDBA/datafile/o1_mf_system_drr43jwv_.dbf deleted auxiliary instance file /u01/aux/CNDBA/controlfile/o1_mf_drr435z4_.ctl deleted auxiliary instance file tspitr_qBsp_25691.dmp deleted Finished recover at 10-AUG-17

5) 验证数据是否存在,可以看到SCN 1697134 之前的数据,而t1表是在SCN 1697134 之后插入一条,验证结果正确。

SQL> conn test2/test2@pdbcndba Connected. SQL> select *from T1_PREV; ID ---------- 1 2

SQL> conn test/test@pdbcndba Connected. SQL> select * from t1; ID ---------- 1 2 3

参考链接:

http://docs.oracle.com/database/122/BRADV/rman-recovering-tables-partitions.htm#BRADV-GUID-98525DD5-E08F-46F0-A9D8-A7EC3EB54457 

http://docs.oracle.com/database/122/BRADV/rman-recovering-tables-partitions.htm#BRADV695

http://docs.oracle.com/database/122/NEWFT/new-features.htm#NEWFT-GUID-4FBF3EB2-FCEB-410E-957D-DCB5D6FFC71F

猜你喜欢

转载自blog.csdn.net/leo__1990/article/details/90179656