Oracle 12C使用RMAN将PDB中分表的多个分区恢复到新用户方案中

发布时间:2020-08-17 18:21:40 作者:eric0435
来源:ITPUB博客 阅读:171

Oracle 12C使用RMAN将PDB中分表的多个分区恢复到新用户方案中的操作如下
1.对整个CDB(jy)生成RMAN备份

[oracle@jytest1 ~]$ rman target/ catalog rco/abcd@jypdb_173

Recovery Manager: Release 12.2.0.1.0 - Production on Thu Jan 11 00:43:42 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: JY (DBID=979425723)
connected to recovery catalog database

RMAN> backup as compressed backupset database format '+test/rman_backup/%d_%I_%U_%t' plus archivelog format '+test/rman_backup/arc_%d_%T_%U';


Starting backup at 2018-01-11 00:43:49
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=393 instance=jy1 device type=DISK
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=2 sequence=70 RECID=184 STAMP=965090640
input archived log thread=1 sequence=95 RECID=183 STAMP=965090635
channel ORA_DISK_1: starting piece 1 at 2018-01-11 00:44:03
channel ORA_DISK_1: finished piece 1 at 2018-01-11 00:44:18
piece handle=+TEST/rman_backup/arc_jy_20180111_18soc7aj_1_1 tag=TAG20180111T004402 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 2018-01-11 00:44:18

Starting backup at 2018-01-11 00:44:18
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=+DATA/JY/DATAFILE/sysaux.298.962209605
input datafile file number=00001 name=+DATA/JY/DATAFILE/system.317.962209603
input datafile file number=00004 name=+DATA/JY/DATAFILE/undotbs1.277.962209605
input datafile file number=00009 name=+DATA/JY/DATAFILE/undotbs2.312.962209605
input datafile file number=00007 name=+DATA/JY/DATAFILE/users.301.962209605
channel ORA_DISK_1: starting piece 1 at 2018-01-11 00:44:20
channel ORA_DISK_1: finished piece 1 at 2018-01-11 00:46:05
piece handle=+TEST/rman_backup/jy_979425723_19soc7b4_1_1_965090660 tag=TAG20180111T004418 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:45
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00014 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649
input datafile file number=00011 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.962209649
input datafile file number=00010 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649
input datafile file number=00012 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.962209649
input datafile file number=00013 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.268.962209649
input datafile file number=00015 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.962210609
channel ORA_DISK_1: starting piece 1 at 2018-01-11 00:46:06
channel ORA_DISK_1: finished piece 1 at 2018-01-11 00:47:01
piece handle=+TEST/rman_backup/jy_979425723_1asoc7ee_1_1_965090766 tag=TAG20180111T004418 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00017 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409
input datafile file number=00016 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409
input datafile file number=00018 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409
input datafile file number=00019 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409
input datafile file number=00021 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409
input datafile file number=00020 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409
channel ORA_DISK_1: starting piece 1 at 2018-01-11 00:47:01
channel ORA_DISK_1: finished piece 1 at 2018-01-11 00:47:46
piece handle=+TEST/rman_backup/jy_979425723_1bsoc7g5_1_1_965090821 tag=TAG20180111T004418 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=+DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/sysaux.270.962209675
input datafile file number=00005 name=+DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/system.256.962209675
input datafile file number=00008 name=+DATA/JY/5F9AA264B21F3ED9E053AB828A0A6088/DATAFILE/undotbs1.296.962209675
channel ORA_DISK_1: starting piece 1 at 2018-01-11 00:47:47
channel ORA_DISK_1: finished piece 1 at 2018-01-11 00:48:32
piece handle=+TEST/rman_backup/jy_979425723_1csoc7hj_1_1_965090867 tag=TAG20180111T004418 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
Finished backup at 2018-01-11 00:48:32

Starting backup at 2018-01-11 00:48:32
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=96 RECID=185 STAMP=965090913
input archived log thread=2 sequence=71 RECID=186 STAMP=965090913
channel ORA_DISK_1: starting piece 1 at 2018-01-11 00:48:37
channel ORA_DISK_1: finished piece 1 at 2018-01-11 00:48:38
piece handle=+TEST/rman_backup/arc_jy_20180111_1dsoc7j5_1_1 tag=TAG20180111T004835 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2018-01-11 00:48:38

