Saturday, 11 March 2017

ORA-65149: PDB name conflicts with existing service name

During my recent non-CDB to PDB conversion, I got the error:

ORA-65149: PDB name conflicts with existing service name in the CDB or the PDB

Its a bit weird because the non-CDB database was still not plugged-in and was just checked for compatibility using procedure..



SET SERVEROUTPUT ON
DECLARE
compatible CONSTANT VARCHAR2(3) :=
CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
pdb_descr_file => '/tmp/noncdb_pdb.xml',
pdb_name => 'PINDBA')
WHEN TRUE THEN 'YES'
ELSE 'NO'
END;
BEGIN
DBMS_OUTPUT.PUT_LINE(compatible);
END;
/

With this error in plugging-in database, I could see there was this warning appearing in PDB_PLUG_IN_VIOLATIONS view

NAME    CAUSE                    TYPE  
------- --------------------- -------
IONDBA  Service Name Conflict WARNING

MESSAGE                         
---------------------------------
Service name or network name of 
service IONDBA in the PDB is
invalid or conflicts with an
existing service name or network
name in the CDB.


The message is pretty clear that the service name IONDBA in PDB conflicts with service name in CDB.

So I checked what services are listed in CDB (root container):

SELECT name,
network_name
FROM   dba_services
ORDER BY name
/

NAME                 NETWORK_NAME
-------------------- ------------
IONDBA               IONDBA
SYS$BACKGROUND
SYS$USERS


There it is, lets delete this service and try CREATE PLUGGABLE DATABASE:

SQL> exec DBMS_SERVICE.DELETE_SERVICE('IONDBA');

PL/SQL procedure successfully completed.


Ran compatibility check again and the warning disappeared from PDB_PLUG_IN_VIOLATIONS.

This time the database was plugged-in without issues:

SQL> CREATE PLUGGABLE DATABASE IONDBA USING '/tmp/noncdb_pdb.xml'
NOCOPY TEMPFILE REUSE;

Pluggable Database Created.

Seems like the problem was because I migrated the listener.ora from old 11g home and it dynamically registered its services to CDB. Also updated listener.ora afterwards.

Cheers!
Anurag

1 comment: