[Oracle][PDB]PDB restore/recover 过程记录

友人给的PDB restore / recover 的过程。

实际上会创建一个辅助Instance,然后抽取出PDB,进行恢复。

 

(10:31:59) frank.yan: [Administrator.WIN-7ZFXNFKSD8P] ➤ ./rman target /

Recovery Manager: Release 12.1.0.1.0 - Production on Fri May 19 14:44:05 2017

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

connected to target database: ORCL (DBID=1471571033)

RMAN> ALTER PLUGGABLE DATABASE orcl2pdb CLOSE; ★

using target database control file instead of recovery catalog
Statement processed

RMAN> run
{
 set until time "to_date('2017-05-19 11:25:00','yyyy-mm-dd hh24:mi:ss')"; ★
 RESTORE PLUGGABLE DATABASE orcl2pdb; ★
 RECOVER PLUGGABLE DATABASE orcl2pdb; ★
}2> 3> 4> 5> 6>

executing command: SET until clause

Starting restore at 2017-05-19_14:44:41
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=25 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00010 to C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSTEM01.DBF
channel ORA_DISK_1: restoring datafile 00011 to C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSAUX01.DBF
channel ORA_DISK_1: restoring datafile 00012 to C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\ORCL2PDB_USERS01.DBF
channel ORA_DISK_1: reading from backup piece C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\12819F783C454B38B6D844D4C0E70DAB\BACKUPSET\2017_05_19\O1_MF_NNNDF_CTGM_DAILY_ORA_20170_DKWOO8NX_.BKP
channel ORA_DISK_1: piece handle=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\12819F783C454B38B6D844D4C0E70DAB\BACKUPSET\2017_05_19\O1_MF_NNNDF_CTGM_DAILY_ORA_20170_DKWOO8NX_.BKP tag=CTGM_DAILY_ORA_201705191020
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
Finished restore at 2017-05-19_14:45:17

Starting recover at 2017-05-19_14:45:17
using channel ORA_DISK_1
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='xqny'

initialization parameters used for automatic instance:
db_name=ORCL
db_unique_name=xqny_pitr_orcl2pdb_ORCL
compatible=12.1.0.0.0
db_block_size=8192
db_files=200
sga_target=1G
processes=80
diagnostic_dest=C:\APP\ORCLHOMEUSER
_system_trig_enabled=FALSE
#No auxiliary destination in use
enable_pluggable_database=true
_clone_one_pdb_recovery=true
control_files=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\CONTROLFILE\O1_MF_DKX1MFKW_.CTL
#No auxiliary parameter file used


starting up automatic instance ORCL

Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2973040 bytes
Variable Size                281019024 bytes
Database Buffers             780140544 bytes
Redo Buffers                   4804608 bytes
Automatic instance created

contents of Memory Script:
{
# set requested point in time
set until  time "to_date('2017-05-19 11:25:00','yyyy-mm-dd hh24:mi:ss')";
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
}
executing Memory Script

executing command: SET until clause

Starting restore at 2017-05-19_14:46:09
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=11 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 C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\AUTOBACKUP\2017_05_19\O1_MF_S_944392960_DKWOQL42_.BKP
channel ORA_AUX_DISK_1: piece handle=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\AUTOBACKUP\2017_05_19\O1_MF_S_944392960_DKWOQL42_.BKP tag=TAG20170519T112240
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
output file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\CONTROLFILE\O1_MF_DKX1MFKW_.CTL
Finished restore at 2017-05-19_14:46:11

sql statement: alter database mount clone database

contents of Memory Script:
{
# set requested point in time
set until  time "to_date('2017-05-19 11:25:00','yyyy-mm-dd hh24:mi:ss')";
# switch to valid datafilecopies
switch clone datafile  10 to datafilecopy
"C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSTEM01.DBF";
switch clone datafile  11 to datafilecopy
"C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSAUX01.DBF";
switch clone datafile  12 to datafilecopy
"C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\ORCL2PDB_USERS01.DBF";
# set destinations for recovery set and auxiliary set datafiles
set newname for datafile  1 to
"C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSTEM_DKX1O0XH_.DBF";
set newname for datafile  5 to
"C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_UNDOTBS1_DKX1O0YY_.DBF";
set newname for datafile  3 to
"C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSAUX_DKX1O124_.DBF";
set newname for datafile  6 to
"C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_USERS_DKX1O93O_.DBF";
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile  1, 5, 3, 6;
switch clone datafile all;
}
executing Memory Script

