Pluggable Database Cloning


SQL> conn / as sysdba
Connected.
SQL> alter pluggable database PDB2 close;
Pluggable database altered.
SQL> select con_id, name, open_mode from v$pdbs;
CON_ID NAME OPEN_MODE
---------- ------------------------------ ----------
 2 PDB$SEED READ ONLY
 3 PDB1 READ WRITE
 4 PDB2 MOUNTED
SQL> alter pluggable database PDB2 open read only;
Pluggable database altered.
SQL> select con_id, name, open_mode from v$pdbs;
CON_ID NAME OPEN_MODE
---------- ------------------------------ ----------
 2 PDB$SEED READ ONLY
 3 PDB1 READ WRITE
 4 PDB2 READ ONLY
SQL> create pluggable database PDB3 from PDB2 file_name_convert = ('PDB2','PDB3');
Pluggable database created.
SQL> select con_id, name, open_mode from v$pdbs;
CON_ID NAME OPEN_MODE
---------- ------------------------------ ----------
 2 PDB$SEED READ ONLY
 3 PDB1 READ WRITE
 4 PDB2 READ ONLY
 5 PDB3 MOUNTED
SQL> alter pluggable database PDB3 open;
Pluggable database altered.
SQL> select con_id, name, open_mode from v$pdbs;
CON_ID NAME OPEN_MODE
---------- ------------------------------ ----------
 2 PDB$SEED READ ONLY
 3 PDB1 READ WRITE
 4 PDB2 READ ONLY
 5 PDB3 READ WRITE
SQL> alter pluggable database PDB2 close;
Pluggable database altered.
SQL> select con_id, name, open_mode from v$pdbs;
CON_ID NAME OPEN_MODE
---------- ------------------------------ ----------
 2 PDB$SEED READ ONLY
 3 PDB1 READ WRITE
 4 PDB2 MOUNTED
 5 PDB3 READ WRITE
SQL> alter pluggable database PDB2 open;
Pluggable database altered.
SQL> select con_id, name, open_mode from v$pdbs;
CON_ID NAME OPEN_MODE
---------- ------------------------------ ----------
 2 PDB$SEED READ ONLY
 3 PDB1 READ WRITE
 4 PDB2 READ WRITE
 5 PDB3 READ WRITE
SQL>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: