Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to find the current instance name?

RE: How to find the current instance name?

From: Glenn Travis <Glenn.Travis_at_sas.com>
Date: Fri, 21 Sep 2001 12:16:35 -0700
Message-ID: <F001.00395265.20010921122519@fatcity.com>

Here's a great little script. Edit as necessary.

--Begin

column today noprint new_value xdate
column name noprint new_value dbname
column created noprint new_value dbcreated column host_name noprint new_value hostname column instance_name noprint new_value instname column start_time noprint new_value starttime column status noprint new_value dbstatus

set echo off
set feedback off
set termout off

select substr(to_char(sysdate,'fmMonth DD, YYYY HH:MI:SS P.M.'),1,35) today from dual; select name,to_char(created,'fmMonth DD, YYYY HH:MI:SS P.M.') created from v$database;

select host_name, instance_name,

        to_char(startup_time,'fmMonth DD, YYYY HH:MI:SS P.M.') start_time, 
        status from v$instance;

set pagesize 0
set linesize 80
set echo off
set feedback off
set termout on

prompt Cur Date:  &xdate
prompt Database:  &dbname
prompt Instance:  &instname
prompt Host:      &hostname
prompt Created:   &dbcreated

prompt Startup: &starttime
prompt Status: &dbstatus
prompt
--End

-----Original Message-----

Sent: Thursday, September 20, 2001 8:20 AM To: Multiple recipients of list ORACLE-L

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: Glenn Travis
  INET: Glenn.Travis_at_sas.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). Received on Fri Sep 21 2001 - 14:16:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US