-- utils.sql
SET SERVEROUTPUT ON
DECLARE
  vers varchar2(100);
  comp varchar2(100);
  sqlin clob := 'select * from store';
  sqlout clob;
BEGIN
  dbms_output.put_line('CPU Time: ' || dbms_utility.get_cpu_time);
  dbms_output.put_line('Time: ' || dbms_utility.get_time);
  dbms_output.put_line('== ');

  dbms_utility.db_version(vers,comp);
  dbms_output.put_line('DB Version: ' || vers);
  dbms_output.put_line('DB Compatibility Level: ' || comp);
  dbms_output.put_line('Port String: ' || dbms_utility.port_string);
  dbms_output.put_line('== ');

  dbms_utility.expand_sql_text(sqlin,sqlout);
  dbms_output.put_line('Original SQL: ' || sqlin);
  dbms_output.put_line('Expanded SQL: ' || sqlout);
  dbms_output.put_line('== ');

  dbms_output.put_line('CPU Time: ' || dbms_utility.get_cpu_time);
  dbms_output.put_line('Time: ' || dbms_utility.get_time);
END;
/
