Display Database version, installed options and port string

set head off feed off pages 0 serveroutput on col banner format a72 wrap select banner from sys.v_$version; select ‘ With the ‘||parameter||’ option’ from sys.v_$option where value = ‘TRUE’; select ‘ The ‘||parameter||’ option is not installed’ from sys.v_$option where value <> ‘TRUE’; begin dbms_output.put_line(‘Port String: ‘||dbms_utility.port_string); end; / set head on feed on

“Who am i” script

set termout off store set store rep set head off set pause off set termout on select ‘User: ‘|| user || ‘ on database ‘ || global_name, ‘ (term=’||USERENV(‘TERMINAL’)|| ‘, audsid=’||USERENV(‘SESSIONID’)||’)’ as MYCONTEXT from global_name; @store set termout on

Lookup Oracle error messages

set serveroutput on set veri off feed off prompt Lookup Oracle error messages: prompt prompt Please enter error numbers as negatives. E.g. -1 prompt exec dbms_output.put_line(‘==> ‘||sqlerrm( &errno ) );