executing command: SET until clause

datafile 10 switched to datafile copy
input datafile copy RECID=1 STAMP=944405178 file name=C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSTEM01.DBF

datafile 11 switched to datafile copy
input datafile copy RECID=2 STAMP=944405178 file name=C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSAUX01.DBF

datafile 12 switched to datafile copy
input datafile copy RECID=3 STAMP=944405178 file name=C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\ORCL2PDB_USERS01.DBF

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 2017-05-19_14:46: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 C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSTEM_DKX1O0XH_.DBF
channel ORA_AUX_DISK_1: restoring datafile 00005 to C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_UNDOTBS1_DKX1O0YY_.DBF
channel ORA_AUX_DISK_1: restoring datafile 00003 to C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSAUX_DKX1O124_.DBF
channel ORA_AUX_DISK_1: restoring datafile 00006 to C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_USERS_DKX1O93O_.DBF
channel ORA_AUX_DISK_1: reading from backup piece C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\BACKUPSET\2017_05_19\O1_MF_NNNDF_CTGM_DAILY_ORA_20170_DKWOM7FY_.BKP
channel ORA_AUX_DISK_1: piece handle=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\BACKUPSET\2017_05_19\O1_MF_NNNDF_CTGM_DAILY_ORA_20170_DKWOM7FY_.BKP tag=CTGM_DAILY_ORA_201705191020
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:36
Finished restore at 2017-05-19_14:47:55

datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=944405275 file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSTEM_DKX1O0XH_.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=9 STAMP=944405275 file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_UNDOTBS1_DKX1O0YY_.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=944405276 file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSAUX_DKX1O124_.DBF
datafile 6 switched to datafile copy
input datafile copy RECID=11 STAMP=944405276 file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_USERS_DKX1O93O_.DBF

contents of Memory Script:
{
# set requested point in time
set until  time "to_date('2017-05-19 11:25:00','yyyy-mm-dd hh24:mi:ss')";
# 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 'ORCL2PDB' "alter database datafile
10 online";
sql clone 'ORCL2PDB' "alter database datafile
11 online";
sql clone 'ORCL2PDB' "alter database datafile
12 online";
sql clone "alter database datafile  6 online";
# recover pdb
recover clone database tablespace  "SYSTEM", "UNDOTBS1", "SYSAUX", "USERS" pluggable database
'ORCL2PDB'   delete archivelog;
sql clone 'alter database open read only';
plsql >>;
plsql >>;
# shutdown clone before import
shutdown clone abort
plsql  'ORCL2PDB');
end; >>>;
}
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  10 online

sql statement: alter database datafile  11 online

sql statement: alter database datafile  12 online

sql statement: alter database datafile  6 online

Starting recover at 2017-05-19_14:47:57
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 197 is already on disk as file C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_05_19\O1_MF_1_197_DKWOQH74_.ARC
archived log for thread 1 with sequence 198 is already on disk as file C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_05_19\O1_MF_1_198_DKWPMJPQ_.ARC
archived log file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_05_19\O1_MF_1_197_DKWOQH74_.ARC thread=1 sequence=197
archived log file name=C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\ARCHIVELOG\2017_05_19\O1_MF_1_198_DKWPMJPQ_.ARC thread=1 sequence=198
media recovery complete, elapsed time: 00:00:01
Finished recover at 2017-05-19_14:48:01

sql statement: alter database open read only

Oracle instance shut down

Removing automatic instance
Automatic instance removed
auxiliary instance file C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\DATAFILE\O1_MF_SYSAUX_DKX1O124_.DBF deleted
auxiliary instance file C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\CONTROLFILE\O1_MF_DKX1MFKW_.CTL deleted
Finished recover at 2017-05-19_14:48:21

RMAN> ALTER PLUGGABLE DATABASE orcl2pdb OPEN RESETLOGS; ★

Statement processed

posted @ 2017-09-29 10:34  健哥的数据花园  阅读(690)  评论(0编辑  收藏  举报