How to find out which database I am using from the SQL Promt?? [message #19598] |
Mon, 01 April 2002 00:59 |
Sreedhar
Messages: 30 Registered: March 2000
|
Member |
|
|
Hi,
I am currently using 3 databases which are present on the same machine. I am using 'connect' command to switch between these databases. My problem is that sometimes I dont know in which database I am currently in. Because of this problem I sometimes update or delete rows in wrong database.
I want to know "Is there any command thru which I can find which database I am currently using from SQL Prompt??"
Thanks and Regards
Sreedhar
|
|
|
|
Re: How to find out which database I am using from the SQL Promt?? [message #19629 is a reply to message #19598] |
Mon, 01 April 2002 23:34 |
sonali vernekar
Messages: 8 Registered: March 2002
|
Junior Member |
|
|
Connected to:
Oracle8 Enterprise Edition Release 8.0.4.0.0 - Production
With the Partitioning and Objects options
PL/SQL Release 8.0.4.0.0 - Production
08:35:10 HCIT>
HCIT is the SID of the database where I am currently connected. Every prompt indicates the time. So when SQL*Plus is done with one command it will display the new time on the prompt for next command. This tells you exactly when the previous command terminated.
How do you set SQL*Plus to do this?
Go to your oracle home directory. e.g.. d:orant.
Go to the SQL*Plus Directory. e.g.. Plus33, Plus80.
Edit or create file Glogin.sql
Add the following text at the end of the file:
set lines 100
set pages 100
set termout off
col dbname new_value prompt_dbname
select substr(global_name,1,instr(global_name,'.')-1) dbname
from global_name;
set sqlprompt "&&prompt_dbname> "
set termout on
set time on
i hope this solves ur query
|
|
|