Database Cloning
MODS Regular provides basically three clone types for pluggable databases in Oracle Enterprise Edition and Oracle Standard Edition 2:
- SNAPSHOT (blue): The cloned PDB is based on a snapshot of its source and has the same content but not the same size.
- FULL (green and yellow): The cloned PDB is a 1:1 copy of its source and has the same content and size.
- RESTORE: The cloned PDB is a point-in-time restore of its source.
All clone types work for BASIC and ADVANCED CDB deployments with some characteristics (see below). A PDB clone of type SNAPSHOT or FULL remains always in the same CDB while clones of type RESTORE support cross-container cloning respectively restore as well. If backup is enabled on CDB level cloned PDBs are backed up as any other PDB and can be restored if needed.
SNAPSHOT Clone
The cloned PDB is created as instant snapshot based of the source PDB. A snapshot uses initially almost no storage because unchanged data in the clone PDB refers its source. The size of a snapshot clone grows only with its changes. Typically, snapshot clones are used for development databases because they are storage efficient and the clone operation is fast and independent of the database size.
Some further characteristics of SNAPSHOT clones:
- A snapshot depends technically on its source which is why the source cannot be deleted as long as any snapshots refer to it.
- A source PDB must be open readonly as long as any snapshots depend on it
- The clone workflow changes the source PDB automatically to readonly state when the first snapshot clone is created
- The workflow reverts the source PDB automatically back to read/write when the last dependent snapshot is deleted.
- A source PDB can have more than one snapshot clone PDBs which depend on it.
- A snapshot clone PDB cannot act as source for another snapshot clone PDB. In other words, snapshots of snapshots are not supported.
- A snapshot clone PDB is not replicated in ADVANCED CDB deployments (standbys=none clause in create PDB command). Therefore, a snapshot PDB is only created in the current primary database and it is not available anymore after a failover operation.
FULL Clone
The cloned PDB is a 1:1 copy of its source in terms of content and size. During the clone creation all source datafiles are copied over to its clone location. Therefore, the clone creation time depends on the source PDB size and consumes the same amount of storage amount as the clone. Typically, this clone type is used for production and development databases.
Some further characteristics of FULL clones:
- The full clone PDB is completely independent of its source PDB once the clone operation is finished
- The source for a full clone PDB can be a regular PDB or a snapshot clone PDB
- If the source PDB is a snapshot clone the new full clone will be fully materialized (unchanged and changed data of the snapshot)
- Full clone PDBs can be either replicated (standbys=all) or not replicated (standbys=none) in ADVANCED CDB deployments
- Replicated means the full clone PDB is created on the standby site as well and available after a switchover or failover
- Not replicated full clone PDBs are not available anymore after a switchover or failover
RESTORE Clone
The cloned PDB is a 1:1 copy of its source for the given point-in-time. During the clone operation all datafiles are restored from the backup to the destination CDB. The clone creation time depends on the source PDB size in the backup system. Typically, this clone type is used for production and development databases. Because it is based on the backup older states can be cloned, e.g. for analyzing an issue from the past.
Some further characteristics of RESTORE clones:
- The restore clone PDB is completely independent of its source PDB once the clone operation is finished
- The source for a restore clone PDB can be a regular PDB or a full clone PDB
- The CDB of the source PDB must have backup enabled
- The clone operation requires a timestamp within the backup retention for the restore
- Restore clone PDBs can be either replicated (standbys=all) or not replicated (standbys=none) in ADVANCED CDB deployments
- Replicated means the restored clone PDB is created on the standby site as well and available after a switchover or failover
- Not replicated restore clone PDBs are not available anymore after a switchover or failover
- The cloned PDB can be in the same CDB or any other CDB
- The CDB of the target PDB must not have backup enabled
- A restore PDB can be cloned from a BASIC to ADVANCED CDB or vice versa
- The source and target CDB must have the same Oracle RU version, e.g. 19.11
- The source and target CDB must have the same Oracle edition, e.g. Oracle Enterprise Edition