SlideShare a Scribd company logo
Pluggable Database Part 3
Osama Mustafa Page 1
Since Pluggable Database is New Topic to post about , I Cannot post Everything in One Post so i decide
to do it as tutorial and this one part (3) , every Topics uploaded Here on my blog or on my Account on
Shareslide here.
In This topic:
 How to unplug database.
 Plugging Database to another Container Database.
Let's Start :
SQL> select name, con_id from v$active_services ;
NAME CON_ID
--------------------------------- ----------
new2 4
new 3
db12cXDB 1
db12c 1
SYS$BACKGROUND 1
SYS$USERS 1
As you see i already create two pluggable database new, new2 and now:
SQL> alter pluggable database new close immediate ;
Pluggable database altered.
SQL> alter pluggable database new2 close immediate ;
Pluggable database altered.
Unplug database included with xml file:
SQL> alter pluggable database new unplug into '/u01/app/oracle/oradata/new.xml';
Pluggable database altered.
SQL> alter pluggable database new2 unplug into '/u01/app/oracle/oradata/new_2.xml';
Pluggable database altered.
Pluggable Database Part 3
Osama Mustafa Page 2
Drop Database:
SQL> drop pluggable database new keep datafiles ;
Pluggable database dropped.
SQL> drop pluggable database new2 keep datafiles ;
Pluggable database dropped.
Make sure you drop database:
SQL> select pdb_name, status from cdb_pdbs ;
PDB_NAME STATUS
----------- -------------
PDB$SEED NORMAL
Before Plug Database to any Container you need to make sure from compatibility, there's PL/SQL code
written by Oracle to check compatibility.
SQL > DECLARE
compatible BOOLEAN := FALSE;
BEGIN
compatible := DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
pdb_descr_file => '/u01/app/oracle/oradata/new.xml');
if compatible then
DBMS_OUTPUT.PUT_LINE('Is pluggable PDB1 compatible? YES');
else DBMS_OUTPUT.PUT_LINE('Is pluggable PDB1 compatible? NO');
end if;
END;
/
Is pluggable PDB1 compatible? YES
PL/SQL procedure successfully completed.
Pluggable Database Part 3
Osama Mustafa Page 3
The same will be for new2.xml
Now Let’s Create Database Using With Two Way:
SQL> create pluggable database newdb_plug using '/u01/app/oracle/oradata/new.xml' nocopy tempfile
reuse ;
Pluggable database created.
SQL> select pdb_name, status from cdb_pdbs;
PDB_NAME STATUS
------------------ -------------
NEWDB_PLUG NEW
PDB$SEED NORMAL
Another method to plug database:
SQL> create pluggable database new_plug_copy using '/u01/app/oracle/oradata/new_2.xml'
2 copy
3 FILE_NAME_CONVERT=('/u01/app/oracle/oradata/New2','/u01/app/oracle/oradata/new_plug_copy');
Pluggable database created.
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
NEWDB_PLUG MOUNTED
NEW_PLUG_COPY MOUNTED
Therefore
 Copy Clause :
o if you want the files listed in the XML file to be copied to the new location and used for
the new PDB.
 Nocopy Clause
o if you want the files for the PDB to remain in their current locations.
Pluggable Database Part 3
Osama Mustafa Page 4
But what if i want to move all datafiles and create new pluggable database, oracle 12c provide you with
new clause to do this which is "move" check below:
SQL> create pluggable database new_plug_move using '/u01/app/oracle/oradata/new_2.xml'
2 move
3 FILE_NAME_CONVERT=('/u01/app/oracle/oradata/New2','/u01/app/oracle/oradata/move');
create pluggable database new_plug_move using '/u01/app/oracle/oradata/new_2.xml'
*
ERROR at line 1:
ORA-65122: Pluggable database GUID conflicts with the GUID of an existing container.
The above error is normal because i already create pluggable database using new_2.xml to solve it
SQL> create pluggable database new_plug_move as clone using '/u01/app/oracle/oradata/new_2.xml'
2 move
3 FILE_NAME_CONVERT=('/u01/app/oracle/oradata/New2','/u01/app/oracle/oradata/move');
Pluggable database created.
SQL> select pdb_name, status from cdb_pdbs;
PDB_NAME STATUS
------------------- -------------
NEWDB_PLUG NEW
PDB$SEED NORMAL
NEW_PLUG_COPY NEW
NEW_PLUG_MOVE NEW
You can open any database now and work on them.
Thank you
Osama Mustafa

