Re: show user command useful in sqlplus

From: Roderick Manalac <rmanalac_at_oracle.com>
Date: 27 Sep 1994 05:17:16 GMT
Message-ID: <3689ss$chg_at_dcsun4.us.oracle.com>


akgriggs_at_xmission.com (Al the Pal) writes:
|> noel_at_omega.univ-lille1.fr (Yves Noel) says:
|>
|> >|>
|> >Yes, you connect as SYS under SQLPLUS and : select ksqdngdn from x$ksqdn;
|> >-- ^^^^^^^^ ^^^^^^^
|>
|> I thought I knew Oracle databases pretty well but this is a new one for me.
|> I'm at home as I write this so I have to be a bit fuzzy on the exactness
|> of my answer, but there is a v$ table that is accessible by PUBLIC that
|> stores the instance name. Something like select * from v$session where
|> type = 'dbname' (note case of dbname - the table I have in mind DOES store
|> these values in lower case.)

Since normal users do not have access to X$ tables, there are other alternatives for the case of finding the name of the database you are connected to:

SELECT value FROM v$parameter WHERE name = 'db_name'

Oracle7 also allows
SELECT * FROM global_name

Hope this helps.
Roderick Manalac
Oracle Corporation Received on Tue Sep 27 1994 - 06:17:16 CET

Original text of this message