Re: Getting Database Name from SQLPlus
From: Tony Jambu <aaj_at_phantom.telecom.com.au>
Date: 1995/03/30
Message-ID: <3ldoj8$8e6_at_newsserver.trl.OZ.AU>#1/1
Date: 1995/03/30
Message-ID: <3ldoj8$8e6_at_newsserver.trl.OZ.AU>#1/1
In article <3kuot4$21k_at_lucy.infi.net>, 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.
>
> Any ideas?
Try the following as SYS
SELECT KSQDNGDN FROM X$KSQDN;
SELECT VALUE FROM V$PARAMETER WHERE name='db_name';
OR
SELECT * FROM V$DATABASE;
ta
tony
-- _____ ________ / ___ |Tony Jambu, Database Consultant /_ _ /_ __ / |Wizard Consulting,Aust (ACN 065934778) /(_)/ )(_/ \_/(///(/_)/_( |CIS: 100250.2003_at_compuserve.com FAX: +61-3-2536173 \_______/ |Email:TJambu_at_wizard.com.au PHONE: +61-3-2536385Received on Thu Mar 30 1995 - 00:00:00 CEST