Multitenant Pills – Change DBID for an existing PDB
Ludovico, 3 Jahren ago 1 min read 756
This post was originally published on this site
When you plug the same PDB many times you have to specify “AS COPY” in the syntax:
CREATE PLUGGABLE DATABASE ludo AS CLONE USING '/u01/app/oradata/ludo/ludo.xml';
Otherwise, you will get an error similar to:
ERROR at line 1: ORA-65122: Pluggable database GUID conflicts with the GUID of an existing container.
There are case, however, where you cannot do it. For example, it the existing PDB should have been the clone, or if you are converting a copy of the same database from Non-CDB to PDB using autoupgrade (with autoupgrade you cannot modify the CREATE PLUGGABLE DATABASE statement).
In this case the solution might be to change the DBID of the existing PDB, via unplug/plug:
ALTER PLUGGABLE DATABASE vico CLOSE; ALTER PLUGGABLE DATABASE vico UNPLUG INTO '/u01/app/oradata/ludo/ludo.xml'; DROP PLUGGABLE DATABASE vico KEEP DATAFILES; CREATE PLUGGABLE DATABASE vico AS CLONE USING '/u01/app/oradata/ludo/ludo.xml' NOCOPY; ALTER PLUGGABLE DATABASE vico OPEN; ALTER PLUGGABLE DATABASE vico SAVE STATE;