Академический Документы
Профессиональный Документы
Культура Документы
com :
All data is available on server : UXIT725c and Path : /logs/oracle/RESTORE_PDB/*
oracle@uxit725c> pwd
/logs/oracle/RESTORE_PDB
oracle@uxit725c>
BUG : 19809171
DOC ID : Doc ID 2034953.1
How to Restore - Dropped Pluggable database (PDB) in Multitenant (Doc ID 2034953
.1)
Oracle Meta link Document : https://support.oracle.com/epmos/faces/DocumentDispl
ay?_afrLoop=30169967434256&id=2034953.1&_afrWindowMode=0&_adf.ctrl-state=11pn6th
af4_53
================================================================================
=========================================================
STEP 1 : I created Directory Structure on Same Production Server : UXIT725C on F
S : /logs
================================================================================
=========================================================
My Production CDB having Datafiles on +ASM device but now creating TESTCDB/Auxil
iary Instance , whose Datafile,Redolog , Control File ... Each on everthing on F
S
Path : /logs/oracle/RESTORE_PDB
Folder which I created under this are
ARCH ==== > Will contains Archive for Restor & Recover Purpose
REDOLOG ==== > Will contains Online Redologs when I'll OPEN TESTCDB / AUXILIAR
Y INSTANCE [ CDB ] in RESETLOGS MODE
CONTROL ==== > Will contains TESTCDB / AUXILIARY INSTANCE [ CDB ] Controlfile
which is restored from 19-March-2017 L0 backup of CUTFP1
DATAFILE ==== > Will contains Datafile of CUTFP1 specific to CDB : CUTFP1 + PDB
:IRISPROD as TESTCDB / AUXILIARY INSTANCE [ CDB ] Datafiles
RMAN ==== > Will contains my RMAN specific file like RCV , logs etc details
================================================================================
=========================================================
STEP 2 : I created pfile from SPFILE of Production CDB and then modified it & ad
d *.db_file_name_convert and *.log_file_name_convert
================================================================================
=========================================================
oracle@uxit725c> cat initTESTCDB.ora
*.audit_trail='DB'
*.compatible='12.1.0.2.0'
*.control_file_record_keep_time=31
*.control_files='/logs/oracle/RESTORE_PDB/CONTROL/control01.ctl'
*.db_block_size=8192
*.db_create_file_dest='/logs/oracle/RESTORE_PDB/DATAFILE'
*.db_create_online_log_dest_1='/logs/oracle/RESTORE_PDB/REDOLOG'
*.db_create_online_log_dest_2='/logs/oracle/RESTORE_PDB/REDOLOG'
*.db_domain='dc.infra.com'
*.db_files=2048
*.db_name='TESTCDB'
*.instance_name='TESTCDB'
*.db_unique_name='TESTCDB'
*.diagnostic_dest='/logs/oracle/RESTORE_PDB'
*.enable_pluggable_database=true
*.local_listener='LISTENER_1532'
*.log_archive_dest_1='LOCATION=/logs/oracle/RESTORE_PDB/ARCH'
*.log_archive_trace=8
*.max_dispatchers=6
*.max_shared_servers=12
*.memory_target=0
*.open_cursors=300
*.parallel_max_servers=4
*.pga_aggregate_target=2147483648
*.processes=130
*.remote_login_passwordfile='EXCLUSIVE'
#*.service_names='TESTCDB.dc.infra.com'
*.sessions=50
*.sga_max_size=2147483648
*.sga_target=2147483648
*.shared_servers=30
*.undo_retention=3600
*.undo_tablespace='UNDOTBS1'
*.db_file_name_convert='+DAT001F','/logs/oracle/RESTORE_PDB/DATAFILE'
======== > IMP PARAMETER
*.log_file_name_convert='+RDO001F','/logs/oracle/RESTORE_PDB/REDOLOG','+RDO002F'
,'/logs/oracle/RESTORE_PDB/REDOLOG' ======== > IMP PARAMETER
oracle@uxit725c>
================================================================================
=========================================================
STEP 3 : Create password file for auxiliary instance
================================================================================
=========================================================
In this Step ORACLE says that we need to create password file for TESTCDB so I d
id like below ways only
A : cd $ORACLE_HOME/dbs
B : ls -lrt *orapw* ===== > from this out put I choose Producti
on CDB , whose pdb was dropped i.e orapwCUTFP1.ora
C : cp orapwCUTFP1.ora orapwTESTCDB.ora
D : ls -lrt *orapw* ===== > from this out put I'll cross check
that newlly created/ copy password file were present or not ?
================================================================================
=========================================================
STEP 4 : Create a temporary auxiliary instance in same source (Production) Serv
er or in another server (Auxiliary Server ) to restore container database (CDB)
and required pluggable database (PDB)
Start the auxiliary instance in nomount
state
================================================================================
=========================================================
In this step Oracle says we need to create on dummy database means need to creat
e CDB [ TESTCDB ]
We already created pfile for Dummy CDB Instance which we call auxillary Instance
: - TESTCDB & from that instance we start database in nomount state only
export ORACLE_SID=TESTCDB
exprot ORACLE_HOME= GIVE ORACLE HOME PATH OF 12
startup nomount pfile='initTESTCDB.ora';
once instance is in nomount state we need to start duplication of database from
Active CDB : Production DDB to Auxillary CDB : TESTCDB
================================================================================
=========================================================
STEP 5 : Connect auxiliary instance through RMAN ****** VVVV IMP STEP ***
******
================================================================================
=========================================================
Here I need to connect with TESTCDB & then need to connect as below to RMAN
rman target sys/Dtyntycc2e@CUTFP1 auxiliary /
REASON 1 : my Production database is CUTFP1 so RMAN Should know from which Datab
ase will conside as Input/Source Information ?
So we used ======= > rman target sys/Dtyntycc2e@CUTFP1
REASON 2 : we are going to clone database so we need to have auxiliary channel +
auxiliary Instance to proceed & keep/store data of CUTFP1 into it.
In my case Auxiliary Instance is : TESTPDB
********************************************************************************
*******************
I executed following STEP on Server UXIT725C but before that I Exported Database
TESTCDB as export ORACLE_SID=TESTCDB
and once connecntion done It look like below
oracle@uxit725c> rman target sys/Dtyntycc2e@CUTFP1 auxiliary /
Recovery Manager: Release 12.1.0.2.0 - Production on Fri Mar 24 18:58:08 2017
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
================================================================================
=========================================================
STEP 6 : Starting clonning/restoration of Procution CDB into TESTCDB from Full d
atabase backup before dropping PDB
================================================================================
=========================================================
For TSM78 ==== > 2 channel for Archive Restoration & 1 Channel as Auxiliary wh
ich will do Actual Restoration of Archive & Recover
allocate channel c1_TSM78 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=/oracle/admin
/CUTFP1/tdpo/TSM78/tdpo.opt)";
allocate channel c2_TSM78 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=/oracle/admin
/CUTFP1/tdpo/TSM78/tdpo.opt)";
allocate auxiliary channel c3_TSM78 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=/or
acle/admin/CUTFP1/tdpo/TSM78/tdpo.opt)";
For TSM88 ==== > 2 channel for Archive Restoration & 1 Channel as Auxiliary wh
ich will do Actual Restoration of Archive & Recover
allocate channel c1_TSM88 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=/oracle/admin
/CUTFP1/tdpo/TSM88/tdpo.opt)";
allocate channel c2_TSM88 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=/oracle/admin
/CUTFP1/tdpo/TSM88/tdpo.opt)";
allocate auxiliary channel c3_TSM88 type 'SBT_TAPE' parms="ENV=(TDPO_OPTFILE=/or
acle/admin/CUTFP1/tdpo/TSM88/tdpo.opt)";
================================================================================
=========================================================
STEP 9 : Connect to TESTCDB and do following
================================================================================
=========================================================
select name,open_mode from v$database; ===== > it shows TESTCDB is in mount mode
select name,open_mode from v$pdbs; ===== > It show PDB: IRISPROD with some dif
frent name in MOUNT State
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
5 _###_UNKNOWN_PDB_#_5 MOUNTED
RMAN>
================================================================================
=========================================================
STEP 10 : Open the auxiliary database with resetlogs
================================================================================
=========================================================
Connect to CDB : TESTCDB as
export ORACLE_SID=TESTCDB
sqlplus / as sysdba ==== > Enter & you are on SQL> Prompt
================================================================================
=========================================================
STEP 12 : Close the PDB : IRISPROD in TESTCDB / AUXILIARY Instance
================================================================================
=========================================================
SQL> alter pluggable database IRISPROD close immediate;
================================================================================
=========================================================
STEP : Unplug the PDB : IRISPROD to detach from auxiliary CDB : TESTCDB into xml
file : -/logs/oracle/RESTORE_PDB/IRISPROD.xml
================================================================================
=========================================================
Connect to CDB : TESTCDB
SQL > alter pluggable database IRISPROD unplug into '/logs/oracle/RESTORE_PDB/I
RISPROD.xml'
If you are connected to PDB : IRISPROD itself and try to do unplug it will gives
you an error so TRY IT from CDB
================================================================================
=========================================================
STEP 13 : On production server (the original container CDB) plug this PDB:
================================================================================
=========================================================
We do this into multiple ways but I prefare below mention on ONLY
Part A : Create pluggable database using XML file which created previous step
@ PATH : /logs/oracle/RESTORE_PDB/IRISPROD.xml
================================================================================
=========================================================
STEP 14 : In my case datafiles are created/restored in OMF format in different
location which I specify in pfile on initTESTCDB.ora
So,IRISPROD can be created using FILE_NAME_CONVERT and COPY command as b
elow
================================================================================
=========================================================
As I specify in PFILE of TESTCDB that where will my Datafile & REDOLOGS will get
created for this clonning
*.db_file_name_convert='+DAT001F','/logs/oracle/RESTORE_PDB/DATAFILE'
*.log_file_name_convert='+RDO001F','/logs/oracle/RESTORE_PDB/REDOLOG','+RDO002F'
,'/logs/oracle/RESTORE_PDB/REDOLOG'
So all my datafiles are created under path : /logs/oracle/RESTORE_PDB/DATAFILE/*
*** and now CUTFP1 datafile's stored inside +ASM DG : +DAT001F
here I spent lot much time as I'm not aware how datafiles will got created insid
e DG : +DAT001F means worried about obsolute path location
but when Actual command I executed after exporting PRODUCTION CDB then all Dataf
ile are created on DG : +DAT001F on OLD PATH ONLY
************************************************************
Command for PLUGGING PDB : IRISPROD back into CDB : CUTFP1
************************************************************
Export ORACLE_SID=PRODUCTION_CDB
export ORACLE_SID=CUTFP1
sqlplus / as sysdba
SQL@CUTFP1 > Create pluggable database IRISPROD using '/logs/oracle/RESTORE_PDB/
IRISPROD.xml' COPY
FILE_NAME_CONVERT =
('/logs/oracle/RESTORE_PDB/DATAFILE/cutfp1/31787e9177091083e0540
0144ffb91b1/datafile/system.328.910280187','+DAT001F',
'/logs/oracle/RESTORE_PDB/DATAFILE/cutfp1/31787e9177091083e0540
0144ffb91b1/datafile/sysaux.329.910280187','+DAT001F',
'/logs/oracle/RESTORE_PDB/DATAFILE/cutfp1/31787e9177091083e0540
0144ffb91b1/datafile/tab_irisprod_l.331.910280525','+DAT001F',
'/logs/oracle/RESTORE_PDB/DATAFILE/cutfp1/31787e9177091083e0540
0144ffb91b1/datafile/tab_iris_idx.332.910280603','+DAT001F'
I forget to add temp file over here from PDB of TESTCDB to CUT
FP1 DG : + DAT001F ) tempfile reuse;
As the ORACLE 12c feature it will move datafile online so my datafiles are moved
from /logs/oracle/RESTORE_PDB/DATAFILE/cutfp1/**** INSIDE of +ASM DG : +DAT001F
you can see that FILE ID got changed after restoration of PDB and OLD FILE ID Re
lated to PDB : IRISPROD are DELETED from Database metadata
Details capture in Alert Log for this:
Deleting old file#11 from file$
Deleting old file#12 from file$
Deleting old file#13 from file$
Deleting old file#14 from file$
Adding new file#60 to file$(old file#11)
Adding new file#61 to file$(old file#12)
Adding new file#62 to file$(old file#13)
Adding new file#63 to file$(old file#14)
================================================================================
=========================================================
STEP 17 : On production server (connect to the original container CDB) Check exi
stence of PDB:
================================================================================
=========================================================
SYS@CUTFP1> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
SOAWPSP1 READ WRITE
IRISPROD MOUNTED <=============== Plugged In PDB is
in MOUNT STATE
RIPSDBP1 READ WRITE
EAIWPSP1 READ WRITE
OCEEANP1 READ WRITE
6 rows selected.
================================================================================
=========================================================
STEP 18 : On production server (connect to the original container CDB)OPEN the
PDB: IRISPROD
================================================================================
=========================================================
SQL> alter pluggable database IRISPROD open;
Pluggable database altered.
SYS@CUTFP1> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
SOAWPSP1 READ WRITE
IRISPROD READ WRITE <=============== Plugged In PDB
is in OPEN MODE
RIPSDBP1 READ WRITE
EAIWPSP1 READ WRITE
OCEEANP1 READ WRITE
================================================================================
=========================================================
STEP 19 : On production server (connect to the original container CDB) Connect t
o the PDB: IRISPROD to add TEMP FILE
================================================================================
=========================================================
I cross check in report schema for TEMPORARY TABLESPACE Details Specific to PDB
: IRISPROD
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 197 TEMP 32750 +DAT001F/CUTFP1/TEMPFILE/temp.319
.910189591
2 100 PDB$SEED:TEMP 32767 +DAT001F/CUTFP1/FDB039E555681306E
04400163E5BEA5F/DATAFILE/pdbseed_temp012016-04-26_02-27-28-pm.dbf
3 10212 SOAWPSP1:TEMP 32767 +DAT001F/CUTFP1/2E568D0970C5475CE
05400144FFB91B1/TEMPFILE/temp.348.913547221
********************************************************************************
***************************************************
4 10240 IRISPROD:TEMP_IRIS 32767 +DAT001F/CUTFP1/31787E9177091083E
05400144FFB91B1/TEMPFILE/temp_iris.332.939568599
********************************************************************************
***************************************************
5 25 RIPSDBP1:TEMP 32767 +DAT001F/CUTFP1/318E43F81ABC208EE
05400144FFB91B1/TEMPFILE/temp.336.910373699
6 160 EAIWPSP1:TEMP 32767 +DAT001F/CUTFP1/2E5682F225233D0AE
05400144FFB91B1/TEMPFILE/temp.361.913548107
7 3000 TEMP 32750 +DAT001F/CUTFP1/TEMPFILE/temp.370
.924954801
8 2847 OCEEANP1:TEMP 32767 +DAT001F/CUTFP1/3F369D956ABF6D28E
05400144FFB91B1/TEMPFILE/temp.373.925649643
9 5000 EAIWPSP1:TEMP 15000 +DAT001F/CUTFP1/2E5682F225233D0AE
05400144FFB91B1/TEMPFILE/temp1
10 5000 TEMP 10240 +DAT001F/CUTFP1/TEMPFILE/temp.389
.934749651
================================================================================
=========================================================
STEP 20 : Take Full Backup
================================================================================
=========================================================
Take Full Backup of PRODUCTION CDB immediate after this restoration
================================================================================
=========================================================
CONCLUSION :
================================================================================
=========================================================
NEVER EVER DROP PDB IT WILL BE PROBLEMATIC FOR US AND THIS IS BUG OF 12C AND NOT
FIX TILL : 12.1.0.2.0 VERSION
[ THIS IS VERSION OVER WHICH I COME ACROSS THIS ISSUE ] MAY BE IN LATER RELEASE
ORACLE WILL TAKE OF THIS.