$vi i2h.sql
SQL>@i2h SQL_ID
来自于tanel Poder的脚本,主要目的是计算SQL_ID和hash_value之间的关系
实验验证:
SQL> select * from dual;
SQL> select sql_id, hash_value from v$sql where sql_text ='select * from dual';
SQL_ID HASH_VALUE
------------- ----------
a5ks9fhw2v9s1 942515969
SQL> @i2h a5ks9fhw2v9s1
SQL_ID HASH_VALUE
------------- ----------
a5ks9fhw2v9s1 942515969
select
lower(trim('&1')) sql_id,
trunc(mod(sum((instr('0123456789abcdfghjkmnpqrstuvwxyz',
substr(lower(trim('&1')),level,1))-1)*power(32,length(
trim('&1'))-level)),power(2,32))) hash_value
from
dual
connect by
level <= length(trim('&1'))
/
SQL>@i2h SQL_ID
来自于tanel Poder的脚本,主要目的是计算SQL_ID和hash_value之间的关系
实验验证:
SQL> select * from dual;
SQL> select sql_id, hash_value from v$sql where sql_text ='select * from dual';
SQL_ID HASH_VALUE
------------- ----------
a5ks9fhw2v9s1 942515969
SQL> @i2h a5ks9fhw2v9s1
SQL_ID HASH_VALUE
------------- ----------
a5ks9fhw2v9s1 942515969
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/354732/viewspace-558293/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/354732/viewspace-558293/