Introduction

Oracle Database 12.2 introduced the concept of a refreshable clone pluggable database (PDB). Oracle 19c enables you to switch the roles of a source PDB and a refreshable PDB. This functionality is known as refreshable PDB switchover.

Since the introduction of the cloning method, several options have been added, from command-line methods using database links to the latest method using Database Configuration Assistant (DBCA).

The following image shows the architecture for cloning a PDB from one container database (CDB) to another CDB.

image

High-Level Steps:

  1. Create source and target database systems with pluggable databases (PDBs).
  2. Create a common user and grant appropriate privileges on both the source and target database systems.
  3. Configure a database link on both the source and target database systems.
  4. Verify connectivity through the database link.
  5. Configure external keystore credentials on both the source and target database systems.
  6. Insert data into the source database system.
  7. Create a pluggable database on the target database system using the cloning method.
  8. Check the status of both the source and target database systems to ensure readiness for switchover.
  9. Initiate the switchover between the pluggable databases running on the source and target database systems.
  10. Verify the status of both systems after the switchover.
  11. Address any issues and perform troubleshooting as needed.

Note: Ensure network connectivity is established between the source and target database systems, and that the required ports are open.

Objectives

Create PDB clone between two multi-tenant database systems and perform a switchover.

Prerequisites

Task 1: Create source and target db system

Sign in to the OCI Console and create two two database systems.

image

image

image

Task 2: Create common user on both source and target database systems

Create the user under the root container for all pluggable databases (PDBs). Grant only the required permissions.

image

image

Task 3: Check if TDE is configured and configure external key store if not configured

Sign in to the database system and check if Transparent Data Encryption (TDE) is configured.

image

image

image

image

image

image

image

image

image

image

image

Task 4: Connect the source and target database systems

  1. Verify that the necessary services are running on both database systems.

    image

    image

  2. Update the tnsnames.ora file on both systems with the required details.

    image

    image

    image

    image

  1. Create a database link from the source to the target database.

    image

    image

  2. Create a database link from the target to the source database.

    image

  3. Insert sample data into the source database system.

    image

    image

  1. Sign in to the target database system and execute the following command:

    image

  2. Verify that the clone is complete and open the new cloned PDB in read-only mode. To ensure the latest data, refresh the clone before opening it.

    image

    image

    image

  3. Check the status of both database systems after the clone operation.

    image

    image

Task 7: Issues and Troubleshooting

Issue1: External keystore not defined If the external key store is not defined, you will encounter the following error during switchover:

ERROR at line 1: ORA-60520: unable to switchover when a TDE SEPS wallet is not configured

Make sure that the external key store is configured to avoid this issue.

Conclusion

The significant takeaway from this method is that, by using PDB clone switchover, you can easily perform PDB migration between two multi-tenant database systems. For minimal downtime migration requirements, this method functions similarly to a Data Guard setup, where switchover minimizes downtime.

This method should not be considered a full replacement for a Data Guard setup.

About Refreshable Clone PDBs

Acknowledgments

Author: Ashish Srivastava (Principal Cloud Architect, Oracle North America Cloud Services - NACIE)

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.