Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to find the current instance name?
Right, or that is how it *should* be anyway :)
Take a look at the following:
SQL> create user test identified by test default tablespace users quota unlimited on users;
User created.
SQL> grant connect to test;
Grant succeeded.
SQL> desc V$Instance
Name Null? Type ----------------------------------------- -------- ------------------- INSTANCE_NUMBER NUMBER INSTANCE_NAME VARCHAR2(16) HOST_NAME VARCHAR2(64) VERSION VARCHAR2(17) STARTUP_TIME DATE STATUS VARCHAR2(7) PARALLEL VARCHAR2(3) THREAD# NUMBER ARCHIVER VARCHAR2(7) LOG_SWITCH_WAIT VARCHAR2(11) LOGINS VARCHAR2(10) SHUTDOWN_PENDING VARCHAR2(3) DATABASE_STATUS VARCHAR2(17) INSTANCE_ROLE VARCHAR2(18)
SQL> select instance_name from v$instance;
INSTANCE_NAME
SQL> connect test/test_at_sales
Connected.
SQL> select instance_name from v$instance;
select instance_name from v$instance
*
SQL> connect sys/sys_at_sales
Connected.
SQL> create view instance as select instance_name from v$instance;
View created.
SQL> create public synonym instance for sys.instance;
Synonym created.
SQL> connect test/test_at_sales;
Connected.
SQL> select * from instance;
INSTANCE_NAME
This is just one work around that I can think of now, not sure of any others that there may be though..
HTH Mark
-----Original Message-----
Kumar Muthu Kumaran
Sent: Thursday, September 20, 2001 13:50
To: Multiple recipients of list ORACLE-L
i cann't access V$ views as an ordinary user, rt?....
> -----Original Message-----
> From: Cale, Rick T (Richard) [SMTP:RICHARD.T.CALE_at_saic.com]
> Sent: Thursday, September 20, 2001 3:20 PM
> To: Multiple recipients of list ORACLE-L
> Subject: RE: How to find the current instance name?
>
> You probably want to do the following. v$database.name is the database
> name
> not the instance name. Although
> most name the same but not required.
>
> SELECT instance FROM v$thread;
>
> Rick
>
> -----Original Message-----
> Sent: Thursday, September 20, 2001 6:55 AM
> To: Multiple recipients of list ORACLE-L
>
>
> List,
>
> How to find the current instance name for the session?.
>
> From svrmgrl, i can using "SELECT name FROM v$database".
>
> What is the equivalant from the ordinary user?
>
> Regards
> Nirmal.
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Nirmal Kumar Muthu Kumaran
> INET: NIRMALK_at_qtel.com.qa
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Cale, Rick T (Richard)
> INET: RICHARD.T.CALE_at_saic.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Nirmal Kumar Muthu Kumaran INET: NIRMALK_at_qtel.com.qa Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mark Leith INET: mark_at_cool-tools.co.uk Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Thu Sep 20 2001 - 07:49:46 CDT