Starting Control File and SPFILE Autobackup at 2018-01-11 00:48:38
piece handle=+TEST/rman_backup/c-979425723-20180111-00 comment=NONE
Finished Control File and SPFILE Autobackup at 2018-01-11 00:48:46

2.在删除表sh.sales的SALES_Q3_1998与SALES_Q4_1998分区中的数据之前记录当前时间,在执行恢复时它们被用来指定恢复时间点

SQL>  alter session set nls_date_format='yyyy-mm-dd hh34:mi:ss';

Session altered.

SQL> select count(*) from sales partition(SALES_Q3_1998);

  COUNT(*)
----------
     50515

SQL> select count(*) from sales partition(SALES_Q4_1998);

  COUNT(*)
----------
     48874

SQL> select sysdate from dual;

SYSDATE
-------------------
2018-01-11 01:03:47

SQL> select current_scn   from v$database;

CURRENT_SCN
-----------
    8629695

SQL> delete from sales partition(SALES_Q3_1998);

50515 rows deleted.

SQL> delete from sales partition(SALES_Q4_1998);

48874 rows deleted.

SQL> commit;

Commit complete.

SQL> select count(*) from sales partition(SALES_Q3_1998);

  COUNT(*)
----------
         0

SQL> select count(*) from sales partition(SALES_Q4_1998);

  COUNT(*)
----------
         0

3.启动RMAN并使用有sysbacup或sysdba权限的用户连接到目标数据库

[oracle@jytest1 ~]$ export NLS_DATE_FORMAT='yyyy-mm-dd hh34:mi:ss'
[oracle@jytest1 ~]$ rman target/ catalog rco/abcd@jypdb_173

Recovery Manager: Release 12.2.0.1.0 - Production on Wed Jan 10 02:22:13 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1492772871)

4.通过使用recover table命令将要被恢复的表或表分区恢复到指定的时间点。 使用auxiliary destination子句(/run/recover辅助数据文件存储目录)与until scn来指定恢复时间点,并且在recover命令中使用子句dump file与datapump destination,指定包含被恢复表或表分区的导出dump文件的文件名(t_emp_recvr.dmp)与存储位置(/run/dump)。 使用remap table子句将分区SH.SALES:SALES_Q3_1998恢复成表JY.SALES_Q3_1998,分区 SH.SALES:SALES_Q4_1998恢复成表JY.SALES_Q4_1998使用remap tablespace子句将sh用户方案中的表分区从表空间users恢复到表空间test中

RMAN> run
2> {
3> recover table SH.SALES:SALES_Q3_1998, SH.SALES:SALES_Q4_1998 of pluggable database jypdb
4> until time '2018-01-11 01:03:47'
5> auxiliary destination '/run/recover'
6> datapump destination '/run/dump'
7> dump file 't_emp_recvr.dmp'
8> remap table SH.SALES:SALES_Q3_1998:JY.SALES_Q3_1998,SH.SALES:SALES_Q4_1998:JY.SALES_Q4_1998
9> remap tablespace 'USERS':'TEST';
10> }

Starting recover at 2018-01-11 01:46:51
using channel ORA_DISK_1

Creating automatic instance, with SID='lCEx'

initialization parameters used for automatic instance:
db_name=JY
db_unique_name=lCEx_pitr_jypdb_JY
compatible=12.2.0
db_block_size=8192
db_files=200
diagnostic_dest=/u01/app/oracle
_system_trig_enabled=FALSE
sga_target=2048M
processes=200
db_create_file_dest=/run/recover
log_archive_dest_1='location=/run/recover'
enable_pluggable_database=true
_clone_one_pdb_recovery=true
#No auxiliary parameter file used


starting up automatic instance JY

Oracle instance started

Total System Global Area    2147483648 bytes

