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.
High-Level Steps:
- Create source and target database systems with pluggable databases (PDBs).
- Create a common user and grant appropriate privileges on both the source and target database systems.
- Configure a database link on both the source and target database systems.
- Verify connectivity through the database link.
- Configure external keystore credentials on both the source and target database systems.
- Insert data into the source database system.
- Create a pluggable database on the target database system using the cloning method.
- Check the status of both the source and target database systems to ensure readiness for switchover.
- Initiate the switchover between the pluggable databases running on the source and target database systems.
- Verify the status of both systems after the switchover.
- 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
-
Provision the OCI environment, including a compartment, virtual cloud network (VCN), subnet, and other necessary resources.
-
Provision the source and database multi-tenant environment running on Oracle Database 19c.
-
Verify that connectivity is established between the database systems.
Task 1: Create source and target db system
Sign in to the OCI Console and create two two database systems.
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.
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.
Task 4: Connect the source and target database systems
-
Verify that the necessary services are running on both database systems.
-
Update the
tnsnames.ora
file on both systems with the required details.
Task 5: Create a database link between the database systems and verify that it works
-
Create a database link from the source to the target database.
-
Create a database link from the target to the source database.
-
Insert sample data into the source database system.
Task 6: Clone the PDB on the target database system using the link from source database system
-
Sign in to the target database system and execute the following command:
-
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.
-
Check the status of both database systems after the clone operation.
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.
Related Links
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.
Perform a Switchover to a Refreshable Pluggable Database
G43196-01