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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to