Cloning Pluggable Database
Well, the first question is what is a pluggable database. In Oracle 12c, Oracle has introduced a multi-tenancy database methodology, and you will see two acronyms all the time “CDB” meaning “Container Database” and PDB is an acronym for “Pluggable Database”. A quick analogy would be to think of a train to understand the difference, you have a train with an engine “CDB” and lets say up to 250 rail cars the “PDB” as working databases. Each car has specific content targeted for specific customers and they are packed and sealed independently specific to the customer. This methodology allows for a better use of resources and controls for large Enterprise setups or to be able to run multiple large enterprise setups within the same architecture. So cloning a database within this type of environment is actually very straight forward.
- Log into your container database.
- Close the Pluggable Database you want to clone: alter pluggable database <pdb_name> close immediate;
- Open the Pluggable Database in read only mode: alter pluggable database <pdb_name> open read only;
- Create a new directory to place the oracle database files: /u01/newpdb
- In SQL*Plus: alter system set db_create_file_dest=’/u01/newpdb’;
- Now its time to clone:
CREATE PLUGGABLE DATABASE newpdb FROM oldpdb
PATH_PREFIX = ‘/u01/newpdb’;
- alter pluggable database newpdb open;