Home » Other » General » which database i connected?
which database i connected? [message #104174] Tue, 10 August 2004 18:37 Go to next message
gecheng
Messages: 4
Registered: August 2004
Junior Member
a servese have many database,how i kow which database i connected
Re: which database i connected? [message #104177 is a reply to message #104174] Wed, 11 August 2004 05:28 Go to previous messageGo to next message
Amit
Messages: 166
Registered: February 1999
Senior Member
select * from global_name;
or
select * from v$database;
Re: which database i connected? [message #104274 is a reply to message #104174] Wed, 08 September 2004 03:26 Go to previous message
Andy Black
Messages: 6
Registered: August 2004
Junior Member
Hi,

The following SQL will show what database you are connected to (see the second returned field):
select * from v$instance;

You can set the SQL*Plus prompt by editing file login.sql in your SQLPATH to contain the lines:

-- Set the SQL*Plus prompt
define prompt = 'SQL'
column prompt new_value prompt
set termout off
select lower(instance_name)||':'||lower(host_name) prompt from v$instance;
set termout on
set sqlprompt '&&prompt> '

Regards, Andy
Previous Topic: where to download the TNS document?
Next Topic: problem in crystal report 8.0
Goto Forum:
  


Current Time: Thu Mar 28 06:33:17 CDT 2024