4.7.2 Thin Cloning a Pluggable Database in a Different Container Database

In conjunction with a database link, you can use the CREATE PLUGGABLE DATABASE SQL command to create a writable snapshot copy (clone) of an existing pluggable database (PDB) that resides in a different container database (CDB). For example, the following command creates a clone of pdb1 named pdb1c.

SQL> CREATE PLUGGABLE DATABASE pdb1c
     FROM pdb1@CDB1-link SNAPSHOT COPY;

In this example, the cloned PDB (pdb1c) resides in the CDB processing the SQL command. The original (source) PDB (pdb1) resides in the CDB referenced in the database link (CDB1-link).

When both CDBs use the same Exascale vault, the PDB snapshot copy operation automatically uses native Exascale cloning functionality to thinly provision the underlying Oracle Database files.

The thin cloned PDB data files reside in the same Exascale vault as the underlying source PDB data files, and Exascale uses redirect-on-write techniques to create and maintain the cloned data files. As a result, the cloning operation is instantaneous, regardless of the size of the underlying data files. Also, the clone is extremely space-efficient. A cloned data file initially consumes no additional space, and physical storage space is only allocated when new data is written.

Within the Oracle Database, the cloned files function like regular data files and appear in the standard Oracle Database dictionary views, such as DBA_DATA_FILES. Additionally, you can examine various Exascale-specific file details in the V$EXA_FILE Oracle Database dictionary view.

Within Exascale, you can use the ESCLI lssnapshots command to view the association between the cloned data files and their underlying source files.

You can also use the technique introduced here to clone a PDB residing on an Oracle Data Guard standby database. This approach enables space-efficient test and development databases separate from the primary database.

To clone a PDB from a standby database, you must briefly stop the redo apply process on the standby database while creating the clone. For example

DGMGRL> edit database STANDBY set state='apply-off’;
SQL> CREATE PLUGGABLE DATABASE pdb1test
     FROM pdb1@STANDBY-link SNAPSHOT COPY;
DGMGRL> edit database STANDBY set state='apply-on’;

In this example, the cloned PDB (pdb1test) resides in the CDB processing the SQL command. The original (source) PDB (pdb1) resides in the standby database referenced in the database link (STANDBY-link). As in the earlier case, to use Exascale thin clones, the CDB processing the SQL command must use the same Exascale vault that houses the underlying source PDB data files.

Note:

Regardless of whether the source PDB is an Oracle Data Guard primary or standby database, if you create a thinly provisioned PDB clone on an primary database, the corresponding standby PDB data files contain a complete (not thinly provisioned) copy of the data, even if the standby database uses Exascale storage. To avoid this, you can prevent the PDB clone from propagating to the standby database by including STANDBYS=NONE in the CREATE PLUGGABLE DATABASE SQL command.

Related Topics