REM Filename      : dump_env.sql
REM Author        : Craig Richards
REM Created       : 09-April-2008
REM Version       : 1.0
REM Modifications :
REM
REM Description   : Creates a procedure to gather some environment information, both OS and database

CREATE OR REPLACE PROCEDURE DUMP_ENV
AUTHID CURRENT_USER
IS
buffer VARCHAR2(260);
BEGIN
DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('Your Environment :');
DBMS_OUTPUT.PUT_LINE('==================');
DBMS_OUTPUT.PUT_LINE(CHR(10));
SYS.DBMS_SYSTEM.GET_ENV('ORACLE_HOME',BUFFER);
DBMS_OUTPUT.PUT_LINE('ORACLE_HOME: ' || BUFFER);
SYS.DBMS_SYSTEM.GET_ENV('ORACLE_SID',BUFFER);
DBMS_OUTPUT.PUT_LINE('ORACLE_SID: ' || BUFFER);
SYS.DBMS_SYSTEM.GET_ENV('LD_LIBRARY_PATH',BUFFER);
DBMS_OUTPUT.PUT_LINE('LD_LIBRARY_PATH: ' || BUFFER);
SYS.DBMS_SYSTEM.GET_ENV('SHELL',BUFFER);
DBMS_OUTPUT.PUT_LINE('SHELL: ' || BUFFER);
SYS.DBMS_SYSTEM.GET_ENV('EDITOR',BUFFER);
DBMS_OUTPUT.PUT_LINE('EDITOR: ' || BUFFER);
select host_name into BUFFER from v$instance;
DBMS_OUTPUT.PUT_LINE('HOSTNAME: ' || BUFFER);
select version into BUFFER from v$instance;
DBMS_OUTPUT.PUT_LINE('VERSION: ' || BUFFER);
SYS.DBMS_SYSTEM.GET_ENV('ALERT',BUFFER);
DBMS_OUTPUT.PUT_LINE('ALERT: ' || BUFFER);
END DUMP_ENV;
/

REM End of Script