More Related Content

PDF
Pluggable database tutorial 2
PDF
Pluggable database tutorial
PDF
Enable oracle database vault
PDF
12c installation
PDF
Upgrade Oracle Database to 12c
DOCX
Upgrade EBS DB from 11g to 12c.
PDF
Oracle to MySQL DatabaseLink
PDF
Rac&asm
Pluggable database tutorial 2
Pluggable database tutorial
Enable oracle database vault
12c installation
Upgrade Oracle Database to 12c
Upgrade EBS DB from 11g to 12c.
Oracle to MySQL DatabaseLink
Rac&asm

What's hot (20)

PDF
Refresh development from productions
PDF
Install and upgrade Oracle grid infrastructure 12.1.0.2
PDF
12c on RHEL7
PDF
Are You Ready for 12c? Data Migration and Upgrade Best Practices
PDF
Step by Step to Install oracle grid 11.2.0.3 on solaris 11.1
PDF
Oracle business intelligence enterprise edition 11g
PDF
Ebs clone r12.2.4
DOCX
Upgrading mysql version 5.5.30 to 5.6.10
DOC
Schema replication using oracle golden gate 12c
PDF
Install oracle grid infrastructure on linux 6.6
PDF
Oracle Linux 7 Beta First Look (Installations)
DOCX
Physical_Standby_Database_R12.2.4
PDF
Deploy agent in em12c
DOCX
Mater,slave on mysql
DOCX
My sql storage engines
PPTX
Eouc 12 on 12c osama mustafa
DOC
EMC Networker installation Document
PDF
Installing oracle timesten database On Linux
DOCX
Oracle 12cR2 RAC Database Software Installation and Create Database
PDF
Installing oracle grid infrastructure and database 12c r1
Refresh development from productions
Install and upgrade Oracle grid infrastructure 12.1.0.2
12c on RHEL7
Are You Ready for 12c? Data Migration and Upgrade Best Practices
Step by Step to Install oracle grid 11.2.0.3 on solaris 11.1
Oracle business intelligence enterprise edition 11g
Ebs clone r12.2.4
Upgrading mysql version 5.5.30 to 5.6.10
Schema replication using oracle golden gate 12c
Install oracle grid infrastructure on linux 6.6
Oracle Linux 7 Beta First Look (Installations)
Physical_Standby_Database_R12.2.4
Deploy agent in em12c
Mater,slave on mysql
My sql storage engines
Eouc 12 on 12c osama mustafa
EMC Networker installation Document
Installing oracle timesten database On Linux
Oracle 12cR2 RAC Database Software Installation and Create Database
Installing oracle grid infrastructure and database 12c r1
Ad

Viewers also liked (11)

PDF
Oracle obia 11.1.1.10.1 installation
DOCX
Obia11.1.1.10.1 installation and configuration on Unix platform
PDF
Add target manually em12c
PDF
Oracle Enterprise manager 13c Installation
PDF
Oracle BI Apps 11.1.1.8.1 Installation steps using 12c Database on Linux Redh...
PDF
Exadata Smart Scan - What is so smart about it?
PDF
Oracle smart flash cache
PDF
AWR & ASH Analysis
PPTX
Migrating to Oracle Database 12c: 300 DBs in 300 days.
PDF
Erp installation r12.2
PDF
Enable Mobile Apps Designer in OBIEE
Oracle obia 11.1.1.10.1 installation
Obia11.1.1.10.1 installation and configuration on Unix platform
Add target manually em12c
Oracle Enterprise manager 13c Installation
Oracle BI Apps 11.1.1.8.1 Installation steps using 12c Database on Linux Redh...
Exadata Smart Scan - What is so smart about it?
Oracle smart flash cache
AWR & ASH Analysis
Migrating to Oracle Database 12c: 300 DBs in 300 days.
Erp installation r12.2
Enable Mobile Apps Designer in OBIEE
Ad

Similar to Pluggable database 3 (20)

