<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Network Monitoring Experimentations 4</title>
	<atom:link href="http://hoopercharles.wordpress.com/2010/04/25/network-monitoring-experimentations-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://hoopercharles.wordpress.com/2010/04/25/network-monitoring-experimentations-4/</link>
	<description>Miscellaneous Random Oracle Topics: Stop, Think, ... Understand</description>
	<lastBuildDate>Mon, 13 May 2013 14:10:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Tim Hopkins</title>
		<link>http://hoopercharles.wordpress.com/2010/04/25/network-monitoring-experimentations-4/#comment-723</link>
		<dc:creator><![CDATA[Tim Hopkins]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 17:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1955#comment-723</guid>
		<description><![CDATA[Hi Charles,

It&#039;s a combination of my copy and paste error and &quot;reading bytes from right to left&quot; that&#039;s causing the trouble - They&#039;re left to right.

’78 6e 05 18 08 1f 18′ is &#039;2010-05-24 07:30:23&#039; (NOT 09:54 as I mistakenly pasted above)

0x78 = 120 = 20 + 100
0x6e = 110 = 10 + 100
ie 0x78 0x6e = 2010
0x05 = May
0x18 = 24
0x08 = 7 + 1
0x1f = 31 = 30 + 1
0x18 = 24 = 23 + 1

Apologies for the copy and paste error and hope this clears things up.]]></description>
		<content:encoded><![CDATA[<p>Hi Charles,</p>
<p>It&#8217;s a combination of my copy and paste error and &#8220;reading bytes from right to left&#8221; that&#8217;s causing the trouble &#8211; They&#8217;re left to right.</p>
<p>’78 6e 05 18 08 1f 18′ is &#8217;2010-05-24 07:30:23&#8242; (NOT 09:54 as I mistakenly pasted above)</p>
<p>0&#215;78 = 120 = 20 + 100<br />
0x6e = 110 = 10 + 100<br />
ie 0&#215;78 0x6e = 2010<br />
0&#215;05 = May<br />
0&#215;18 = 24<br />
0&#215;08 = 7 + 1<br />
0x1f = 31 = 30 + 1<br />
0&#215;18 = 24 = 23 + 1</p>
<p>Apologies for the copy and paste error and hope this clears things up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/04/25/network-monitoring-experimentations-4/#comment-718</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 12:25:32 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1955#comment-718</guid>
		<description><![CDATA[Martin,

Thank you for stopping by my blog and leaving the comment about the blog article.  I hope that your found &quot;Network Monitoring Experimentations 5&quot; to be decent also - that blog article took a bit longer than this one to put together.

On a side note, it is great to see the uptick of good information about Oracle&#039;s behavior flowing across the Internet in the last couple of years.  A portion of that opinion might have to do with the hit or miss nature of some Google searches, so if I find something interesting, I try to link to it so that it is easier to find again later.  The new &lt;a href=&quot;http://www.oaktable.net/main&quot; rel=&quot;nofollow&quot;&gt;OakTable.net&lt;/a&gt; website has an improved Google search feature, so that is now an option in place of a standard Google search (but I will probably continue to link to helpful articles).]]></description>
		<content:encoded><![CDATA[<p>Martin,</p>
<p>Thank you for stopping by my blog and leaving the comment about the blog article.  I hope that your found &#8220;Network Monitoring Experimentations 5&#8243; to be decent also &#8211; that blog article took a bit longer than this one to put together.</p>
<p>On a side note, it is great to see the uptick of good information about Oracle&#8217;s behavior flowing across the Internet in the last couple of years.  A portion of that opinion might have to do with the hit or miss nature of some Google searches, so if I find something interesting, I try to link to it so that it is easier to find again later.  The new <a href="http://www.oaktable.net/main" rel="nofollow">OakTable.net</a> website has an improved Google search feature, so that is now an option in place of a standard Google search (but I will probably continue to link to helpful articles).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/04/25/network-monitoring-experimentations-4/#comment-717</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 11:51:37 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1955#comment-717</guid>
		<description><![CDATA[I have a faint memory of a conversation either in a Usenet thread or an OTN thread about the 7 byte and 8 byte date datatype difference that you mentioned.  I thought that I participated in that discussion, but I can&#039;t find it in a Google search.  Thanks for mentioning this date data type difference - I probably would have spent a little more time trying to decode the raw packet if I had not hit a brick wall with the date datatype.

A demonstration of what you described (so that hopefully I will remember the next time I encounter this difference):
&lt;pre&gt;
CREATE TABLE T1 (C1 DATE);
 
INSERT INTO T1 VALUES (TO_DATE(&#039;2010-05-24 07:30:23&#039;,&#039;YYYY-MM-DD HH24:MI:SS&#039;));
 
ALTER SESSION SET NLS_DATE_FORMAT=&#039;YYYY-MM-DD HH24:MI:SS&#039;;
 
SELECT
  TO_DATE(&#039;2010-05-24 07:30:23&#039;,&#039;YYYY-MM-DD HH24:MI:SS&#039;) MY_DATE,
  DUMP(C1) C1_DUMP,
  DUMP(TO_DATE(&#039;2010-05-24 07:30:23&#039;,&#039;YYYY-MM-DD HH24:MI:SS&#039;)) MY_DATE_DUMP
FROM
  T1;
 
MY_DATE             C1_DUMP                            MY_DATE_DUMP
------------------- ---------------------------------- ----------------------------------
2010-05-24 07:30:23 Typ=12 Len=7: 120,110,5,24,8,31,24 Typ=13 Len=8: 218,7,5,24,7,30,23,0
&lt;/pre&gt;

This is the observation that I would have made with the C1_DUMP:
&lt;pre&gt;
Hex 78 = Dec 120
Hex 6e = Dec 110
Hex 05 = Dec   5
Hex 18 = Dec  24
Hex 08 = Dec   8
Hex 1f = Dec  31
Hex 18 = Dec  24
&lt;/pre&gt;

That exactly matches what was found in the network packet, using your example.

The web page that you linked contains the following:
&quot;Oracle&#039;s stores DATE in total of 7 bytes. Each byte in it stores values for an element of the DATE as follows:
Byte Description 
1 Century value but before storing it add 100 to it 
2 Year and 100 is added to it before storing 
3 Month 
4 Day of the month 
5 Hours but add 1 before storing it 
6 Minutes but add 1 before storing it 
7 Seconds but add 1 before storing it&quot;

Which oddly brings me back to my previous investigation that lead to the &quot;brick wall&quot;, reading the bytes from right to left:
’78 6e 05 18 08 1f 18′

23 decimal = 17 hex, off by 1
30 decimal = 1E hex, off by 1
7 decimal = 7 hex, off by 1
24 decimal = 18 hex – just when you think that there is a pattern, a curve ball is thrown, the same value
5 decimal = 5 hex, the same value
… and then we are completely lost.

While searching Google I did find an interesting test case that I posted a year ago, now I have a topic for tomorrow&#039;s blog article.]]></description>
		<content:encoded><![CDATA[<p>I have a faint memory of a conversation either in a Usenet thread or an OTN thread about the 7 byte and 8 byte date datatype difference that you mentioned.  I thought that I participated in that discussion, but I can&#8217;t find it in a Google search.  Thanks for mentioning this date data type difference &#8211; I probably would have spent a little more time trying to decode the raw packet if I had not hit a brick wall with the date datatype.</p>
<p>A demonstration of what you described (so that hopefully I will remember the next time I encounter this difference):</p>
<pre>
CREATE TABLE T1 (C1 DATE);
 
INSERT INTO T1 VALUES (TO_DATE('2010-05-24 07:30:23','YYYY-MM-DD HH24:MI:SS'));
 
ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
 
SELECT
  TO_DATE('2010-05-24 07:30:23','YYYY-MM-DD HH24:MI:SS') MY_DATE,
  DUMP(C1) C1_DUMP,
  DUMP(TO_DATE('2010-05-24 07:30:23','YYYY-MM-DD HH24:MI:SS')) MY_DATE_DUMP
FROM
  T1;
 
MY_DATE             C1_DUMP                            MY_DATE_DUMP
------------------- ---------------------------------- ----------------------------------
2010-05-24 07:30:23 Typ=12 Len=7: 120,110,5,24,8,31,24 Typ=13 Len=8: 218,7,5,24,7,30,23,0
</pre>
<p>This is the observation that I would have made with the C1_DUMP:</p>
<pre>
Hex 78 = Dec 120
Hex 6e = Dec 110
Hex 05 = Dec   5
Hex 18 = Dec  24
Hex 08 = Dec   8
Hex 1f = Dec  31
Hex 18 = Dec  24
</pre>
<p>That exactly matches what was found in the network packet, using your example.</p>
<p>The web page that you linked contains the following:<br />
&#8220;Oracle&#8217;s stores DATE in total of 7 bytes. Each byte in it stores values for an element of the DATE as follows:<br />
Byte Description<br />
1 Century value but before storing it add 100 to it<br />
2 Year and 100 is added to it before storing<br />
3 Month<br />
4 Day of the month<br />
5 Hours but add 1 before storing it<br />
6 Minutes but add 1 before storing it<br />
7 Seconds but add 1 before storing it&#8221;</p>
<p>Which oddly brings me back to my previous investigation that lead to the &#8220;brick wall&#8221;, reading the bytes from right to left:<br />
’78 6e 05 18 08 1f 18′</p>
<p>23 decimal = 17 hex, off by 1<br />
30 decimal = 1E hex, off by 1<br />
7 decimal = 7 hex, off by 1<br />
24 decimal = 18 hex – just when you think that there is a pattern, a curve ball is thrown, the same value<br />
5 decimal = 5 hex, the same value<br />
… and then we are completely lost.</p>
<p>While searching Google I did find an interesting test case that I posted a year ago, now I have a topic for tomorrow&#8217;s blog article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mwidlake</title>
		<link>http://hoopercharles.wordpress.com/2010/04/25/network-monitoring-experimentations-4/#comment-716</link>
		<dc:creator><![CDATA[mwidlake]]></dc:creator>
		<pubDate>Wed, 28 Apr 2010 11:13:27 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1955#comment-716</guid>
		<description><![CDATA[Hi Charles,

That is a nice post.

I&#039;m glad you found the sql-only version of translating raw values of oracle data into human readable format helpful and thanks for the link.
I updated the script later, in light of lots of help by others, to handle timestamps too. The update can be found at http://mwidlake.wordpress.com/2010/02/24/update-to-decoding-high-and-low-values/

Thanks,

Martin]]></description>
		<content:encoded><![CDATA[<p>Hi Charles,</p>
<p>That is a nice post.</p>
<p>I&#8217;m glad you found the sql-only version of translating raw values of oracle data into human readable format helpful and thanks for the link.<br />
I updated the script later, in light of lots of help by others, to handle timestamps too. The update can be found at <a href="http://mwidlake.wordpress.com/2010/02/24/update-to-decoding-high-and-low-values/" rel="nofollow">http://mwidlake.wordpress.com/2010/02/24/update-to-decoding-high-and-low-values/</a></p>
<p>Thanks,</p>
<p>Martin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Hopkins</title>
		<link>http://hoopercharles.wordpress.com/2010/04/25/network-monitoring-experimentations-4/#comment-713</link>
		<dc:creator><![CDATA[Tim Hopkins]]></dc:creator>
		<pubDate>Tue, 27 Apr 2010 20:59:54 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1955#comment-713</guid>
		<description><![CDATA[Hi Charles, that was a quick reply!

The problem you&#039;ve pointed out above is one of those annoying inconsistencies with Oracle. Data type 13 (Typ=13) is an in-memory representation of dates used by PL/SQL and the date functions like TO_DATE. Dan Morgan has more details on Morgan&#039;s library at
http://www.morganslibrary.org/reference/datatypes.html

A DATE data type from a table will be type 12 (and 7 bytes, rather than 8 ) and match my example above. Just try the DUMP function against the date column from your actual table and it should all make sense.]]></description>
		<content:encoded><![CDATA[<p>Hi Charles, that was a quick reply!</p>
<p>The problem you&#8217;ve pointed out above is one of those annoying inconsistencies with Oracle. Data type 13 (Typ=13) is an in-memory representation of dates used by PL/SQL and the date functions like TO_DATE. Dan Morgan has more details on Morgan&#8217;s library at<br />
<a href="http://www.morganslibrary.org/reference/datatypes.html" rel="nofollow">http://www.morganslibrary.org/reference/datatypes.html</a></p>
<p>A DATE data type from a table will be type 12 (and 7 bytes, rather than 8 ) and match my example above. Just try the DUMP function against the date column from your actual table and it should all make sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2010/04/25/network-monitoring-experimentations-4/#comment-712</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Tue, 27 Apr 2010 19:47:20 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1955#comment-712</guid>
		<description><![CDATA[Tim,

I appreciate your help with decoding the data section of the packet.  I admit to not spending very much time as of yet in trying to decode that section of the packet - that process was planned for a later blog article.

My original thought was to experiment with DUMP, something like this:
&lt;pre&gt;
ALTER SESSION SET NLS_DATE_FORMAT=&#039;YYYY-MM-DD HH24:MI:SS&#039;;
 
SELECT
  TO_DATE(&#039;2010-05-24 07:30:23&#039;,&#039;YYYY-MM-DD HH24:MI:SS&#039;) MY_DATE,
  DUMP(TO_DATE(&#039;2010-05-24 07:30:23&#039;,&#039;YYYY-MM-DD HH24:MI:SS&#039;)) MY_DATE_DUMP 
FROM
  DUAL;
 
MY_DATE             MY_DATE_DUMP
------------------- ----------------------------------
2010-05-24 07:30:23 Typ=13 Len=8: 218,7,5,24,7,30,23,0
&lt;/pre&gt;

This output almost matches the hex numbers that were originally supplied to your anonymous PL/SQL block, and that were originally found in the packet capture:
&#039;78 6e 05 18 08 1f 18&#039;

23 decimal = 17 hex, off by 1
30 decimal = 1E hex, off by 1
7 decimal = 7 hex, off by 1
24 decimal = 18 hex - just when you think that there is a pattern, a curve ball is thrown, the same value
5 decimal = 5 hex, the same value
... and then we are completely lost.

After seeing your reply, I started to think that there must be another way to do this without using an anonymous PL/SQL block - just standard SQL, something like UTL_RAW.CAST_TO_VARCHAR2, but instead casting it to a date.  After a couple of minutes of playing around, I searched and ended up on this page: http://mwidlake.wordpress.com/2010/01/03/decoding-high_value-and-low_value/

In short, you saved me a lot of time hopelessly digging around, trying to determine why I was receiving values that did not match the output of DUMP.  I am not sure that I would have found the same solution as you did.]]></description>
		<content:encoded><![CDATA[<p>Tim,</p>
<p>I appreciate your help with decoding the data section of the packet.  I admit to not spending very much time as of yet in trying to decode that section of the packet &#8211; that process was planned for a later blog article.</p>
<p>My original thought was to experiment with DUMP, something like this:</p>
<pre>
ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
 
SELECT
  TO_DATE('2010-05-24 07:30:23','YYYY-MM-DD HH24:MI:SS') MY_DATE,
  DUMP(TO_DATE('2010-05-24 07:30:23','YYYY-MM-DD HH24:MI:SS')) MY_DATE_DUMP 
FROM
  DUAL;
 
MY_DATE             MY_DATE_DUMP
------------------- ----------------------------------
2010-05-24 07:30:23 Typ=13 Len=8: 218,7,5,24,7,30,23,0
</pre>
<p>This output almost matches the hex numbers that were originally supplied to your anonymous PL/SQL block, and that were originally found in the packet capture:<br />
&#8217;78 6e 05 18 08 1f 18&#8242;</p>
<p>23 decimal = 17 hex, off by 1<br />
30 decimal = 1E hex, off by 1<br />
7 decimal = 7 hex, off by 1<br />
24 decimal = 18 hex &#8211; just when you think that there is a pattern, a curve ball is thrown, the same value<br />
5 decimal = 5 hex, the same value<br />
&#8230; and then we are completely lost.</p>
<p>After seeing your reply, I started to think that there must be another way to do this without using an anonymous PL/SQL block &#8211; just standard SQL, something like UTL_RAW.CAST_TO_VARCHAR2, but instead casting it to a date.  After a couple of minutes of playing around, I searched and ended up on this page: <a href="http://mwidlake.wordpress.com/2010/01/03/decoding-high_value-and-low_value/" rel="nofollow">http://mwidlake.wordpress.com/2010/01/03/decoding-high_value-and-low_value/</a></p>
<p>In short, you saved me a lot of time hopelessly digging around, trying to determine why I was receiving values that did not match the output of DUMP.  I am not sure that I would have found the same solution as you did.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Hopkins</title>
		<link>http://hoopercharles.wordpress.com/2010/04/25/network-monitoring-experimentations-4/#comment-709</link>
		<dc:creator><![CDATA[Tim Hopkins]]></dc:creator>
		<pubDate>Tue, 27 Apr 2010 17:48:46 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=1955#comment-709</guid>
		<description><![CDATA[Hi Charles,

The dates and numbers in the packet trace are in the same format you&#039;d find them in a block dump.

For instance, the 7 bytes - 78 6e 05 18 0a 37 18 - represent 2010-05-24 09:54:23 (May 24th).
DBMS_STATS.CONVERT_RAW_VALUE can be used to do the decoding 

eg: 
&lt;pre&gt;
declare
   tmp date;
begin
   dbms_stats.convert_raw_value(hextoraw(replace(upper(&#039;78 6e 05 18 08 1f 18&#039;),&#039; &#039;)), tmp);
   dbms_output.put_line(TO_CHAR(tmp,&#039;YYYY-MM-DD HH24:MI:SS&#039;));
end;
/
&lt;/pre&gt;

Likewise, c2 03 5a is the number 289. The byte before this is the length byte.

Put that together in an example for your trace:

&lt;pre&gt;
03 c2 03 5a 05 41 32  38 39 5a 0c 41 32 38 39 5a 20 20 20 20 20 20 20  07 78 6e 05 18 08 1f 18
 
03 = 3 bytes
c2 03 5a = 289 (NUMBER)
05 = 5 bytes
41 32  38 39 5a = &#039;A289Z&#039; (VARCHAR2)
0c = 12 bytes
41 32 38 39 5a 20 20 20 20 20 20 20 = &#039;A289Z       &#039; (CHAR)
07 = 7 bytes
78 6e 05 18 08 1f 18 = &#039;2010-05-24 09:54:23&#039; (DATE)
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Hi Charles,</p>
<p>The dates and numbers in the packet trace are in the same format you&#8217;d find them in a block dump.</p>
<p>For instance, the 7 bytes &#8211; 78 6e 05 18 0a 37 18 &#8211; represent 2010-05-24 09:54:23 (May 24th).<br />
DBMS_STATS.CONVERT_RAW_VALUE can be used to do the decoding </p>
<p>eg: </p>
<pre>
declare
   tmp date;
begin
   dbms_stats.convert_raw_value(hextoraw(replace(upper('78 6e 05 18 08 1f 18'),' ')), tmp);
   dbms_output.put_line(TO_CHAR(tmp,'YYYY-MM-DD HH24:MI:SS'));
end;
/
</pre>
<p>Likewise, c2 03 5a is the number 289. The byte before this is the length byte.</p>
<p>Put that together in an example for your trace:</p>
<pre>
03 c2 03 5a 05 41 32  38 39 5a 0c 41 32 38 39 5a 20 20 20 20 20 20 20  07 78 6e 05 18 08 1f 18
 
03 = 3 bytes
c2 03 5a = 289 (NUMBER)
05 = 5 bytes
41 32  38 39 5a = 'A289Z' (VARCHAR2)
0c = 12 bytes
41 32 38 39 5a 20 20 20 20 20 20 20 = 'A289Z       ' (CHAR)
07 = 7 bytes
78 6e 05 18 08 1f 18 = '2010-05-24 09:54:23' (DATE)
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
