<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: SQL_ID is just a fancy representation of hash value</title>
	<atom:link href="http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/</link>
	<description>Oracle troubleshooting, internals and performance tuning</description>
	<lastBuildDate>Fri, 30 Jul 2010 06:07:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Teymur Hajiyev</title>
		<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/comment-page-1/#comment-4721</link>
		<dc:creator>Teymur Hajiyev</dc:creator>
		<pubDate>Thu, 03 Jun 2010 06:30:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=220#comment-4721</guid>
		<description>Excellent!</description>
		<content:encoded><![CDATA[<p>Excellent!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/comment-page-1/#comment-4690</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Fri, 21 May 2010 07:02:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=220#comment-4690</guid>
		<description>&lt;a href=&quot;#comment-4688&quot; rel=&quot;nofollow&quot;&gt;@SKY&lt;/a&gt; 
You need to use DBMS_FGA / fine grained auditing if you want to capture all SQL IDs of executed SQL. It&#039;ll impact your db performance though</description>
		<content:encoded><![CDATA[<p><a href="#comment-4688" rel="nofollow">@SKY</a><br />
You need to use DBMS_FGA / fine grained auditing if you want to capture all SQL IDs of executed SQL. It&#8217;ll impact your db performance though</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SKY</title>
		<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/comment-page-1/#comment-4688</link>
		<dc:creator>SKY</dc:creator>
		<pubDate>Fri, 21 May 2010 03:55:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=220#comment-4688</guid>
		<description>hello,

I m very happy with these notes. I have also a question!
i want to capture sql statement into table through trigger...</description>
		<content:encoded><![CDATA[<p>hello,</p>
<p>I m very happy with these notes. I have also a question!<br />
i want to capture sql statement into table through trigger&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/comment-page-1/#comment-4332</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Thu, 08 Apr 2010 10:30:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=220#comment-4332</guid>
		<description>&lt;a href=&quot;#comment-1067&quot; rel=&quot;nofollow&quot;&gt;@Prashant&lt;/a&gt; 
actually from 10g onwards 
rgds
patrick boulay 

******************************************************************
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Apr 8 12:28:15 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Data Mining and Real Application Testing options

SQL&gt; select dbms_utility.SQLID_TO_SQLHASH(&#039;29schpgjyfxux&#039;) hash_value FROM DUAL;

HASH_VALUE
----------
3823597405</description>
		<content:encoded><![CDATA[<p><a href="#comment-1067" rel="nofollow">@Prashant</a><br />
actually from 10g onwards<br />
rgds<br />
patrick boulay </p>
<p>******************************************************************<br />
SQL*Plus: Release 10.2.0.4.0 &#8211; Production on Thu Apr 8 12:28:15 2010</p>
<p>Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.</p>
<p>Connected to:<br />
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; 64bit Production<br />
With the Partitioning, Real Application Clusters, Data Mining and Real Application Testing options</p>
<p>SQL&gt; select dbms_utility.SQLID_TO_SQLHASH(&#8217;29schpgjyfxux&#8217;) hash_value FROM DUAL;</p>
<p>HASH_VALUE<br />
&#8212;&#8212;&#8212;-<br />
3823597405</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 关于sql_id与hash_value &#171; a db thinker&#39;s home</title>
		<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/comment-page-1/#comment-4312</link>
		<dc:creator>关于sql_id与hash_value &#171; a db thinker&#39;s home</dc:creator>
		<pubDate>Fri, 02 Apr 2010 15:56:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=220#comment-4312</guid>
		<description>[...] 而同时根据Tanel Poder的blog SQL_ID is just a fancy representation of hash value的内容以及后续的Comment,我们可以得知,SQL_ID为此hash值的后32位,而hash_value [...]</description>
		<content:encoded><![CDATA[<p>[...] 而同时根据Tanel Poder的blog SQL_ID is just a fancy representation of hash value的内容以及后续的Comment,我们可以得知,SQL_ID为此hash值的后32位,而hash_value [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Calculate SQL_ID and SQL_HASH_VALUE from SQL text &#124; Tanel Poder's blog: Core IT for Geeks and Pros</title>
		<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/comment-page-1/#comment-4309</link>
		<dc:creator>Calculate SQL_ID and SQL_HASH_VALUE from SQL text &#124; Tanel Poder's blog: Core IT for Geeks and Pros</dc:creator>
		<pubDate>Wed, 31 Mar 2010 17:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=220#comment-4309</guid>
		<description>[...] time ago I wrote an article about the 10g+ SQL_ID being just a hash value of the SQL statement text. It&#8217;s just like the [...]</description>
		<content:encoded><![CDATA[<p>[...] time ago I wrote an article about the 10g+ SQL_ID being just a hash value of the SQL statement text. It&#8217;s just like the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oracle sql_id and hash value &#187; Musings on Database Security</title>
		<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/comment-page-1/#comment-4306</link>
		<dc:creator>Oracle sql_id and hash value &#187; Musings on Database Security</dc:creator>
		<pubDate>Tue, 30 Mar 2010 18:01:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=220#comment-4306</guid>
		<description>[...] published a great post a while ago talking about Oracle&#8217;s sql_id and hash values in Oracle 10g+. I wanted to be able [...]</description>
		<content:encoded><![CDATA[<p>[...] published a great post a while ago talking about Oracle&#8217;s sql_id and hash values in Oracle 10g+. I wanted to be able [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rakesh</title>
		<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/comment-page-1/#comment-4264</link>
		<dc:creator>Rakesh</dc:creator>
		<pubDate>Fri, 19 Mar 2010 20:48:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=220#comment-4264</guid>
		<description>Very interesting stuff. Thanks Tanel.

Could you please add some more information on Parent/Child Cursor? Also how long cursor information in retained in v$sql.

Thank You</description>
		<content:encoded><![CDATA[<p>Very interesting stuff. Thanks Tanel.</p>
<p>Could you please add some more information on Parent/Child Cursor? Also how long cursor information in retained in v$sql.</p>
<p>Thank You</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/comment-page-1/#comment-3956</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Mon, 01 Mar 2010 05:37:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=220#comment-3956</guid>
		<description>Hi David,

Cool Stuff! I&#039;ve also written something similar - for searching stuff from AWR by partial SQL_ID...</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>Cool Stuff! I&#8217;ve also written something similar &#8211; for searching stuff from AWR by partial SQL_ID&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/comment-page-1/#comment-3952</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 28 Feb 2010 19:10:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=220#comment-3952</guid>
		<description>&lt;a href=&quot;#comment-1068&quot; rel=&quot;nofollow&quot;&gt;@Tanel Poder&lt;/a&gt; 
Thank you for this.  Even though Oracle provide a function, this has enabled me to work out how to reverse it.  I wanted to be able to try and find part of the SQL_ID from the hash value.  I can get the last 5 or 6 characters, and that is good enough.  I often use OraSRP to profile Trace files, that reveals hash values, and sometimes it is useful to look for the SQL_ID in either the ASH data or the AWR repository.

CREATE OR REPLACE FUNCTION h2i (p_hash_value NUMBER) RETURN VARCHAR2 IS
l_output VARCHAR2(8) := &#039;&#039;;
BEGIN
FOR i IN (
select substr(&#039;0123456789abcdfghjkmnpqrstuvwxyz&#039;, 1+floor(mod(p_hash_value/(POWER(32,LEVEL-1)),32)),1) sqlidchar
FROM dual
CONNECT BY LEVEL &lt;= LN(p_hash_value)/LN(32)
ORDER BY LEVEL DESC
) LOOP
l_output := l_output &#124;&#124; i.sqlidchar;
END LOOP; 
RETURN l_output;
END;
/</description>
		<content:encoded><![CDATA[<p><a href="#comment-1068" rel="nofollow">@Tanel Poder</a><br />
Thank you for this.  Even though Oracle provide a function, this has enabled me to work out how to reverse it.  I wanted to be able to try and find part of the SQL_ID from the hash value.  I can get the last 5 or 6 characters, and that is good enough.  I often use OraSRP to profile Trace files, that reveals hash values, and sometimes it is useful to look for the SQL_ID in either the ASH data or the AWR repository.</p>
<p>CREATE OR REPLACE FUNCTION h2i (p_hash_value NUMBER) RETURN VARCHAR2 IS<br />
l_output VARCHAR2(8) := &#8221;;<br />
BEGIN<br />
FOR i IN (<br />
select substr(&#8217;0123456789abcdfghjkmnpqrstuvwxyz&#8217;, 1+floor(mod(p_hash_value/(POWER(32,LEVEL-1)),32)),1) sqlidchar<br />
FROM dual<br />
CONNECT BY LEVEL &lt;= LN(p_hash_value)/LN(32)<br />
ORDER BY LEVEL DESC<br />
) LOOP<br />
l_output := l_output || i.sqlidchar;<br />
END LOOP;<br />
RETURN l_output;<br />
END;<br />
/</p>
]]></content:encoded>
	</item>
</channel>
</rss>