PPTX
Oracle 12c - Multitenant Feature
PDF
PDF
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
PDF
The Ultimate Guide to Oracle database security administration 1 z0 116
PDF
One PDB to go, please!
PPT
173955573244324324324424322adsadsaasd.ppt
PDF
Cdb part i
PPTX
Using oracle12c pluggable databases to archive
PPTX
OEM12c, DB12c and You! - RMOUG TD2014 Edition
PDF
How to create a pluggable database by cloning an existing local pdb
PDF
Under The Hood of Pluggable Databases by Alex Gorbachev, Pythian, Oracle OpeW...
PPTX
Simplify Consolidation with Oracle Pluggable Databases
PDF
Exploring Oracle Database 12c Multitenant best practices for your Cloud
PDF
Oracle enterprise manager 12c migrate to pluggable database
PDF
Oracle 12c PDB insights
PDF
2017 10-oow-fma-application-containers-v01-final
PDF
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
PDF
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
PPTX
Oracle Database 12.1.0.2 New Features
PPTX
apex-42-in-12c-1970039.pptx apex oracle
Oracle 12c - Multitenant Feature
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
The Ultimate Guide to Oracle database security administration 1 z0 116
One PDB to go, please!
173955573244324324324424322adsadsaasd.ppt
Cdb part i
Using oracle12c pluggable databases to archive
OEM12c, DB12c and You! - RMOUG TD2014 Edition
How to create a pluggable database by cloning an existing local pdb
Under The Hood of Pluggable Databases by Alex Gorbachev, Pythian, Oracle OpeW...
Simplify Consolidation with Oracle Pluggable Databases
Exploring Oracle Database 12c Multitenant best practices for your Cloud
Oracle enterprise manager 12c migrate to pluggable database
Oracle 12c PDB insights
2017 10-oow-fma-application-containers-v01-final
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Oracle Multitenant Database 2.0 - Improvements in Oracle Database 12c Release 2
Oracle Database 12.1.0.2 New Features
apex-42-in-12c-1970039.pptx apex oracle

More from Osama Mustafa (19)

PDF
Case study for software architect
PPTX
DevOps for database
PPTX
Does cloud mean the end of the dba
PDF
Using git hub for your code
PDF
DevOps Project
PDF
Java business service
PDF
Steps creating data_integration_services
PDF
Build, Deploy and Run Node Js Application on Azure using Docker
PDF
Oracle api gateway installation as cluster and single node
PDF
Helping implementer dealing with famous siebel based system messages and er...
PPTX
Weblogic and docker
PPTX
Weblogic 101 for dba
PDF
OBIA Installation
PDF
Install oracle siebel on windows 2008 r2
PDF
Oracle autovue
PDF
Install oracle solaris 11.2 using gui
PDF
How to apply new patch on siebel 8.2.2.4
PDF
J2ee user managment using dwh builder
PDF
How to add storage to esxi 5.5
Case study for software architect
DevOps for database
Does cloud mean the end of the dba
Using git hub for your code
DevOps Project
Java business service
Steps creating data_integration_services
Build, Deploy and Run Node Js Application on Azure using Docker
Oracle api gateway installation as cluster and single node
Helping implementer dealing with famous siebel based system messages and er...
Weblogic and docker
Weblogic 101 for dba
OBIA Installation
Install oracle siebel on windows 2008 r2
Oracle autovue
Install oracle solaris 11.2 using gui
How to apply new patch on siebel 8.2.2.4
J2ee user managment using dwh builder
How to add storage to esxi 5.5

Recently uploaded (20)

PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
PDF
Google’s NotebookLM Unveils Video Overviews
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
PDF
Event Presentation Google Cloud Next Extended 2025
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Why Endpoint Security Is Critical in a Remote Work Era?
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
PDF
Doc9.....................................
PPTX
ABU RAUP TUGAS TIK kelas 8 hjhgjhgg.pptx
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
Software Development Methodologies in 2025
PPTX
How Much Does It Cost to Build a Train Ticket App like Trenitalia in Italy.pptx
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Google’s NotebookLM Unveils Video Overviews
Revolutionize Operations with Intelligent IoT Monitoring and Control
Event Presentation Google Cloud Next Extended 2025
NewMind AI Monthly Chronicles - July 2025
agentic-ai-and-the-future-of-autonomous-systems.pdf
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI Weekly Chronicles - August'25 Week I
Why Endpoint Security Is Critical in a Remote Work Era?
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Doc9.....................................
ABU RAUP TUGAS TIK kelas 8 hjhgjhgg.pptx
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Software Development Methodologies in 2025
How Much Does It Cost to Build a Train Ticket App like Trenitalia in Italy.pptx
Transforming Manufacturing operations through Intelligent Integrations
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf

