Introduction:
Creating a new Pluggable Database (PDB) in Oracle is a routine task for DBAs. However, errors like ORA-65122: Pluggable database GUID conflicts with the GUID of an existing container can sometimes arise, particularly when using the CREATE PLUGGABLE DATABASE command. In this blog, we’ll explore a real-world scenario where this error occurred, analyze its cause, and provide steps to resolve it effectively.
Error: ORA-65122: Pluggable database GUID conflicts with the GUID of an existing container.
SQL> create pluggable database TEST2_NEW using ‘/tmp/dba/PROD2_txfr.xml’ nocopy tempfile reuse; create pluggable database TEST2_NEW using ‘/tmp/dba/PROD2_txfr.xml’ nocopy tempfile reuse
* ERROR at line 1: ORA-65122: Pluggable database GUID conflicts with the GUID of an existing container.
Cause: The ORA-65122 error occurs when the GUID (Globally Unique Identifier) of the new PDB being created matches the GUID of an existing PDB or container. In this case, the source file (PROD2_txfr.xml) used for creating the PDB contained metadata that resulted in a GUID conflict with an existing container.
This issue often arises when using the USING clause with XML metadata generated from an existing database or when a PDB is being recreated from a source that retains its original GUID.
Solution:
To resolve this, the AS CLONE clause was added to the creation command. This clause instructs Oracle to treat the new PDB as a clone of the source, generating a unique GUID to avoid conflicts. The modified command was:
SQL> create pluggable database TEST2_NEW as clone using ‘/tmp/dba/PROD2_txfr.xml’ nocopy tempfile reuse;
Pluggable database created.
SQL> sho pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
2 PDB$SEED READ ONLY NO
3 TEST2_NEW MOUNTED
SQL>
Conclusion:
Errors like ORA-65122 can interrupt routine DBA operations, but understanding their root cause and using features like the AS CLONE clause can provide an efficient resolution. This scenario highlights the importance of careful planning and testing during PDB creation to ensure a smooth process. By adopting the best practices outlined above, you can avoid similar issues and enhance database operations in your Oracle environment.