Question: Inside SQL*Plus, what
command can I use to find the OS file directory where the
script is executing?
Answer: Yes, you can use the following
command to display the path of the last executed script in
SQL*Plus:
SQL> select sys_context('USERENV', 'MODULE') from dual;
SYS_CONTEXT('USERENV','MODULE')
---------------------------------------------------------
01@ u01/oracle/app/scripts/script01.sql
As we see, this sys_context command display the
current file name path for the last executed SQL file.
You can also use the "Host" command to see your current
working directory:
SQL> host pwd
For more details on advanced SQL*Plus tricks, get the
book "Easy
Oracle SQL".
|
|
Get the Complete
Oracle SQL Tuning Information
The landmark book
"Advanced Oracle
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|