in reply to [OT] Get the database name in Oracle

The v$ tables contain meta information:

select * from v$database;

gets you some basic information (which includes the database name, IIRC).

update (2008-12-22):

Since we seem to be reviving this thread - here is another one:

select ora_database_name from dual

(Oracle 10g)

Replies are listed 'Best First'.
Re^2: [OT] Get the database name in Oracle
by Anonymous Monk on May 28, 2008 at 11:35 UTC
    Well, from erix response, above, I tried the following in sql*plus and it worked: select name from v$database; It'll print the database you're currently loged in.
      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
        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)
        Try this one : select ora_database_name from dual;
        I am also facing same problem
        You might haven't connected to any database yet.