Re: Getting Database Name from SQLPlus

From: Peng Hu <hup_at_nms.otc.com.au>
Date: 27 Mar 1995 09:44:52 +1000
Message-ID: <3l4u9k$45r_at_deagol.pad.otc.com.au>


gtravis_at_richmond.infi.net (Glenn Travis) writes:

>Is there a way to select the database name in query while using SQLPlus?
 

>I am using net to connect to different servers on different machines to
>produce dba type reports on disk usage ,etc... and would like to list the
>instance name on the header page for the reports (querie output). I can
>spool to $ORACLE_SID but can't use ORACLE_SID in the report heading.

Do the following (assuming you are using Oracle7):

        select name from sys.v_$database;

>Any ideas?
>--

You have it now.

>Glenn Travis
>DBA
>Circuit City Stores, Inc.
>Richmond, VA USA
>gtravis_at_richmond.infi.net
>gtravis_at_aol.com

Peng Hu
Database Consultant


|     International Network Systems     |     Mid Range Group             |
|     Telstra OTC Australia             |     IBM Australia               |
|     363 Oxford Street                 |     PO Box 400                  |
|     Paddington, NSW 2012              |     Pennant Hills, NSW 2120     |
|     Australia                         |     Australia                   |
|     Tel: +61-2-3393886                |     Tel: +61-2-3547749          |
|     Fax: +61-2-3393985                |     Fax: +61-2-3547766          |
|-------------------------------------------------------------------------|
|     Email: Peng.Hu_at_pad.otc.com.au                                       |
|     Pager: 016 020 quoting 267 675                                      |
 -------------------------------------------------------------------------
Received on Mon Mar 27 1995 - 01:44:52 CEST

Original text of this message