Posted by Shaik Ahmed Ali on December 08, 2020 |
No comments
Hello Everyone,
The Cloning of a database is a cool feature to have an environment where we can test our things.
In the earlier release of 12c which is 12.1.0.1, we have limitations while cloning a PDB where we need to keep our PDB in read-only mode and create a directory manually but you cant keep your production database in read-only mode.
Now in 12.1.0.2, there is an enhancement in cloning we can now clone our PDB while the production database in read-write mode yes you here it correct a pretty cool feature where we can clone a single PDB keeping our PDB in read-write mode and no need to create the directory manually.
in this article, I will demonstrate the cloning of PDB locally as well as remotely
Let us get started with the practical:
Cloning a PDB in Same CDB:
Connect to CDB and check the PDB in read-write mode or not
Let's check the datafile location of the ORCL PDB database
.
Let us create a pluggable database using the below command:
create pluggable database orclclone from orcl file_name_convert='claim_pdb','orclclone');
The above command performs the following task:
- create the new PDB(ORCLCLONE) from the existing PDB(ORCL)
- It also creates the new directory for the new PDB and copies the source PDB datafile to a new location
Alert log during the cloning of PDB, from the above alert log we can see some WARNING let check using PDB_PLUG_IN_VIOLATIONS
From the above SS, I can see there are warning not the error. this is my test environment I can ignore but I recommend you to solve in production.
Now check the PDBS is created or not and in which state
So from the above screenshot, I can see PDB clone "ORCLCLONE" is created and in a mounted state
Let's open the ORCLCLONE PDB in read-write mode.
We can see from the above SS that we have successfully opened the ORCLCLONE PDB in read-write mode. Now connect to the Cloned PDB and check the data file as below SS.
So we have successfully cloned the PDB in the existing CDB without keeping the source PDB in Read-only mode.
Cloning a PDB to a remote CDB:
Connect to the new CDB and check the PDBs
Let us create the database link in the new CDB(remote)
create database link cdb1 connect to system identified by password using 'host:port/servicename'
After creating the link let's clone the PDB from the target CDB as shown in the below SS
Yes we have successfully Clone the PDB remotely let's open the newly clone PDB
Check the datafile location now
Hence we have successfully cloned a PDB in a remote CDB.
I hope this article helps you to clone a PDB in 12.1.0.2 without keeping the PDB in read-only mode.
Thank you for reading the article.
0 comments:
Post a Comment