Fixed Size                     8794848 bytes
Variable Size                553651488 bytes
Database Buffers            1577058304 bytes
Redo Buffers                   7979008 bytes
Automatic instance created

contents of Memory Script:
{
# set requested point in time
set until  time "2018-01-11 01:03:47";
# 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';
# resync catalog
resync catalog;
}
executing Memory Script

executing command: SET until clause

Starting restore at 2018-01-11 01:47:37
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=211 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 +TEST/rman_backup/c-979425723-20180111-00
channel ORA_AUX_DISK_1: piece handle=+TEST/rman_backup/c-979425723-20180111-00 tag=TAG20180111T004839
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:05
output file name=/run/recover/JY/controlfile/o1_mf_f5dnfy2z_.ctl
Finished restore at 2018-01-11 01:47:43

sql statement: alter database mount clone database

sql statement: alter system archive log current

starting full resync of recovery catalog
full resync complete

contents of Memory Script:
{
# set requested point in time
set until  time "2018-01-11 01:03:47";
# set destinations for recovery set and auxiliary set datafiles
set newname for clone datafile  10 to new;
set newname for clone datafile  1 to new;
set newname for clone datafile  12 to new;
set newname for clone datafile  4 to new;
set newname for clone datafile  13 to new;
set newname for clone datafile  9 to new;
set newname for clone datafile  3 to new;
set newname for clone datafile  11 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  10, 1, 12, 4, 13, 9, 3, 11;

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

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to /run/recover/JY/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 3 to /run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_temp_%u_.tmp in control file

Starting restore at 2018-01-11 01:47:55
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 /run/recover/JY/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /run/recover/JY/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00009 to /run/recover/JY/datafile/o1_mf_undotbs2_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /run/recover/JY/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece +TEST/rman_backup/jy_979425723_19soc7b4_1_1_965090660
channel ORA_AUX_DISK_1: piece handle=+TEST/rman_backup/jy_979425723_19soc7b4_1_1_965090660 tag=TAG20180111T004418
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:55
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 00010 to /run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00012 to /run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00013 to /run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_undo_2_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00011 to /run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece +TEST/rman_backup/jy_979425723_1asoc7ee_1_1_965090766
channel ORA_AUX_DISK_1: piece handle=+TEST/rman_backup/jy_979425723_1asoc7ee_1_1_965090766 tag=TAG20180111T004418
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 2018-01-11 01:50:35

datafile 10 switched to datafile copy
input datafile copy RECID=12 STAMP=965094635 file name=/run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_system_f5dnkync_.dbf
datafile 1 switched to datafile copy
input datafile copy RECID=13 STAMP=965094635 file name=/run/recover/JY/datafile/o1_mf_system_f5dngcjj_.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=14 STAMP=965094635 file name=/run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_undotbs1_f5dnkynd_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=15 STAMP=965094635 file name=/run/recover/JY/datafile/o1_mf_undotbs1_f5dngcjk_.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=16 STAMP=965094635 file name=/run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_undo_2_f5dnkynd_.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=17 STAMP=965094635 file name=/run/recover/JY/datafile/o1_mf_undotbs2_f5dngcjl_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=18 STAMP=965094635 file name=/run/recover/JY/datafile/o1_mf_sysaux_f5dngcjh_.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=19 STAMP=965094635 file name=/run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_sysaux_f5dnkynb_.dbf

contents of Memory Script:
{
# set requested point in time
set until  time "2018-01-11 01:03:47";
# online the datafiles restored or switched
sql clone 'JYPDB' "alter database datafile
 10 online";
sql clone "alter database datafile  1 online";
sql clone 'JYPDB' "alter database datafile
 12 online";
sql clone "alter database datafile  4 online";
sql clone 'JYPDB' "alter database datafile
 13 online";
sql clone "alter database datafile  9 online";
sql clone "alter database datafile  3 online";
sql clone 'JYPDB' "alter database datafile
 11 online";
# recover and open database read only
recover clone database tablespace  "JYPDB":"SYSTEM", "SYSTEM", "JYPDB":"UNDOTBS1", "UNDOTBS1", "JYPDB":"UNDO_2", "UNDOTBS2", "SYSAUX", "JYPDB":"SYSAUX";
sql clone 'alter database open read only';
}
executing Memory Script

executing command: SET until clause

sql statement: alter database datafile  10 online

sql statement: alter database datafile  1 online

sql statement: alter database datafile  12 online

sql statement: alter database datafile  4 online

sql statement: alter database datafile  13 online

sql statement: alter database datafile  9 online

sql statement: alter database datafile  3 online

sql statement: alter database datafile  11 online

Starting recover at 2018-01-11 01:50:36
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 96 is already on disk as file +TEST/arch/1_96_961976319.dbf
archived log for thread 1 with sequence 97 is already on disk as file +TEST/arch/1_97_961976319.dbf
archived log for thread 2 with sequence 71 is already on disk as file +TEST/arch/2_71_961976319.dbf
archived log for thread 2 with sequence 72 is already on disk as file +TEST/arch/2_72_961976319.dbf
archived log file name=+TEST/arch/1_96_961976319.dbf thread=1 sequence=96
archived log file name=+TEST/arch/2_71_961976319.dbf thread=2 sequence=71
archived log file name=+TEST/arch/1_97_961976319.dbf thread=1 sequence=97
archived log file name=+TEST/arch/2_72_961976319.dbf thread=2 sequence=72
media recovery complete, elapsed time: 00:00:01
Finished recover at 2018-01-11 01:50:39

sql statement: alter database open read only

contents of Memory Script:
{
sql clone 'alter pluggable database  JYPDB open read only';
}
executing Memory Script

sql statement: alter pluggable database  JYPDB 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 =
  ''/run/recover/JY/controlfile/o1_mf_f5dnfy2z_.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    2147483648 bytes

Fixed Size                     8794848 bytes
Variable Size                553651488 bytes
Database Buffers            1577058304 bytes
Redo Buffers                   7979008 bytes

sql statement: alter system set  control_files =   ''/run/recover/JY/controlfile/o1_mf_f5dnfy2z_.ctl'' comment= ''RMAN set'' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    2147483648 bytes

Fixed Size                     8794848 bytes
Variable Size                553651488 bytes
Database Buffers            1577058304 bytes
Redo Buffers                   7979008 bytes

sql statement: alter database mount clone database

contents of Memory Script:
{
# set requested point in time
set until  time "2018-01-11 01:03:47";
# set destinations for recovery set and auxiliary set datafiles
set newname for datafile  14 to new;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile  14;

switch clone datafile all;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

Starting restore at 2018-01-11 01:51:49
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=211 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 00014 to /run/recover/LCEX_PITR_JYPDB_JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece +TEST/rman_backup/jy_979425723_1asoc7ee_1_1_965090766
channel ORA_AUX_DISK_1: piece handle=+TEST/rman_backup/jy_979425723_1asoc7ee_1_1_965090766 tag=TAG20180111T004418
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:49
Finished restore at 2018-01-11 01:52:39

datafile 14 switched to datafile copy
input datafile copy RECID=21 STAMP=965094759 file name=/run/recover/LCEX_PITR_JYPDB_JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_users_f5dnot2n_.dbf

contents of Memory Script:
{
# set requested point in time
set until  time "2018-01-11 01:03:47";
# online the datafiles restored or switched
sql clone 'JYPDB' "alter database datafile
 14 online";
# recover and open resetlogs
recover clone database tablespace  "JYPDB":"USERS", "JYPDB":"SYSTEM", "SYSTEM", "JYPDB":"UNDOTBS1", "UNDOTBS1", "JYPDB":"UNDO_2", "UNDOTBS2", "SYSAUX", "JYPDB":"SYSAUX" delete archivelog;
alter clone database open resetlogs;
}
executing Memory Script

executing command: SET until clause

sql statement: alter database datafile  14 online

Starting recover at 2018-01-11 01:52:39
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 96 is already on disk as file +TEST/arch/1_96_961976319.dbf
archived log for thread 1 with sequence 97 is already on disk as file +TEST/arch/1_97_961976319.dbf
archived log for thread 2 with sequence 71 is already on disk as file +TEST/arch/2_71_961976319.dbf
archived log for thread 2 with sequence 72 is already on disk as file +TEST/arch/2_72_961976319.dbf
archived log file name=+TEST/arch/1_96_961976319.dbf thread=1 sequence=96
archived log file name=+TEST/arch/2_71_961976319.dbf thread=2 sequence=71
archived log file name=+TEST/arch/1_97_961976319.dbf thread=1 sequence=97
archived log file name=+TEST/arch/2_72_961976319.dbf thread=2 sequence=72
media recovery complete, elapsed time: 00:00:01
Finished recover at 2018-01-11 01:52:42

database opened

contents of Memory Script:
{
sql clone 'alter pluggable database  JYPDB open';
}
executing Memory Script

sql statement: alter pluggable database  JYPDB open

contents of Memory Script:
{
# create directory for datapump import
sql 'JYPDB' "create or replace directory
TSPITR_DIROBJ_DPDIR as ''
/run/dump''";
# create directory for datapump export
sql clone 'JYPDB' "create or replace directory
TSPITR_DIROBJ_DPDIR as ''
/run/dump''";
}
executing Memory Script

sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/run/dump''

sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/run/dump''

Performing export of tables...
   EXPDP> Starting "SYS"."TSPITR_EXP_lCEx_rDzp":
   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> Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
   EXPDP> Processing object type TABLE_EXPORT/TABLE/COMMENT
   EXPDP> . . exported "SH"."SALES":"SALES_Q3_1998"                1.634 MB   50515 rows
   EXPDP> . . exported "SH"."SALES":"SALES_Q4_1998"                1.581 MB   48874 rows
   EXPDP> Master table "SYS"."TSPITR_EXP_lCEx_rDzp" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TSPITR_EXP_lCEx_rDzp is:
   EXPDP>   /run/dump/t_emp_recvr.dmp
   EXPDP> Job "SYS"."TSPITR_EXP_lCEx_rDzp" successfully completed at Thu Jan 11 01:53:35 2018 elapsed 0 00:00:41
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_lCEx_pFDE" successfully loaded/unloaded
   IMPDP> Starting "SYS"."TSPITR_IMP_lCEx_pFDE":
   IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE
   IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
   IMPDP> . . imported "JY"."SALES_Q3_1998"                        1.634 MB   50515 rows
   IMPDP> . . imported "JY"."SALES_Q4_1998"                        1.581 MB   48874 rows
   IMPDP> Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
   IMPDP> ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-00942: table or view does not exist

Failing sql is:
GRANT SELECT ON "JY"."SALES" TO "BI"

   IMPDP> Processing object type TABLE_EXPORT/TABLE/COMMENT
   IMPDP> ORA-39083: Object type COMMENT failed to create with error:
ORA-00942: table or view does not exist

Failing sql is:
 COMMENT ON TABLE "JY"."SALES"  IS 'facts table, without a primary key; all rows are uniquely identified by the combination of all foreign keys'

ORA-39083: Object type COMMENT:"PROD_ID" failed to create with error:
ORA-00942: table or view does not exist

Failing sql is:
 COMMENT ON COLUMN "JY"."SALES"."PROD_ID" IS 'FK to the products dimension table'

ORA-39083: Object type COMMENT:"CUST_ID" failed to create with error:
ORA-00942: table or view does not exist

Failing sql is:
 COMMENT ON COLUMN "JY"."SALES"."CUST_ID" IS 'FK to the customers dimension table'

ORA-39083: Object type COMMENT:"TIME_ID" failed to create with error:
ORA-00942: table or view does not exist

Failing sql is:
 COMMENT ON COLUMN "JY"."SALES"."TIME_ID" IS 'FK to the times dimension table'

ORA-39083: Object type COMMENT:"CHANNEL_ID" failed to create with error:
ORA-00942: table or view does not exist

Failing sql is:
 COMMENT ON COLUMN "JY"."SALES"."CHANNEL_ID" IS 'FK to the channels dimension table'

ORA-39083: Object type COMMENT:"PROMO_ID" failed to create with error:
ORA-00942: table or view does not exist

Failing sql is:
 COMMENT ON COLUMN "JY"."SALES"."PROMO_ID" IS 'promotion identifier, without FK constraint (intentionally) to show outer join optimization'

ORA-39083: Object type COMMENT:"QUANTITY_SOLD" failed to create with error:
ORA-00942: table or view does not exist

Failing sql is:
 COMMENT ON COLUMN "JY"."SALES"."QUANTITY_SOLD" IS 'product quantity sold with the transaction'

ORA-39083: Object type COMMENT:"AMOUNT_SOLD" failed to create with error:
ORA-00942: table or view does not exist

Failing sql is:
 COMMENT ON COLUMN "JY"."SALES"."AMOUNT_SOLD" IS 'invoiced amount to the customer'

   IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
   IMPDP> Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
   IMPDP> Job "SYS"."TSPITR_IMP_lCEx_pFDE" completed with 9 error(s) at Thu Jan 11 01:55:38 2018 elapsed 0 00:01:38
import completed with errors; Oracle Data Pump dump file t_emp_recvr.dmp is retained

Removing automatic instance
Automatic instance removed
auxiliary instance file /run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_temp_f5dnmkjx_.tmp deleted
auxiliary instance file /run/recover/JY/datafile/o1_mf_temp_f5dnmj7f_.tmp deleted
auxiliary instance file /run/recover/LCEX_PITR_JYPDB_JY/onlinelog/o1_mf_4_f5dnqbjt_.log deleted
auxiliary instance file /run/recover/LCEX_PITR_JYPDB_JY/onlinelog/o1_mf_3_f5dnqbhs_.log deleted
auxiliary instance file /run/recover/LCEX_PITR_JYPDB_JY/onlinelog/o1_mf_2_f5dnqbh8_.log deleted
auxiliary instance file /run/recover/LCEX_PITR_JYPDB_JY/onlinelog/o1_mf_1_f5dnqbgj_.log deleted
auxiliary instance file /run/recover/LCEX_PITR_JYPDB_JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_users_f5dnot2n_.dbf deleted
auxiliary instance file /run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_sysaux_f5dnkynb_.dbf deleted
auxiliary instance file /run/recover/JY/datafile/o1_mf_sysaux_f5dngcjh_.dbf deleted
auxiliary instance file /run/recover/JY/datafile/o1_mf_undotbs2_f5dngcjl_.dbf deleted
auxiliary instance file /run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_undo_2_f5dnkynd_.dbf deleted
auxiliary instance file /run/recover/JY/datafile/o1_mf_undotbs1_f5dngcjk_.dbf deleted
auxiliary instance file /run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_undotbs1_f5dnkynd_.dbf deleted
auxiliary instance file /run/recover/JY/datafile/o1_mf_system_f5dngcjj_.dbf deleted
auxiliary instance file /run/recover/JY/5F9AC6865E87549FE053AB828A0ADE94/datafile/o1_mf_system_f5dnkync_.dbf deleted
auxiliary instance file /run/recover/JY/controlfile/o1_mf_f5dnfy2z_.ctl deleted
Finished recover at 2018-01-11 01:55:46
starting full resync of recovery catalog
full resync complete
5.验证是否分区SH.SALES:SALES_Q3_1998被恢复成表JY.SALES_Q3_1998,分区SH.SALES:SALES_Q4_1998被恢复成表JY.SALES_Q4_1998,从查询记录可以看到已经成功恢复
SQL> select count(*) from JY.SALES_Q3_1998;

  COUNT(*)
----------
     50515

SQL> select count(*) from JY.SALES_Q4_1998;

  COUNT(*)
----------
     48874
推荐阅读:
  1. oracle12C—RMAN表级恢复
  2. ORACLE 12C使用RMAN进行表恢复

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

12c 分表 多个

上一篇:ACE(01):Oracle ACE 申请

下一篇:11i系统基本概念和设置

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》