Re: Getting Database Name from SQLPlus

From: Chris Hubble <chubble_at_pcug.org.au>
Date: 1995/04/04
Message-ID: <chubble.1.006ADE3A_at_pcug.org.au>#1/1


In article <3kuot4$21k_at_lucy.infi.net> gtravis_at_richmond.infi.net (Glenn Travis) writes:
>From: gtravis_at_richmond.infi.net (Glenn Travis)
>Subject: Getting Database Name from SQLPlus
>Date: 24 Mar 1995 15:36:04 GMT
 

>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.

Tony Jambu suggests 'select name from v$database' but this needs to be preceeded by 'column name new_value dbsid noprint' Then you can use &dbsid in ttitle lines, selects etc.

Sqlplus is very powerful!!


Chris Hubble              
chubble_at_pcug.org.au            
06 249 8492 (H)                   
Received on Tue Apr 04 1995 - 00:00:00 CEST

Original text of this message