Question: I wan to be able to
shell out from my PL/SQL program and display the ORACLE_SID
and ORACLE_HOME from inside my PL/SQL program. How do
I capture the Oracle SID from inside PL/SQL?
Answer: Yes, Oracle ACE Guru Osama
Mustafa has provided this method for using dbms_system.get_env
to capture $ORACLE_HOME and $ORACLE_SID from inside a
This method is useful in cases where a PL/SQL program is run
against several identical schemas and you need to know the
schema that you are running the PL/SQL.
V_ORACLE_HOME VARCHAR2 (2000);
DBMS_SYSTEM.GET_ENV ('ORACLE_HOME', V_ORACLE_HOME);
('ORACLE_SID', V_ORACLE_SID );
--The below line
will print Oracle_home
DBMS_OUTPUT.PUT_LINE ('ORACLE_HOME :- '
-- the below line
will print Oracle_SID
DBMS_OUTPUT.PUT_LINE ('ORACLE_HOME :-'
Get the Complete
Oracle SQL Tuning Information
The landmark book
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
for 30% off directly from the publisher.