Clone a Pluggable Database Manually using SQL Prompt

To make a clone of existing pluggable database is exactly similar to creating a new pluggable database from the seed pluggable database.

Note:

  • We are using local pluggable database (non-seed) as the source to clone new pluggable database.
  • Source pluggable database should open in READ ONLY mode.
  • I will simulate scenario with the help of pluggable database: NEWPDB

// Ensure your pluggable database is in READ ONLY mode, if not then convert it into READ ONLY.

SQL> select name,open_mode from v$pdbs;

NAME OPEN_MODE
—————————— ———-
PDB$SEED READ ONLY
NEWPDB READ WRITE

// NEWPDB database is in READ WRITE mode, issue the following to make it READ ONLY:

SQL> alter pluggable database newpdb close immediate;

Pluggable database altered.

SQL> alter pluggable database newpdb open read only;

Pluggable database altered.

// Ensure changes by following query:

SQL> select name,open_mode from v$pdbs;

NAME OPEN_MODE
—————————— ———-
PDB$SEED READ ONLY
NEWPDB READ ONLY

// NEWPDB pluggable database is in READ ONLY mode.

// Issue following to create clone from existing pluggable database.

SQL> CREATE PLUGGABLE DATABASE clonepdb FROM newpdb FILE_NAME_CONVERT=(‘/u01/app/oracle/oradata/newpdb/’,’/u01/app/oracle/oradata/clonepdb/’);

Pluggable database created.

// Switch back the source pluggable database to READ WRITE mode, i.e. newpdb

SQL> alter pluggable database newpdb open read write;

Pluggable database altered.

 

Your pluggable database is ready to use. cheers!!

***********************************************************************

Note: Please don’t hesitate to revert in case of any query OR feedback.

Thanking you.

Have a easy life ahead.

Leave a Reply

%d bloggers like this: