in reply to Re^2: [OT] Get the database name in Oracle
in thread [OT] Get the database name in Oracle

it is not working for me! :( Here is the output when I tried in SQL plus window: SQL> select name from v$database; select name from v$database * ERROR at line 1: ORA-00942: table or view does not exist
  • Comment on Re^3: [OT] Get the database name in Oracle

Replies are listed 'Best First'.
Re^4: [OT] Get the database name in Oracle
by Anonymous Monk on May 30, 2015 at 06:15 UTC
    Try this one : select ora_database_name from dual;

      You're late, the thread is almost 10 years old, and that answer came in 6 years ago;-)

Re^4: [OT] Get the database name in Oracle
by Anonymous Monk on Dec 16, 2010 at 20:43 UTC
    You don't have the permissions to read v$database. Hint: grant select to this view or do the "dba" role to user (at your own risk)
Re^4: [OT] Get the database name in Oracle
by Anonymous Monk on Jun 05, 2012 at 05:31 UTC
    You might haven't connected to any database yet.
Re^4: [OT] Get the database name in Oracle
by Anonymous Monk on Apr 20, 2010 at 00:49 UTC
    I am also facing same problem
      this view need to be granted from DBA. SELECT SUBSTR (GLOBAL_NAME, 1, INSTR (GLOBAL_NAME, '.') - 1) FROM GLOBAL_NAME ;