A friend gives the PDB a restore/recover process.
A secondary instance is actually created, then the PDB is extracted and recovered.
(10:31:59)Frank.yan: [administrator.win-7zfxnfksd8p]?./rman Target/
Recovery manager:release 12.1.0.1.0-production on Fri 19 14:44:05 2017
Copyright (c) 1982, 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 the 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 has 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 to Datafilecopy
"C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSTEM01. DBF ";
Switch Clone datafile to Datafilecopy
"C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSAUX01. DBF ";
Switch Clone datafile 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 switched to datafile copy
Input datafile copy recid=1 stamp=944405178 file NAME=C:\APP\ORCLHOMEUSER\ORADATA\ORCL\ORCL2PDB\SYSTEM01. Dbf
DataFile switched to datafile copy
Input datafile copy recid=2 stamp=944405178 file name=c:\app\orclhomeuser\oradata\orcl\orcl2pdb\sysaux01. Dbf
DataFile 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 the 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
Ten online ";
SQL clone ' orcl2pdb ' "ALTER DATABASE datafile
Online ";
SQL clone ' orcl2pdb ' "ALTER DATABASE datafile
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 online
SQL Statement:alter Database datafile online
SQL Statement:alter Database datafile 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 are already on disk as file C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\ARCHIVE Log\2017_05_19\o1_mf_1_197_dkwoqh74_. ARC
Archived log for thread 1 with sequence 198 are already on disk as file C:\APP\ORCLHOMEUSER\FAST_RECOVERY_AREA\ORCL\ARCHIVE Log\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
[Oracle] [PDB] PDB Restore/recover Process Record