Oracle 12c系列(十) | 12c中的Recovering Tables and Table Partitions
在Oracle 12c之前的版本中,rman进行数据恢复时只能进行database/tablespace/datafile/block四种级别的恢复,如果误操作删除某张表或表中数据,无法通过闪回进行数据还原时,且有完整备份以及归档,该种情况下可以进行表空间时间点恢复,但恢复方式较麻烦,在Oracle12c中,Oracle对rman功能进行了增强,除了之前的四种级别的恢复,rman也提供了表/表分区级别的恢复,该特性可以直接从现有的rman备份中来恢复表/表分区,且恢复的过程不影响数据库中的其他的对象。
表级别的恢复流程与表空间时间点恢复流程相似,只是Oracle对手工的表空间时间点恢复进行了一层封装,恢复时整个流程如下:
1.创建一个辅助实例。
2.在辅助实例中通过备份集对需要恢复的表/表分区所在的数据文件进行restore。
3.recover until scn/timestamp/sequence number。
4.通过数据泵功能将需要恢复的表在辅助数据库中导出到指定目录下。
5.将需要恢复的表导入到生产库中。
6.清理辅助数据库。
指定恢复时间点时可以有以下3种级别:
1.SCN
2.TIME
3.SEQUENCE NUMBER
表/表分区级别的恢复有如下前提:
1.数据库必须处于读写模式。
2.数据库必须处于归档模式。
3.必须存在表/表分区的RMAN备份。
4.当要恢复单个表分区时,COMPATIBLE参数需要设置为11.1.0或更高。
表/表分区级别的恢复存在如下限制:
1.SYS用户下的表/表分区无法进行恢复。
2.SYSTEM/SYSAUX表空间中的表/表分区无法进行恢复。
3.无法恢复备库中的表/表分区。
4.当使用REMAP选项时无法恢复具有NOT NULL约束的表。
关于表/表分区恢复详细信息请参考官方文档,连接如下:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/bradv/rman-recovering-tables-partitions.html#GUID-87B7F772-335F-4179-81C9-91678D026D01
下面演示表级别的恢复,实验使用如下步骤:
1.创建表t,及相应索引idx_t_name。
2.做RMAN全备。
3.查看当前scn。
4.删除表。
5.在rman中恢复表t。
6.检查表中数据是否恢复。
实验过程:
1.创建表t,及相应索引idx_t_name
07:55:36 yyh. pdb18c>create table t(id number, name varchar2(20));
Table created.
Elapsed: 00:00:00.12
07:55:49 yyh. pdb18c>insert into t values(0,'QData');
1 row created.
Elapsed: 00:00:00.07
07:55:59 yyh. pdb18c>insert into t values(1,'QData Cloud');
1 row created.
Elapsed: 00:00:00.00
07:56:04 yyh. pdb18c>commit;
Commit complete.
Elapsed: 00:00:00.01
07:56:05 yyh. pdb18c>create index idx_t_name t(name);
create index idx_t_name t(name)
*
ERROR at line 1:
ORA-00969: missing ON keyword
Elapsed: 00:00:00.00
07:56:23 yyh. pdb18c>create index idx_t_name on t(name);
Index created.
Elapsed: 00:00:00.10
07:56:26 yyh. pdb18c>select * from t;
ID NAME
---------- ------------------------------
0 QData
1 QData Cloud
Elapsed: 00:00:00.03
07:56:33 yyh. pdb18c>
2.做RMAN全备
RMAN> backup database;
Starting backup at 07-AUG-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=80 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=/ssd2/ora18c/system01.dbf
input datafile file number=00003 name=/ssd2/ora18c/sysaux01.dbf
input datafile file number=00004 name=/ssd2/ora18c/undotbs01.dbf
input datafile file number=00007 name=/ssd2/ora18c/users01.dbf
channel ORA_DISK_1: starting piece 1 at 07-AUG-18
channel ORA_DISK_1: finished piece 1 at 07-AUG-18
piece handle=/ssd2/backup/20180807_full_09t9ukmd_1_1.bak tag=TAG20180807T075908 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00: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=/ssd2/ora18c/pdb18c/sysaux01.dbf
input datafile file number=00009 name=/ssd2/ora18c/pdb18c/system01.dbf
input datafile file number=00011 name=/ssd2/ora18c/pdb18c/undotbs01.dbf
input datafile file number=00012 name=/ssd2/ora18c/pdb18c/users01.dbf
channel ORA_DISK_1: starting piece 1 at 07-AUG-18
channel ORA_DISK_1: finished piece 1 at 07-AUG-18
piece handle=/ssd2/backup/20180807_full_0at9ukng_1_1.bak tag=TAG20180807T075908 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
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=/ssd2/ora18c/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/ssd2/ora18c/pdbseed/system01.dbf
input datafile file number=00008 name=/ssd2/ora18c/pdbseed/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 07-AUG-18
channel ORA_DISK_1: finished piece 1 at 07-AUG-18
piece handle=/ssd2/backup/20180807_full_0bt9uknv_1_1.bak tag=TAG20180807T075908 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 07-AUG-18
Starting Control File and SPFILE Autobackup at 07-AUG-18
piece handle=/ssd2/software/dbs/c-604968197-20180807-02 comment=NONE
Finished Control File and SPFILE Autobackup at 07-AUG-18
RMAN>
3.查看当前scn
08:04:30 yyh. pdb18c>select * from t;
ID NAME
---------- ------------------------------
0 QData
1 QData Cloud
Elapsed: 00:00:00.03
08:04:36 yyh. pdb18c>select current_scn from v$database;
CURRENT_SCN
-----------
1856675
Elapsed: 00:00:00.03
08:04:43 yyh. pdb18c>
4.删除表
08:04:43 yyh. pdb18c>drop table t purge;
Table dropped.
Elapsed: 00:00:00.50
08:04:49 yyh. pdb18c>select * from t;
select * from t
*
ERROR at line 1:
ORA-00942: table or view does not exist
Elapsed: 00:00:00.00
08:04:53 yyh. pdb18c>select current_scn from v$database;
CURRENT_SCN
-----------
1856698
Elapsed: 00:00:00.00
08:04:55 yyh. pdb18c>
5.在rman中恢复表t
[[email protected] ~]$ rman target /
Recovery Manager: Release 18.0.0.0.0 - Production on Tue Aug 7 08:05:12 2018
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA18C (DBID=604968197)
RMAN> recover table yyh.t OF PLUGGABLE DATABASE pdb18c until scn 1856675 auxiliary destination '/home/oracle/tmp' REMAP TABLE yyh.t:t_new;
Starting recover at 07-AUG-18
using target database control file instead of recovery catalog
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=81 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 PDB18C:SYSTEM
Tablespace UNDOTBS1
Tablespace PDB18C:UNDOTBS1
Creating automatic instance, with SID='EyDp'
initialization parameters used for automatic instance:
db_name=ORA18C
db_unique_name=EyDp_pitr_pdb18c_ORA18C
compatible=18.0.0
db_block_size=8192
db_files=200
diagnostic_dest=/u01/app/oracle
_system_trig_enabled=FALSE
db_domain=example.com
sga_target=1216M
processes=200
db_create_file_dest=/home/oracle/tmp
log_archive_dest_1='location=/home/oracle/tmp'
enable_pluggable_database=true
_clone_one_pdb_recovery=true
#No auxiliary parameter file used
starting up automatic instance ORA18C
Oracle instance started
Total System Global Area 1275067224 bytes
Fixed Size 8895320 bytes
Variable Size 335544320 bytes
Database Buffers 922746880 bytes
Redo Buffers 7880704 bytes
Automatic instance created
contents of Memory Script:
{
# set requested point in time
set until scn 1856675;
# 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 07-AUG-18
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=38 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 /ssd2/software/dbs/c-604968197-20180807-02
channel ORA_AUX_DISK_1: piece handle=/ssd2/software/dbs/c-604968197-20180807-02 tag=TAG20180807T080024
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/home/oracle/tmp/ORA18C/controlfile/o1_mf_fpm2t8n9_.ctl
Finished restore at 07-AUG-18
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 1856675;
# 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 /home/oracle/tmp/ORA18C/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 3 to /home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_temp_%u_.tmp in control file
Starting restore at 07-AUG-18
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 /home/oracle/tmp/ORA18C/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /home/oracle/tmp/ORA18C/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /home/oracle/tmp/ORA18C/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /ssd2/backup/20180807_full_09t9ukmd_1_1.bak
channel ORA_AUX_DISK_1: piece handle=/ssd2/backup/20180807_full_09t9ukmd_1_1.bak tag=TAG20180807T075908
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
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 /home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00011 to /home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00010 to /home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /ssd2/backup/20180807_full_0at9ukng_1_1.bak
channel ORA_AUX_DISK_1: piece handle=/ssd2/backup/20180807_full_0at9ukng_1_1.bak tag=TAG20180807T075908
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 07-AUG-18
datafile 1 switched to datafile copy
input datafile copy RECID=10 STAMP=983520431 file name=/home/oracle/tmp/ORA18C/datafile/o1_mf_system_fpm2thc6_.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=11 STAMP=983520431 file name=/home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_system_fpm2v8mx_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=12 STAMP=983520431 file name=/home/oracle/tmp/ORA18C/datafile/o1_mf_undotbs1_fpm2thco_.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=13 STAMP=983520431 file name=/home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_undotbs1_fpm2v8nd_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=14 STAMP=983520431 file name=/home/oracle/tmp/ORA18C/datafile/o1_mf_sysaux_fpm2thcg_.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=15 STAMP=983520431 file name=/home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_sysaux_fpm2v8mo_.dbf
contents of Memory Script:
{
# set requested point in time
set until scn 1856675;
# online the datafiles restored or switched
sql clone "alter database datafile 1 online";
sql clone 'PDB18C' "alter database datafile
9 online";
sql clone "alter database datafile 4 online";
sql clone 'PDB18C' "alter database datafile
11 online";
sql clone "alter database datafile 3 online";
sql clone 'PDB18C' "alter database datafile
10 online";
# recover and open database read only
recover clone database tablespace "SYSTEM", "PDB18C":"SYSTEM", "UNDOTBS1", "PDB18C":"UNDOTBS1", "SYSAUX", "PDB18C":"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 07-AUG-18
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 36 is already on disk as file /ssd2/ora18c/arch/1_36_983002568.dbf
archived log for thread 1 with sequence 37 is already on disk as file /ssd2/ora18c/arch/1_37_983002568.dbf
archived log for thread 1 with sequence 38 is already on disk as file /ssd2/ora18c/arch/1_38_983002568.dbf
archived log file name=/ssd2/ora18c/arch/1_36_983002568.dbf thread=1 sequence=36
archived log file name=/ssd2/ora18c/arch/1_37_983002568.dbf thread=1 sequence=37
archived log file name=/ssd2/ora18c/arch/1_38_983002568.dbf thread=1 sequence=38
media recovery complete, elapsed time: 00:00:01
Finished recover at 07-AUG-18
sql statement: alter database open read only
contents of Memory Script:
{
sql clone 'alter pluggable database PDB18C open read only';
}
executing Memory Script
sql statement: alter pluggable database PDB18C 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 =
''/home/oracle/tmp/ORA18C/controlfile/o1_mf_fpm2t8n9_.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 1275067224 bytes
Fixed Size 8895320 bytes
Variable Size 335544320 bytes
Database Buffers 922746880 bytes
Redo Buffers 7880704 bytes
sql statement: alter system set control_files = ''/home/oracle/tmp/ORA18C/controlfile/o1_mf_fpm2t8n9_.ctl'' comment= ''RMAN set'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1275067224 bytes
Fixed Size 8895320 bytes
Variable Size 335544320 bytes
Database Buffers 922746880 bytes
Redo Buffers 7880704 bytes
sql statement: alter database mount clone database
contents of Memory Script:
{
# set requested point in time
set until scn 1856675;
# 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 07-AUG-18
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=34 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 /home/oracle/tmp/EYDP_PITR_PDB18C_ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /ssd2/backup/20180807_full_0at9ukng_1_1.bak
channel ORA_AUX_DISK_1: piece handle=/ssd2/backup/20180807_full_0at9ukng_1_1.bak tag=TAG20180807T075908
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 07-AUG-18
datafile 12 switched to datafile copy
input datafile copy RECID=17 STAMP=983520502 file name=/home/oracle/tmp/EYDP_PITR_PDB18C_ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_users_fpm2xo0z_.dbf
contents of Memory Script:
{
# set requested point in time
set until scn 1856675;
# online the datafiles restored or switched
sql clone 'PDB18C' "alter database datafile
12 online";
# recover and open resetlogs
recover clone database tablespace "PDB18C":"USERS", "SYSTEM", "PDB18C":"SYSTEM", "UNDOTBS1", "PDB18C":"UNDOTBS1", "SYSAUX", "PDB18C":"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 07-AUG-18
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 36 is already on disk as file /ssd2/ora18c/arch/1_36_983002568.dbf
archived log for thread 1 with sequence 37 is already on disk as file /ssd2/ora18c/arch/1_37_983002568.dbf
archived log for thread 1 with sequence 38 is already on disk as file /ssd2/ora18c/arch/1_38_983002568.dbf
archived log file name=/ssd2/ora18c/arch/1_36_983002568.dbf thread=1 sequence=36
archived log file name=/ssd2/ora18c/arch/1_37_983002568.dbf thread=1 sequence=37
archived log file name=/ssd2/ora18c/arch/1_38_983002568.dbf thread=1 sequence=38
media recovery complete, elapsed time: 00:00:00
Finished recover at 07-AUG-18
database opened
contents of Memory Script:
{
sql clone 'alter pluggable database PDB18C open';
}
executing Memory Script
sql statement: alter pluggable database PDB18C open
contents of Memory Script:
{
# create directory for datapump import
sql 'PDB18C' "create or replace directory
TSPITR_DIROBJ_DPDIR as ''
/home/oracle/tmp''";
# create directory for datapump export
sql clone 'PDB18C' "create or replace directory
TSPITR_DIROBJ_DPDIR as ''
/home/oracle/tmp''";
}
executing Memory Script
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/home/oracle/tmp''
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/home/oracle/tmp''
Performing export of tables...
EXPDP> Starting "SYS"."TSPITR_EXP_EyDp_laDE":
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 "YYH"."T" 5.492 KB 2 rows
EXPDP> Master table "SYS"."TSPITR_EXP_EyDp_laDE" successfully loaded/unloaded
EXPDP> ******************************************************************************
EXPDP> Dump file set for SYS.TSPITR_EXP_EyDp_laDE is:
EXPDP> /home/oracle/tmp/tspitr_EyDp_57472.dmp
EXPDP> Job "SYS"."TSPITR_EXP_EyDp_laDE" successfully completed at Tue Aug 7 08:09:23 2018 elapsed 0 00:00:28
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_EyDp_Fvoy" successfully loaded/unloaded
IMPDP> Starting "SYS"."TSPITR_IMP_EyDp_Fvoy":
IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE
IMPDP> Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
IMPDP> . . imported "YYH"."T_NEW" 5.492 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_EyDp_Fvoy" successfully completed at Tue Aug 7 08:10:37 2018 elapsed 0 00:01:01
Import completed
Removing automatic instance
Automatic instance removed
auxiliary instance file /home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_temp_fpm2vo5f_.tmp deleted
auxiliary instance file /home/oracle/tmp/ORA18C/datafile/o1_mf_temp_fpm2vlrn_.tmp deleted
auxiliary instance file /home/oracle/tmp/EYDP_PITR_PDB18C_ORA18C/onlinelog/o1_mf_3_fpm2xsz2_.log deleted
auxiliary instance file /home/oracle/tmp/EYDP_PITR_PDB18C_ORA18C/onlinelog/o1_mf_2_fpm2xqk6_.log deleted
auxiliary instance file /home/oracle/tmp/EYDP_PITR_PDB18C_ORA18C/onlinelog/o1_mf_1_fpm2xqjq_.log deleted
auxiliary instance file /home/oracle/tmp/EYDP_PITR_PDB18C_ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_users_fpm2xo0z_.dbf deleted
auxiliary instance file /home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_sysaux_fpm2v8mo_.dbf deleted
auxiliary instance file /home/oracle/tmp/ORA18C/datafile/o1_mf_sysaux_fpm2thcg_.dbf deleted
auxiliary instance file /home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_undotbs1_fpm2v8nd_.dbf deleted
auxiliary instance file /home/oracle/tmp/ORA18C/datafile/o1_mf_undotbs1_fpm2thco_.dbf deleted
auxiliary instance file /home/oracle/tmp/ORA18C/725FE29D8B2648D6E0535138A8C01199/datafile/o1_mf_system_fpm2v8mx_.dbf deleted
auxiliary instance file /home/oracle/tmp/ORA18C/datafile/o1_mf_system_fpm2thc6_.dbf deleted
auxiliary instance file /home/oracle/tmp/ORA18C/controlfile/o1_mf_fpm2t8n9_.ctl deleted
auxiliary instance file tspitr_EyDp_57472.dmp deleted
Finished recover at 07-AUG-18
RMAN>
6.检查表中数据是否恢复
08:20:08 yyh. pdb18c>select * from t_new;
ID NAME
---------- ------------------------------
0 QData
1 QData Cloud
Elapsed: 00:00:00.05
08:21:22 yyh. pdb18c>select index_name, table_name from user_indexes;
no rows selected
Elapsed: 00:00:00.18
08:21:33 yyh. pdb18c>
表数据已经被恢复。
在恢复表的过程中观察服务器中的后台实例情况,可以发现为EyDp的SID的辅助数据库,该库即为恢复表时自动创建的辅助数据库,如下:
[[email protected] ssd2]$ ps -ef | grep pmon
oracle 11536 1 0 08:06 ? 00:00:00 ora_pmon_EyDp
oracle 11911 15784 0 08:07 pts/1 00:00:00 grep pmon
oracle 16207 1 0 06:33 ? 00:00:00 ora_pmon_ora18c
[[email protected] ssd2]$
| 作者简介
杨禹航·沃趣科技高级数据库技术专家
熟悉Oracle数据库内部机制,丰富的数据库及RAC集群层故障诊断、性能调优、OWI、数据库备份恢复及迁移经验。
上一篇: Vue学习系列 -- 自定义指令
下一篇: vue 自定义指令