Re: SQL*PLUS: printing TNS alias

From: Peter H. Larsen <plarsen_at_dc.dynares.com>
Date: Tue, 16 Jun 1998 15:16:56 -0400
Message-ID: <3586C4A8.E84FDCC_at_dc.dynares.com>


Hi,

Andreas Dunker wrote:
>
> Hi *,
>
> is it possible to print the tns alias in an "sql*plus report"?
> The problem is the following: I've written two scripts, which
> monitor two databases. The scripts are the same besides the
> title. (Un)fortunately databases have the same name (on different
> machines) and I connect with different tns aliases. I want to use
> the same script for both databases and have to distinguish
> between to know which of the databases runs out of space
>
> Andreas
>
> --------------------------------------------------
> Andreas Dunker 2B || ! 2B
> adunker_at_picture-safe.de (W. Shakespeare)

Query the V$DATABASE "table" and it will give you the instance name. A word of adwise though ... never use the same password for system management account on test and production environments. This will prevent you from accidentically clear the whole production environment by running a testscript that fails on it.

Always make your SQL scripts so that they take the password as a parameter.

  • Peter H. Larsen Oracle Consultant
Received on Tue Jun 16 1998 - 21:16:56 CEST

Original text of this message