Pluggable database 3

  • 1. Pluggable Database Part 3 Osama Mustafa Page 1 Since Pluggable Database is New Topic to post about , I Cannot post Everything in One Post so i decide to do it as tutorial and this one part (3) , every Topics uploaded Here on my blog or on my Account on Shareslide here. In This topic:  How to unplug database.  Plugging Database to another Container Database. Let's Start : SQL> select name, con_id from v$active_services ; NAME CON_ID --------------------------------- ---------- new2 4 new 3 db12cXDB 1 db12c 1 SYS$BACKGROUND 1 SYS$USERS 1 As you see i already create two pluggable database new, new2 and now: SQL> alter pluggable database new close immediate ; Pluggable database altered. SQL> alter pluggable database new2 close immediate ; Pluggable database altered. Unplug database included with xml file: SQL> alter pluggable database new unplug into '/u01/app/oracle/oradata/new.xml'; Pluggable database altered. SQL> alter pluggable database new2 unplug into '/u01/app/oracle/oradata/new_2.xml'; Pluggable database altered.
  • 2. Pluggable Database Part 3 Osama Mustafa Page 2 Drop Database: SQL> drop pluggable database new keep datafiles ; Pluggable database dropped. SQL> drop pluggable database new2 keep datafiles ; Pluggable database dropped. Make sure you drop database: SQL> select pdb_name, status from cdb_pdbs ; PDB_NAME STATUS ----------- ------------- PDB$SEED NORMAL Before Plug Database to any Container you need to make sure from compatibility, there's PL/SQL code written by Oracle to check compatibility. SQL > DECLARE compatible BOOLEAN := FALSE; BEGIN compatible := DBMS_PDB.CHECK_PLUG_COMPATIBILITY( pdb_descr_file => '/u01/app/oracle/oradata/new.xml'); if compatible then DBMS_OUTPUT.PUT_LINE('Is pluggable PDB1 compatible? YES'); else DBMS_OUTPUT.PUT_LINE('Is pluggable PDB1 compatible? NO'); end if; END; / Is pluggable PDB1 compatible? YES PL/SQL procedure successfully completed.
  • 3. Pluggable Database Part 3 Osama Mustafa Page 3 The same will be for new2.xml Now Let’s Create Database Using With Two Way: SQL> create pluggable database newdb_plug using '/u01/app/oracle/oradata/new.xml' nocopy tempfile reuse ; Pluggable database created. SQL> select pdb_name, status from cdb_pdbs; PDB_NAME STATUS ------------------ ------------- NEWDB_PLUG NEW PDB$SEED NORMAL Another method to plug database: SQL> create pluggable database new_plug_copy using '/u01/app/oracle/oradata/new_2.xml' 2 copy 3 FILE_NAME_CONVERT=('/u01/app/oracle/oradata/New2','/u01/app/oracle/oradata/new_plug_copy'); Pluggable database created. SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY NEWDB_PLUG MOUNTED NEW_PLUG_COPY MOUNTED Therefore  Copy Clause : o if you want the files listed in the XML file to be copied to the new location and used for the new PDB.  Nocopy Clause o if you want the files for the PDB to remain in their current locations.
  • 4. Pluggable Database Part 3 Osama Mustafa Page 4 But what if i want to move all datafiles and create new pluggable database, oracle 12c provide you with new clause to do this which is "move" check below: SQL> create pluggable database new_plug_move using '/u01/app/oracle/oradata/new_2.xml' 2 move 3 FILE_NAME_CONVERT=('/u01/app/oracle/oradata/New2','/u01/app/oracle/oradata/move'); create pluggable database new_plug_move using '/u01/app/oracle/oradata/new_2.xml' * ERROR at line 1: ORA-65122: Pluggable database GUID conflicts with the GUID of an existing container. The above error is normal because i already create pluggable database using new_2.xml to solve it SQL> create pluggable database new_plug_move as clone using '/u01/app/oracle/oradata/new_2.xml' 2 move 3 FILE_NAME_CONVERT=('/u01/app/oracle/oradata/New2','/u01/app/oracle/oradata/move'); Pluggable database created. SQL> select pdb_name, status from cdb_pdbs; PDB_NAME STATUS ------------------- ------------- NEWDB_PLUG NEW PDB$SEED NORMAL NEW_PLUG_COPY NEW NEW_PLUG_MOVE NEW You can open any database now and work on them. Thank you Osama Mustafa