19c multi-tenant
From: Hameed Amir <"Hameed>
Date: Fri, 12 May 2023 15:32:48 +0000
Message-ID: <CH0PR14MB5012262E4451538C012E12A5E0759_at_CH0PR14MB5012.namprd14.prod.outlook.com>
Hi folks,
In a multitenant environment, does the following query always return values from the CDB even if run from a PDB?
Date: Fri, 12 May 2023 15:32:48 +0000
Message-ID: <CH0PR14MB5012262E4451538C012E12A5E0759_at_CH0PR14MB5012.namprd14.prod.outlook.com>
Hi folks,
In a multitenant environment, does the following query always return values from the CDB even if run from a PDB?
SELECT db_name, db_unique_name FROM v$database ;
We are upgrading our Oracle EBS database from 11g to 19c and at any place where the custom code is getting the DB name using the query "SELECT name INTO l_dbname FROM v$database", it is failing because the query is returning the CDB name instead of the PDB's.
- I am assuming that this is the expected behavior where the DB_NAME and UNIQUE_DB_NAME when queries from V$DATABASE from any PDB always return values from the CDB.
- Is the best way to get the PDB name to use the following query? SELECT SYS_CONTEXT('userenv','db_name') FROM dual ;
Thank you,
Amir
-- http://www.freelists.org/webpage/oracle-lReceived on Fri May 12 2023 - 17:32:48 CEST