Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

User-defined service name must be unique across all PDBs ?

Peasant81Aug 10 2022 — edited Aug 10 2022

RDBMS version: 19c in Single instance (Oracle Restart)
OS : Oracle Linux 8.4
In a multitenant environment, I cannot have a user-defined service with the same name in two different PDBs ?
In the below example, I cannot create a user-defined service named test_service1 in PROD_FINANCE PDB because there is already a service named test_service1 PROD_SALES PDB.

$ sqlplus / as sysdba

SQL> show pdbs

   CON_ID CON_NAME                      OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
        2 PDB$SEED                      READ ONLY NO
        <snipped>
        7 DBFS                          READ WRITE NO
        8 PROD_SALES                    READ WRITE NO
        9 PROD_FINANCE                  READ WRITE NO
SQL>
SQL> alter session set container = PROD_SALES;

Session altered.

SQL> exec dbms_service.create_service('test_service1','test_service1');

PL/SQL procedure successfully completed.

SQL> exec dbms_service.start_service('test_service1');

PL/SQL procedure successfully completed.

SQL> alter pluggable database save state;

Pluggable database altered.

SQL> alter session set container = PROD_FINANCE;

Session altered.

SQL> exec dbms_service.create_service('test_service1','test_service1');
BEGIN dbms_service.create_service('test_service1','test_service1'); END;

*
ERROR at line 1:
ORA-44303: service name exists
ORA-06512: at "SYS.DBMS_SERVICE_ERR", line 21
ORA-06512: at "SYS.DBMS_SERVICE", line 316
ORA-06512: at line 1
This post has been answered by Solomon Yakobson on Aug 10 2022
Jump to Answer
Comments
Post Details
Added on Aug 10 2022
2 comments
523 views