This is a simple question for a DBA. Use this
query for it.
select
name from v$database;
But a normal user can use this only if there is
select_catalog_role or select privilege on v$database views. What if a user
without select privilege on v$database wants to see the database name? Here are the queries that can be used
select
dbms_standard.database_name() database from dual;
select
sys_context('userenv', 'db_name') from dual;
In Oracle 12c,
ReplyDeleteThis returns pluggable database name
select dbms_standard.database_name() database from dual;
This return container database name
select sys_context('userenv', 'db_name') from dual;