SQL> conn /
Connected.
SQL> select name, m.value/100
2 from v$mystat m, v$sysstat s
3 where m.statistic# = s.statistic#
4 and name in
5 ('DB time',
6 'CPU used by this session')
7 /
NAME M.VALUE/100
----------------------------------- -----------
CPU used by this session .01
DB time 0
SQL>
If you sleep in the OS for a few seconds:
SQL> host sleep 5
... this does not increment DB time or CPU time by much:
SQL> select name, m.value/100
2 from v$mystat m, v$sysstat s
3 where m.statistic# = s.statistic#
4 and name in
5 ('DB time',
6 'CPU used by this session')
7 /
NAME M.VALUE/100
----------------------------------- -----------
CPU used by this session .02
DB time .02
SQL>
However, if you sleep in the database:
SQL> exec dbms_lock.sleep(5);
PL/SQL procedure successfully completed.
SQL>
... CPU time hardly changes but DB time goes up by the full 5 seconds:
SQL> select name, m.value/100
2 from v$mystat m, v$sysstat s
3 where m.statistic# = s.statistic#
4 and name in
5 ('DB time',
6 'CPU used by this session')
7 /
NAME M.VALUE/100
----------------------------------- -----------
CPU used by this session .04
DB time 5.05
SQL>
No comments:
Post a Comment