http://www.itpub.net/showthread.php?s=&postid=3832527#post3832527
在10g中使用toad的sql编辑器,如果打开autotrace,执行sql发现auto trace中的显示信息
与8i 下不同,使用sqlmonitor跟踪后发现如下问题:
0g下:
Timestamp: 10:35:50.021
select sid from V$SESSION where audsid = ( select USERENV('SESSIONID') from dual )
----------------------------------
Timestamp: 10:35:50.141
SELECT PT.VALUE, sn.Name FROM v$statname sn, SYS.V_$SESSTAT PT WHERE sn.statistic#=pt.statistic# and PT.SID=:CSID AND
PT.STATISTIC# IN (7,41,44,48,133,304,305,306,310,311)ORDER BY PT.STATISTIC#
CSID = 444
----------------------------------
Timestamp: 10:35:50.221
select sysdate from dual
----------------------------------
Timestamp: 10:35:50.261
SELECT PT.VALUE, sn.Name FROM v$statname sn, SYS.V_$SESSTAT PT WHERE sn.statistic#=pt.statistic# and PT.SID=:CSID AND
PT.STATISTIC# IN (7,41,44,48,133,304,305,306,310,311)ORDER BY PT.STATISTIC#
CSID = 444
8i下:
---------------------------------
Timestamp: 10:38:58.592
SELECT PT.VALUE FROM SYS.V_$SESSTAT PT WHERE PT.SID=:1 AND PT.STATISTIC# IN (7,47,50,54,134,335,336,337,341,342) ORDER BY
PT.STATISTIC#
:1 = 367
----------------------------------
Timestamp: 10:38:58.622
select sysdate from dual
----------------------------------
Timestamp: 10:38:58.642
SELECT PT.VALUE FROM SYS.V_$SESSTAT PT WHERE PT.SID=:1 AND PT.STATISTIC# IN (7,47,50,54,134,335,336,337,341,342) ORDER BY
PT.STATISTIC#
:1 = 367
很明显 PT.STATISTIC#的取值完全不一样。
看来这个是toad在10g的一个bug。