<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BlueGecko Denmark</title>
	<atom:link href="https://bluegecko.dk/tag/hex/feed/" rel="self" type="application/rss+xml" />
	<link>https://bluegecko.dk</link>
	<description>Your remote dba</description>
	<lastBuildDate>Thu, 19 Nov 2009 15:05:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.2</generator>
	<item>
		<title>Converting Hexadecimal Oracle SCNs to Decimal</title>
		<link>https://bluegecko.dk/converting-hexadecimal-oracle-scns-to-decimal/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=converting-hexadecimal-oracle-scns-to-decimal</link>
					<comments>https://bluegecko.dk/converting-hexadecimal-oracle-scns-to-decimal/#comments</comments>
		
		<dc:creator><![CDATA[jwilton]]></dc:creator>
		<pubDate>Thu, 19 Nov 2009 15:05:52 +0000</pubDate>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[hex]]></category>
		<category><![CDATA[hexadecimal]]></category>
		<category><![CDATA[Oracle DBA]]></category>
		<category><![CDATA[oracle internals]]></category>
		<category><![CDATA[scn]]></category>
		<category><![CDATA[system change number]]></category>
		<guid isPermaLink="false">http://matthias.bluegecko.net/?p=309</guid>

					<description><![CDATA[Oracle serializes transactions and manages concurrency and recovery using an ever-increasing number called a system change number, or SCN. Usually, we see these numbers expressed in decimal, in places like the v$ views and the alert log. Occasionally, however, Oracle&#8217;s code expresses SCNs in hexadecimal. Unfortunately, you can&#8217;t just perform a straght conversion from hex [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Oracle serializes transactions and manages concurrency and recovery using an ever-increasing number called a system change number, or SCN.  Usually, we see these numbers expressed in decimal, in places like the v$ views and the alert log.  Occasionally, however, Oracle&#8217;s code expresses SCNs in hexadecimal. Unfortunately, you can&#8217;t just perform a straght conversion from hex to dec to express these hex SCNs in dec. Here is the same Oracle SCNs expressed in hex and dec:<span id="more-309"></span></p>
<pre>0x952.f5e60bda
10251917462490</pre>
<p>Thanks to <a title="Tanel Poder" href="http://blog.tanelpoder.com/" target="_blank">Tanel Poder&#8217;s</a> generous assistance, I learned how to convert this kind of SCN to decimal.</p>
<p>The first portion of the hex scn is the number of times the second portion has reached the maximum value (ffffffff), and started back at 00000001. We&#8217;ll call it &#8220;wrap.&#8221;</p>
<p>The second portion of the hex scn is the base SCN value that increments one with each new change. We&#8217;ll call it &#8220;base.&#8221;</p>
<p>The formula for converting the hex SCN to dec would therefore be:</p>
<pre>decimal = wrap * 232 +  base</pre>
<p>I write a Unix shell on-liner to do the conversion:</p>
<p>[code language=&#8221;plain&#8221;]$ a=0x952.f5e60bda;echo $((${a%%.*}*4294967296+0x${a##*.}))[/code]</p>
<p>Just replace the hex SCN I used in the example with your own.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://bluegecko.dk/converting-hexadecimal-oracle-scns-to-decimal/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 8/92 objects using disk
Page Caching using disk: enhanced 

Served from: bluegecko.dk @ 2026-10-17 18:28:22 by W3 Total Cache
-->