Skip to Main Content

SQL & PL/SQL

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!

Return CDB/PDB name in case of 12c ( Multitenant DB )

USER101Jan 31 2019 — edited Feb 1 2019

Hello experts,

Please can someone help me with this query ? Currently I run this query to identify the instance name in 11g but we have gone to 12.2 with the PDB and CDB.. Obviously running this query returns the CDB name for INSTANCE_NAME.

Is there a way to generate the name of the PDB if it is 12c and if 11g, return the instance name ?

select  INSTANCE_NAME,

        HOST_NAME,

        VERSION,

        STARTUP_TIME,

        STATUS,

        DATABASE_STATUS

from v$instance;

As you see below, the query now returns the CDB instance name in case of 12c, rather than PDB name. Is it possible to have something like "TCDBGQ061 - PDB_NAME" if it is a 12c container ?

INSTANCE_NAME

----------------

HOST_NAME

----------------------------------------------------------------

VERSION           STARTUP_T STATUS       DATABASE_STATUS

----------------- --------- ------------ -----------------

TCDBGQ061

xcu01d************

12.2.0.1.0        25-JAN-19 OPEN         ACTIVE

Thanks in advance

This post has been answered by Hans Steijntjes on Jan 31 2019
Jump to Answer
Comments
Post Details
Added on Jan 31 2019
10 comments
1,681 views