14 September 2007

Experiment.

1 Comments:

Anonymous Anonymous said...

Useful Prompt in SQL*Plus
By Hervé Deschamps, Oracle Corporation.
Do you use SQL*Plus to connect to various instances? Do you loose track of which SQL*Plus window is connected to which Database? You can set the SQL*Plus prompt to remind you.

Do you like SQL*Plus to help you time the execution time of certain queries? Do you like the idea of being able to go get a cup of tea while the machine does the work and come back to your screen to see the result and how much time it took? You can set the SQL*Plus prompt to help you with that too.

If you follow the instructions below you can get something like this when you connect to SQL*Plus:

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

==================================================================================
http://w2.syronex.com/jmr/edu/db/
http://www.orafaq.com/links/Tutorials/
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================

2:48 pm  

Post a Comment

<< Home

Too Cool for Internet Explorer