Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Intermediate
Apr 26, 2004

Report the Name of the Current Database Instance

Sometimes, you need to know the Oracle database instance name on which your SQL is being executed. For instance, say you have to print a DBA report for which you have prepared a set of scripts, and which you want to execute on each database. You also want the name of the database instance at the top of report, followed by statistics for that. Of course, you don't want to change the script for each instance—you want a generic script.

To get the name of the Oracle instance, query the GLOBAL_NAMES view in Oracle, like this:

 
 SELECT * FROM
GLOBAL_NAMES;
Shushil Srivastava
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap