Often we want just the CPU usage from a query rather than complete 10046,
As Tom Kyte published in setember Oracle Magazine:
”
SQL> begin
2 :cpu := dbms_utility.get_cpu_time;
3 dbms_application_info.set_client_info(0);
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> select owner, f(owner) from stage;
…
72841 rows selected.
SQL> select
2 dbms_utility.get_cpu_time-:cpu cpu_hsecs,
3 userenv(‘client_info’)
4 from dual;
CPU_HSECS USERENV(‘CLIENT_INFO’)
——— ———————–
118 72841
”
To read the whole article:
http://www.oracle.com/technetwork/issue-archive/2011/11-sep/o51asktom-453438.html