Jeff
Jeff

Reputation: 8148

Determining Oracle Database Instance

Other than querying the v_$database and v_$instance tables (or the views v$instance, v$database) is there any other way to programtically retrieve (from PL/SQL) the database name of an oracle database?

Upvotes: 4

Views: 308

Answers (2)

Jeff
Jeff

Reputation: 8148

Found the following on Experts Exchange:

select ora_database_name from dual;
select sys_context('userenv','db_name') from dual;
select global_name from global_name;

http://www.experts-exchange.com/Databases/Oracle/Q_20529577.html

Upvotes: 5

dpbradley
dpbradley

Reputation: 11915

dbms_standard.database_name

Upvotes: 6

Related Questions