当然这不是判断在哪里建立索引的依据。
SELECT *
FROM (SELECT A.*,
SC.NAME,
SC.POSITION AS "绑定变量在SQL语句中的位置",
CASE DATATYPE
WHEN 180 THEN --TIMESTAMP
TO_CHAR(ANYDATA.ACCESSTIMESTAMP(SC.VALUE_ANYDATA),
'YYYY/MM/DD HH24:MI:SS')
ELSE
SC.VALUE_STRING
END AS "绑定变量的值",
SC.DATATYPE_STRING AS "绑定变量数据类型",
SC.LAST_CAPTURED AS "最后捕捉到的时间",
SC.WAS_CAPTURED AS "where字句前绑定不进行捕获(Y/N)"
FROM GV$SQL_BIND_CAPTURE SC
RIGHT JOIN (SELECT S.USERNAME,
Q.SQL_ID,
Q.SQL_TEXT,
Q.SQL_FULLTEXT,
Q.CHILD_ADDRESS,
Q.HASH_VALUE
FROM GV$SQL Q, GV$SESSION S
WHERE S.INST_ID = Q.INST_ID
AND S.PREV_EXEC_START = Q.LAST_ACTIVE_TIME
AND S.USERNAME = Q.PARSING_SCHEMA_NAME
AND S.MODULE = Q.MODULE
AND S.ACTION_HASH = Q.ACTION_HASH
AND S.USERNAME = UPPER('&username')
AND Q.SQL_TEXT NOT LIKE
'select value from v$sesstat where sid =%') A
ON SC.SQL_ID = A.SQL_ID
AND SC.HASH_VALUE = A.HASH_VALUE
AND SC.CHILD_ADDRESS = A.CHILD_ADDRESS) X
WHERE X.NAME IS NOT NULL;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29990276/viewspace-1983337/,如需转载,请注明出处,否则将追究法律责任。