SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
对sys账号无效
1.event 10035
ALTER SYSTEM SET EVENTS '10035 trace name context forever, level 1';
sqlplus执行: select * fromaaa;
alert:
PARSE ERROR: ospid=31855, error=923 for statement:
select * fromaaaa^@
Additional information: hd=0x8a91b2c0 phd=0x8a86fb28 flg=0x28 cisid=42 sid=42 ciuid=42 uid=42
2.workaround
alter system set "_cursor_features_enabled" = 34 scope=spfile;
(restart instance)
sqlplus执行: select * fromaaa;
信息存入SQLERROR$,后面再执行同样的sql就不会parse了:
select * from SQLERROR$;
SQLHASH ERROR# ERRPOS# FLAGS SPARE1 SPARE2 SPARE3
---------------------------------------------------------------- ---------- ---------- ---------- ---------- ---------- ----------
677ebfb9892fecc7a9f5258be8fe30a 923 9 0 0 0 0
注意:只有语法错的sql才会存入SQLERROR$
这个sqlhash:677ebfb9892fecc7a9f5258be8fe30a 就是x$kglob.KGLNAHSV
用python验证一下:
[root@inforsrv ~]# python
Python 2.6.6 (r266:84292, Jun 18 2012, 09:14:33)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> import math
>>> import struct
>>> stmt = "select * fromaaa"
>>> d = hashlib.md5(stmt + '\x00').digest()
>>> h = ''
>>> for i in struct.unpack('IIII', d): h += hex(i)[2:]
...
>>> h
'677ebfb9892fecc7a9f5258be8fe30a'
>>>
注意:
1.如果python版本太低,没有hashlib.
2.需要在sql后加行结束符(\0)
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
对sys账号无效
1.event 10035
ALTER SYSTEM SET EVENTS '10035 trace name context forever, level 1';
sqlplus执行: select * fromaaa;
alert:
PARSE ERROR: ospid=31855, error=923 for statement:
select * fromaaaa^@
Additional information: hd=0x8a91b2c0 phd=0x8a86fb28 flg=0x28 cisid=42 sid=42 ciuid=42 uid=42
2.workaround
alter system set "_cursor_features_enabled" = 34 scope=spfile;
(restart instance)
sqlplus执行: select * fromaaa;
信息存入SQLERROR$,后面再执行同样的sql就不会parse了:
select * from SQLERROR$;
SQLHASH ERROR# ERRPOS# FLAGS SPARE1 SPARE2 SPARE3
---------------------------------------------------------------- ---------- ---------- ---------- ---------- ---------- ----------
677ebfb9892fecc7a9f5258be8fe30a 923 9 0 0 0 0
注意:只有语法错的sql才会存入SQLERROR$
这个sqlhash:677ebfb9892fecc7a9f5258be8fe30a 就是x$kglob.KGLNAHSV
用python验证一下:
[root@inforsrv ~]# python
Python 2.6.6 (r266:84292, Jun 18 2012, 09:14:33)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> import math
>>> import struct
>>> stmt = "select * fromaaa"
>>> d = hashlib.md5(stmt + '\x00').digest()
>>> h = ''
>>> for i in struct.unpack('IIII', d): h += hex(i)[2:]
...
>>> h
'677ebfb9892fecc7a9f5258be8fe30a'
>>>
注意:
1.如果python版本太低,没有hashlib.
2.需要在sql后加行结束符(\0)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/37279/viewspace-1873886/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/37279/viewspace-1873886/