<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>OraStory</title>
	<atom:link href="http://orastory.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://orastory.wordpress.com</link>
	<description>Dominic Brooks on Oracle - Data Quality, Sensible Design, SQL Performance</description>
	<lastBuildDate>Fri, 06 Nov 2009 17:17:07 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='orastory.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/f82b282aa91778f02f79157b5551b1a8?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>OraStory</title>
		<link>http://orastory.wordpress.com</link>
	</image>
			<item>
		<title>Loader</title>
		<link>http://orastory.wordpress.com/2009/11/06/loader/</link>
		<comments>http://orastory.wordpress.com/2009/11/06/loader/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 17:11:13 +0000</pubDate>
		<dc:creator>dombrooks</dc:creator>
				<category><![CDATA[binary transfer]]></category>
		<category><![CDATA[delimiter]]></category>
		<category><![CDATA[external tables]]></category>
		<category><![CDATA[newline]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql*loader]]></category>

		<guid isPermaLink="false">http://orastory.wordpress.com/?p=389</guid>
		<description><![CDATA[It&#8217;s been years and years since I worked regularly with SQL*Loader-based feeds.
There are loads of tips and tricks regarding formats, encodings, character sets, etc.
I had forgotten nearly everything that I could ever have claimed to know in this area, all aged out of my personal buffer cache, at best distant memories, very distant.
However, I&#8217;ve recently [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=389&subd=orastory&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It&#8217;s been years and years since I worked regularly with <a href="http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/cncptdba.htm#CNCPT1282">SQL*Loader</a>-based feeds.</p>
<p>There are loads of tips and tricks regarding formats, encodings, character sets, etc.<br />
I had forgotten nearly everything that I could ever have claimed to know in this area, all aged out of my personal buffer cache, at best distant memories, very distant.</p>
<p>However, I&#8217;ve recently had to resurrect some of these distant memories to feed some data via <a href="http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/tablecls.htm#CNCPT1141">External Tables</a>.</p>
<p>I thought it would be worthwhile to do an incoherent brain dump on some of the particular issues for future reference.</p>
<p>This article is my no means comprehensive and will just touch on some of the considerations specific to what I was doing.</p>
<p>The starting place for documentation on SQL*Loader is the <a href="http://download.oracle.com/docs/cd/E11882_01/server.112/e10701/part_ldr.htm#i436326">Oracle Database Utilies Manual</a> and similarly for <a href="http://download.oracle.com/docs/cd/E11882_01/server.112/e10701/part_et.htm#i436567">External Tables</a>.</p>
<p>The thing about external tables is that they can use the <a href="http://download.oracle.com/docs/cd/E11882_01/server.112/e10701/et_params.htm#g1031955">ORACLE_LOADER<a> or the <a href="http://download.oracle.com/docs/cd/E11882_01/server.112/e10701/et_dp_driver.htm#g1017944">ORACLE_DATAPUMP</a> access drivers.</p>
<p>My circumstances involved the ORACLE_LOADER driver.</p>
<p>As the names suggest, ORACLE_LOADER is related to SQL*LOADER. In fact, you can use the EXTERNAL_TABLE=GENERATE_ONLY parameter with SQL*LOADER to generate the syntax for your EXTERNAL TABLE.</p>
<p>I think things like this are brilliant but I never use them. I suppose I&#8217;m old skool. Neat features that auto generate code mean that a) I don&#8217;t necessarily need to understand what&#8217;s going on and b) skip the line-by-line sanity checks that I still believe in.</p>
<p>I work in an environment where it&#8217;s not so easy to get access to servers to ftp and view files, etc.</p>
<p>As a result, my approach would be to work with SQL*Loader early on and then graduate to external files nearer the time. However, I&#8217;m going to skip all that, fast forward past the SQL*Loader bit and move on to the issues.</p>
<p>So the main considerations for loading up data?<br />
- Encoding / Character sets<br />
- Delimiters &#8211; field and line<br />
- File Transfer</p>
<p>(I&#8217;m going to ignore <a href="http://en.wikipedia.org/wiki/Endianness">Endianness</a> for the sake of &#8220;clarity&#8221;.  But it can be a factor. See <a href="http://download-west.oracle.com/docs/cd/B10500_01/server.920/a96652/ch06.htm#1010633">Byte Ordering</a> for futher information.)</p>
<p>In my experience, when you get errors whilst loading, it&#8217;s due to one or more of the reasons above.<br />
More than one?<br />
Sure.</p>
<p>For example, the combination of file transfer mechanism and delimiters.<br />
Ever wondered why there&#8217;s confusion over whether you should transfer a file as text (or ascii), as binary? What&#8217;s the difference?</p>
<p>As ever, it depends.<br />
- SFTP doesn&#8217;t have a text mode, all transfers are binary.<br />
- FTP lets you choose between ascii (default) and binary.<br />
- What about WinSCP and similar tools with their automatic mode?</p>
<p>Automatic modes usually work off the file extension and would pick a text transfer for HTML, TXT, PHP, XML, etc and binary otherwise.</p>
<p>And the differences in mode?</p>
<p>For Text mode, there are two basic methods &#8211; either the tool is responsible for doing some conversion to the format supported by the destination or, more commonly, the client converts to a <a href="http://en.wikipedia.org/wiki/Canonical">canonical format</a> and the service then does a further conversion to its own format if necessary.</p>
<p>With Binary mode, the raw bytes are transferred as is, i.e. the file is transferred in its original form.</p>
<p>So, the main significance of this related to field and line delimiters &#8211; things like tabs and line feed characters are different between platforms, different between Unix and Windows for example.</p>
<p>This was particularly relevant for my file export from SQL Server to Oracle on Linux.</p>
<p>In Windows, a new line is often represented by two characters &#8211; one carriage return and one line feed.<br />
In Unix, a new line is normally just a line feed.</p>
<p>Sometimes you see &#8220;^M&#8221; characters on *nix. What&#8217;s this about?<br />
This represents the carriage return part of the newline for Windows as described above.<br />
If you need to, you can get rid of that using dos2unix.</p>
<p>So, in the ACCESS PARAMETERS subsection, if you use the &#8220;RECORDS DELIMITED BY NEWLINE&#8221; syntax in your external table definiton, what does that mean?</p>
<p>The NEWLINE keyword uses the newline format for your platform &#8211; so just a line feed in the case of *nix.</p>
<p>For my process, I decided that I would just go with the format as extracted from SQL Server &#8211; a 50:50 decision that there&#8217;s no point on expanding on.</p>
<p>So, in my situation, the syntax for an external table should not use the NEWLINE keyword because the format was Windows new lines, the syntax for which can be: </p>
<pre class="brush: plain;">
RECORDS DELIMITED BY '\r\n'
</pre>
<p>Here&#8217;s a situation. Things have been going fine in DEV,etc and eventually go to PREPRODUCTION and there&#8217;s a problem.</p>
<p>The feeds don&#8217;t work. The external table loader isn&#8217;t finding the right delimiters.</p>
<p>The question really is how can you tell what characters are in your file?<br />
So, there&#8217;s no point looking at the file prior to transfer in case the technological clue (or the person in a manual process) changes the file on transfer.  We need to look at it in the destination directory on the destination server.</p>
<p>And what&#8217;s the best way to do that?</p>
<p>On a Unix/Linux, a useful command is the od command which dumps files in octal and other formats. For example,</p>
<pre class="brush: plain;">
od -c &lt;filename&gt;
</pre>
<p>which gives ascii characters or backslash escapes.<br />
There&#8217;s a lot of output from this command but you don&#8217;t need to do the whole file, e.g.</p>
<pre class="brush: plain;">
head -2 &lt;filename&gt; | od -x | more
</pre>
<p>If the file suddenly doesn&#8217;t match the expected format, what&#8217;s the sort of errors you might get?<br />
Well, if it should have transfered in binary but it was done in text by error, you might get:</p>
<pre class="brush: plain;">
KUP-04020: found record longer than buffer size supported
</pre>
<p>i.e. the lines are running into each other<br />
or under slightly different circumstances</p>
<pre class="brush: plain;">
KUP-04023: field start is after end of record
</pre>
<p>etc.</p>
<p>That&#8217;s about it on transfers and delimiters.</p>
<p>What&#8217;s there to say about encoding and character sets.<br />
Using the od command above we can see the hex codes to double check the encoding is as expected.<br />
Other that that, in our external table definition we can specify the character set in the ACCESS PARAMETERS section using the CHARACTERSET keyword, e.g.</p>
<pre class="brush: plain;">
CREATE TABLE &lt;my_tablename&gt;
(&lt;my_columns&gt;)
ORGANIZATION EXTERNAL
  (  TYPE ORACLE_LOADER
     DEFAULT DIRECTORY &lt;my_directory&gt;
     ACCESS PARAMETERS
       ( RECORDS DELIMITED BY '\r\n'
       CHARACTERSET AL16UTF16
       FIELDS TERMINATED BY '\t'
       MISSING FIELD VALUES ARE NULL  )
     LOCATION (&lt;my_directory&gt;:'&lt;my_filename&gt;')
  )
REJECT LIMIT 0;
</pre>
<p>and then the expected characterset conversion will take place.<br />
Note that SQLServer tends to use USC2 as its unicode characterset and UCS2 is a subset of AL16UTF16.</p>
<p>It&#8217;s Friday, it&#8217;s 5 o&#8217;clock, I&#8217;ve lost focus. I&#8217;m done.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orastory.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orastory.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orastory.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orastory.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orastory.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orastory.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orastory.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orastory.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orastory.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orastory.wordpress.com/389/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=389&subd=orastory&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://orastory.wordpress.com/2009/11/06/loader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dombrooks</media:title>
		</media:content>
	</item>
		<item>
		<title>Learning</title>
		<link>http://orastory.wordpress.com/2009/10/28/learning/</link>
		<comments>http://orastory.wordpress.com/2009/10/28/learning/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 12:11:30 +0000</pubDate>
		<dc:creator>dombrooks</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://orastory.wordpress.com/?p=380</guid>
		<description><![CDATA[Earlier this month I attended Tanel Poder&#8217;s course &#8220;Advanced Oracle Troubleshooting for DBAs and Performance Engineers&#8221;.
It was good &#8211; definitely worthwhile, lots of useful information and really puts into perspective those scripts of his, like LatchProf, LatchProfX, WaitProf and sample.sql. Plus a whole bunch of other stuff. So definitely worth thinking about if you&#8217;ve any [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=380&subd=orastory&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Earlier this month I attended <a href="http://blog.tanelpoder.com">Tanel Poder</a>&#8217;s course <a href="http://miraclebenelux.nl/index.php?option=com_content&amp;view=article&amp;id=50:tanelpoderevent">&#8220;Advanced Oracle Troubleshooting for DBAs and Performance Engineers&#8221;</a>.</p>
<p>It was good &#8211; definitely worthwhile, lots of useful information and really puts into perspective those scripts of his, like <a href="http://blog.tanelpoder.com/2008/08/26/flexible-sampling-of-any-v-or-x-view-with-samplesql/">LatchProf, LatchProfX, WaitProf and sample.sql.</a> Plus <a href="http://blog.tanelpoder.com/seminar/seminar-files/">a whole bunch of other stuff</a>. So definitely worth thinking about if you&#8217;ve any training budget (that&#8217;s mine blown for forseeable future).</p>
<p>I&#8217;ve already mentioned the <a href="http://orastory.wordpress.com/2009/09/16/metalink-headlines/">Metalink Headlines</a> tip and I&#8217;ve had a little jump in traffic over the past couple of days from <a href="http://blog.tanelpoder.com/2009/10/26/whats-a-good-way-to-learn-some-oracle-internals-every-day/">Tanel saying the same thing</a>.</p>
<p>The other top tip was to read <a href="http://jamesmorle.wordpress.com/">James Morle</a>&#8217;s book <a href="http://www.scaleabilities.co.uk/index.php/Books/">Scaling Oracle 8i</a>. James was there on the second day but that wasn&#8217;t why it was recommended. Ignore the 8i in the title, most of it remains as relevant as it ever was. I don&#8217;t know how I never read this at the time but I&#8217;m ploughing through it on the train and it&#8217;s a real, real benefit. It&#8217;s not just about Oracle. It&#8217;s as much about the stuff it interacts with &#8211; OS, IO subsystems, memory, etc.<br />
It&#8217;s downloadable. Read it.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orastory.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orastory.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orastory.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orastory.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orastory.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orastory.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orastory.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orastory.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orastory.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orastory.wordpress.com/380/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=380&subd=orastory&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://orastory.wordpress.com/2009/10/28/learning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dombrooks</media:title>
		</media:content>
	</item>
		<item>
		<title>Metalink headlines</title>
		<link>http://orastory.wordpress.com/2009/09/16/metalink-headlines/</link>
		<comments>http://orastory.wordpress.com/2009/09/16/metalink-headlines/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 09:51:50 +0000</pubDate>
		<dc:creator>dombrooks</dc:creator>
				<category><![CDATA[Metalink]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://orastory.wordpress.com/?p=364</guid>
		<description><![CDATA[When I was thinking about whether to go on Tanel Poder&#8217;s course, I read the testimonials and there&#8217;s a great piece of advice from Tanel via Coskan Gundogar:

I asked him how do you learn all these interesting stuff. He gave me a perfect clue. Sign up for metalink headlines mailing list. Bugs docs they are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=364&subd=orastory&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When I was thinking about whether to go on <a href="http://blog.tanelpoder.com">Tanel Poder&#8217;s</a> <a href="http://www.miraclebenelux.nl/index.php?option=com_content&amp;view=article&amp;id=50&amp;Itemid=12">course</a>, I read the testimonials and there&#8217;s a great piece of advice from Tanel <a href="http://coskan.wordpress.com/2009/04/30/what-i-learned-from-aot-by-tanel-poder/">via Coskan Gundogar</a>:</p>
<blockquote><p>
I asked him how do you learn all these interesting stuff. He gave me a perfect clue. Sign up for metalink headlines mailing list. Bugs docs they are all there after they are created. Perfect resource.
</p></blockquote>
<p>I just want to emphasise what a great resource these Metalink updates are.</p>
<p>I&#8217;ve only been signed up for a couple of weeks but some of the nuggets that come into your mailbox are pure gold.</p>
<p>I&#8217;ve learnt some stuff that I would never come across, plus I&#8217;m building up links for some great articles and explanations, some of which are invaluable as a reference for yourself or to give others (I&#8217;m rubbish at explaining stuff in my own words).</p>
<p>For example, just from the last couple of days, I&#8217;ve been notified of these new or updated articles:<br />
(Note: Login to Metalink first before clicking the links)</p>
<p>Character set and character set conversion (comes up all the time on the forums and from other teams at work):</p>
<ul>
<li>260893.1: <a href="https://metalink.oracle.com/CSP/main/article?cmd=show&amp;type=NOT&amp;id=260893.1">Unicode Character Sets In The Oracle Database</a></li>
<li>158577.1: <a href="https://metalink.oracle.com/CSP/main/article?cmd=show&amp;type=NOT&amp;id=158577.1">NLS_LANG explained</a></li>
</ul>
<p>Metalink Scripts:</p>
<ul>
<li>131704.1: <a href="https://metalink.oracle.com/CSP/main/article?cmd=show&amp;type=NOT&amp;id=131704.1">Database Scripts Library Index</a></li>
</ul>
<p>General:</p>
<ul>
<li>783357.1: <a href="https://metalink.oracle.com/CSP/main/article?cmd=show&amp;type=NOT&amp;id=783357.1">Troubleshooting DBMS_SCHEDULER and DBMS_JOB</a></li>
</ul>
<p>Interesting behaviour:</p>
<ul>
<li>887553.1: <a href="https://metalink.oracle.com/CSP/main/article?cmd=show&amp;type=NOT&amp;id=887553.1">Join elimination does not happen for Composite Foregin key</a></li>
</ul>
<p>To name but a few&#8230;</p>
<p>It&#8217;s just invaluable stuff. </p>
<p>Sign up if you don&#8217;t already.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orastory.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orastory.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orastory.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orastory.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orastory.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orastory.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orastory.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orastory.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orastory.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orastory.wordpress.com/364/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=364&subd=orastory&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://orastory.wordpress.com/2009/09/16/metalink-headlines/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dombrooks</media:title>
		</media:content>
	</item>
		<item>
		<title>Data modelling in the modern world</title>
		<link>http://orastory.wordpress.com/2009/08/06/data-modelling-in-the-modern-world/</link>
		<comments>http://orastory.wordpress.com/2009/08/06/data-modelling-in-the-modern-world/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 15:10:29 +0000</pubDate>
		<dc:creator>dombrooks</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://orastory.wordpress.com/?p=359</guid>
		<description><![CDATA[I first read Robyn Sands&#8217;s article on the importance of a good data model back when it was published in May.
However, the comments have since moved on and taken a life of their own &#8211; a sure sign of a great post &#8211; with some excellent points and poignant observations on the frequent neglect of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=359&subd=orastory&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I first read <a href="http://adhdocddba.blogspot.com/2009/05/on-importance-of-good-data-model.html">Robyn Sands&#8217;s article on the importance of a good data model</a> back when it was published in May.</p>
<p>However, the comments have since moved on and taken a life of their own &#8211; a sure sign of a great post &#8211; with some excellent points and poignant observations on the frequent neglect of the data model in the agile world.</p>
<p>If you&#8217;ve not read it or have not kept updated with the comments, then I urge you to.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orastory.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orastory.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orastory.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orastory.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orastory.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orastory.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orastory.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orastory.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orastory.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orastory.wordpress.com/359/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=359&subd=orastory&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://orastory.wordpress.com/2009/08/06/data-modelling-in-the-modern-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dombrooks</media:title>
		</media:content>
	</item>
		<item>
		<title>Gotcha: Application Contexts</title>
		<link>http://orastory.wordpress.com/2009/07/14/gotcha-application-contexts/</link>
		<comments>http://orastory.wordpress.com/2009/07/14/gotcha-application-contexts/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 10:12:04 +0000</pubDate>
		<dc:creator>dombrooks</dc:creator>
				<category><![CDATA[11.1.0.7]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sys_context]]></category>

		<guid isPermaLink="false">http://orastory.wordpress.com/?p=355</guid>
		<description><![CDATA[This is one of those feature behaviours which isn&#8217;t surprising, but you probably wouldn&#8217;t think about it unless you saw it.
The flop:
I make heavy use of application contexts in flexible, variable input, dynamically-built queries (one of the options mentioned in this asktom thread for example).
(In the latest edition of Oracle Magazine, Tom explains why this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=355&subd=orastory&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is one of those feature behaviours which isn&#8217;t surprising, but you probably wouldn&#8217;t think about it unless you saw it.</p>
<p><strong>The flop:</strong></p>
<p>I make heavy use of <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions172.htm#SQLRF06117">application contexts</a> in flexible, variable input, dynamically-built queries (one of the options mentioned in <a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:104931400346587790">this asktom thread</a> for example).</p>
<p>(In the <a href="http://www.oracle.com/technology/oramag/oracle/09-jul/index.html">latest edition of Oracle Magazine</a>, <a href="http://www.oracle.com/technology/oramag/oracle/09-jul/o49asktom.html">Tom explains</a> why this is not an approach he would recommend any more. I don&#8217;t necessarily agree but more of that another time perhaps)</p>
<p><strong>The Turn:</strong></p>
<p>My Query Builder &#8211; a set of code which I&#8217;ve always intended to make publicly available but have yet to do so &#8211; uses a context with single namespace and typically reuses attribute names between queries &#8211; e.g. a product id populated from an on-screen product selector will typically populate a context attribute called PRODUCT_ID.</p>
<p>And a Query Builder implementation will typically reset any context attributes(DBMS_SESSION.CLEAR_ALL_CONTEXT) at the start to clear any parameters from a previous query.</p>
<p>In one of the more complex scenarios, a controller proc constructs three different queries, based on the input parameters supplied, in order to return three resultsets to populate three different parts of a GUI. A bit like this dummy code:</p>
<pre class="brush: plain;">
CREATE OR REPLACE PROCEDURE p_get_matching_data (
  i_parameters             IN  some_array_type
  o_cursor1                 OUT SYS_REFCURSOR,
  o_cursor2                 OUT SYS_REFCURSOR,
  o_cursor3                 OUT SYS_REFCURSOR
)
AS
   l_query1 LONG;
   l_query2 LONG;
   l_query3 LONG;
BEGIN
   l_query1 := my_query_builder_pkg.build_query1(i_parameters);
   OPEN o_cursor1 FOR l_query1;
   l_query2 := my_query_builder_pkg.build_query2(i_parameters);
   OPEN o_cursor2 FOR l_query2;
   l_query3 := my_query_builder_pkg.build_query3(i_parameters);
   OPEN o_cursor3 FOR l_query3;
END;
</pre>
<p><strong>The River:</strong></p>
<p>The problem with SYS_CONTEXT is that it is not bound into the query like a bind variable, nor is it subject to the same read consistency mechanism as block data.</p>
<p>Witness:</p>
<pre class="brush: plain;">
DOMINIC@11gR1&amp;gt;VAR r REFCURSOR
DOMINIC@11gR1&amp;gt;CREATE CONTEXT demo_ctx USING context_demo_pkg;

Context created.

Elapsed: 00:00:00.00
DOMINIC@11gR1&amp;gt;CREATE OR REPLACE PACKAGE context_demo_pkg
  2  AS
  3    --
  4    PROCEDURE p_set_context (
  5      i_attribute                IN     VARCHAR2,
  6      i_value                    IN     VARCHAR2
  7    );
  8    --
  9    PROCEDURE p_unset_context (
 10      i_attribute                IN     VARCHAR2
 11    );
 12    --
 13  END;
 14  /

Package created.

Elapsed: 00:00:00.00
DOMINIC@11gR1&amp;gt;CREATE OR REPLACE PACKAGE BODY context_demo_pkg
  2  AS
  3    --
  4    k_namespace CONSTANT VARCHAR2(24) := 'DEMO_CTX';
  5    --
  6    PROCEDURE p_set_context (
  7      i_attribute                IN     VARCHAR2,
  8      i_value                    IN     VARCHAR2
  9    )
 10    AS
 11    BEGIN
 12       --
 13       DBMS_SESSION.SET_CONTEXT
 14       (namespace =&amp;gt; k_namespace,
 15        attribute =&amp;gt; i_attribute,
 16        value     =&amp;gt; i_value);
 17       --
 18    END p_set_context;
 19    --
 20    PROCEDURE p_unset_context (
 21      i_attribute                IN     VARCHAR2
 22    )
 23    AS
 24    BEGIN
 25       --
 26       DBMS_SESSION.CLEAR_CONTEXT
 27       (namespace =&amp;gt; k_namespace,
 28        attribute =&amp;gt; i_attribute);
 29       --
 30    END p_unset_context;
 31    --
 32  END;
 33  /

Package body created.

Elapsed: 00:00:00.00
DOMINIC@11gR1&amp;gt;
</pre>
<p>Now to demonstrate the different behaviour.</p>
<p>The bind variable:</p>
<pre class="brush: plain;">
DOMINIC@11gR1&amp;gt;DECLARE
  2   l_value  varchar2(24) := 'My Test Bind';
  3  BEGIN
  4    open :r for select l_value from dual;
  5    l_value := null;
  6  END;
  7  /

PL/SQL procedure successfully completed.

:B1
--------------------------------
My Test Bind

Elapsed: 00:00:00.00
DOMINIC@11gR1&amp;gt;
</pre>
<p>No surprises there.<br />
Now the illustration of read consistency:</p>
<pre class="brush: plain;">
DOMINIC@11gR1&amp;gt;CREATE TABLE test_data
  2  (col1 VARCHAR2(1));

Table created.

Elapsed: 00:00:01.02
DOMINIC@11gR1&amp;gt;
DOMINIC@11gR1&amp;gt;INSERT
  2  INTO   test_data
  3  VALUES ('A');

1 row created.

Elapsed: 00:00:00.00
DOMINIC@11gR1&amp;gt;BEGIN
  2     OPEN :r FOR SELECT * FROM test_data;
  3     DELETE FROM test_data;
  4     COMMIT;
  5  END;
  6  /

PL/SQL procedure successfully completed.

C
-
A

Elapsed: 00:00:00.00
DOMINIC@11gR1&amp;gt;
</pre>
<p>Again, no surprises. Read consistency around cursor opening/fetching as you might expect.<br />
Next, the application context.</p>
<p>Firstly, just to prove that it works:</p>
<pre class="brush: plain;">
DOMINIC@11gR1&amp;gt;BEGIN
  2     context_demo_pkg.p_set_context('VALUE1','My Test Bind');
  3     OPEN :r FOR SELECT SYS_CONTEXT('DEMO_CTX','VALUE1') FROM dual;
  4  END;
  5  /

PL/SQL procedure successfully completed.

SYS_CONTEXT('DEMO_CTX','VALUE1')
-------------------------------------
My Test Bind

Elapsed: 00:00:00.00
DOMINIC@11gR1&amp;gt;
</pre>
<p>But if we reset it before we fetch from the cursor:</p>
<pre class="brush: plain;">
DOMINIC@11gR1&amp;gt;BEGIN
  2     context_demo_pkg.p_set_context('VALUE1','My Test Bind');
  3     OPEN :r FOR SELECT SYS_CONTEXT('DEMO_CTX','VALUE1') FROM dual;
  4     context_demo_pkg.p_unset_context('VALUE1');
  5  END;
  6  /

PL/SQL procedure successfully completed.

SYS_CONTEXT('DEMO_CTX','VALUE1')
---------------------------------------

Elapsed: 00:00:00.00
DOMINIC@11gR1&amp;gt;
</pre>
<p>So, once you see it, not entirely unsurprising but maybe not something that you&#8217;d considered before ( I hadn&#8217;t ). Behaviour neither like a bind nor read consistency like block data.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orastory.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orastory.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orastory.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orastory.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orastory.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orastory.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orastory.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orastory.wordpress.com/355/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orastory.wordpress.com/355/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orastory.wordpress.com/355/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=355&subd=orastory&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://orastory.wordpress.com/2009/07/14/gotcha-application-contexts/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dombrooks</media:title>
		</media:content>
	</item>
		<item>
		<title>Documentation in need of confidence booster</title>
		<link>http://orastory.wordpress.com/2009/07/05/oracle-documentation-doubting-itself/</link>
		<comments>http://orastory.wordpress.com/2009/07/05/oracle-documentation-doubting-itself/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 07:29:12 +0000</pubDate>
		<dc:creator>dombrooks</dc:creator>
				<category><![CDATA[11g]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[charactersets]]></category>
		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://orastory.wordpress.com/?p=348</guid>
		<description><![CDATA[Some people attach a lot of weight to what the Oracle documentation says.
Rightly so, most of the time. It is a hugely significant resource.
But there are some documentation bugs / errors.
I was answering a character set posting on the OTN forums and when providing some links to the doco, I noticed the quote below in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=348&subd=orastory&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Some people attach a lot of weight to what the Oracle documentation says.</p>
<p>Rightly so, most of the time. It is a hugely significant resource.</p>
<p>But there are some documentation bugs / errors.</p>
<p>I was answering a character set posting on the OTN forums and when providing some links to the doco, I noticed <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28298/ch6unicode.htm#i1006807">the quote below in the official documentation</a>:</p>
<p><code><br />
I think these secions that describe encoding are out of date. For example, do Java and Microsoft Windows still use UCS-2? Or do they use UTF-16? I think UNIX uses UTF-32. So I am confused about what is the most current information for these sections.<br />
</code></p>
<p>How reassuring <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orastory.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orastory.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orastory.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orastory.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orastory.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orastory.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orastory.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orastory.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orastory.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orastory.wordpress.com/348/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=348&subd=orastory&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://orastory.wordpress.com/2009/07/05/oracle-documentation-doubting-itself/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dombrooks</media:title>
		</media:content>
	</item>
		<item>
		<title>Madness</title>
		<link>http://orastory.wordpress.com/2009/05/29/madness/</link>
		<comments>http://orastory.wordpress.com/2009/05/29/madness/#comments</comments>
		<pubDate>Fri, 29 May 2009 14:44:03 +0000</pubDate>
		<dc:creator>dombrooks</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://orastory.wordpress.com/?p=345</guid>
		<description><![CDATA[Just a quick one&#8230;
Had a meeting request today to get an idea of the different authorisation groups that will be required when in the future we move to a model that carries the authorisation ACL with the data.
This is a part of an ongoing architectural initiative to turn a logic-heavy database effectively into a bit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=345&subd=orastory&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Just a quick one&#8230;</p>
<p>Had a meeting request today to <em>get an idea of the different authorisation groups that will be required when in the future we move to a model that carries the authorisation ACL with the data</em>.</p>
<p>This is a part of an ongoing architectural initiative to turn a logic-heavy database effectively into a bit bucket. </p>
<p>I know these things are going on all the time everywhere in a quasi-religious battle.<br />
I know I&#8217;ve talked about it before as have many others elsewhere.<br />
I&#8217;m sure I resolved to let it wash over me and not to get bothered by it or get sucked into battles I can&#8217;t win.</p>
<p>But this is madness this aspiration that this database, probably one of the most expensive bits of this tech stack, should be reduced to a bit bucket at some point in the future.</p>
<p>With the middle tier doing the data joining&#8230;</p>
<p>The middle tier doing what should be the set operations in the database in some sort of horrific giant nested loop operation&#8230;</p>
<p>And the middle tier doing the data security, which should be right there with the data in the database.</p>
<p>It&#8217;s a mad world.</p>
<p>And in today&#8217;s economic climate, this can&#8217;t be what they mean by &#8220;doing more for less&#8221;.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orastory.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orastory.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orastory.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orastory.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orastory.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orastory.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orastory.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orastory.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orastory.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orastory.wordpress.com/345/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=345&subd=orastory&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://orastory.wordpress.com/2009/05/29/madness/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dombrooks</media:title>
		</media:content>
	</item>
		<item>
		<title>Don&#8217;t use One.com</title>
		<link>http://orastory.wordpress.com/2009/05/20/dont-use-one-com/</link>
		<comments>http://orastory.wordpress.com/2009/05/20/dont-use-one-com/#comments</comments>
		<pubDate>Wed, 20 May 2009 20:16:09 +0000</pubDate>
		<dc:creator>dombrooks</dc:creator>
				<category><![CDATA[domain registration]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[one.com]]></category>

		<guid isPermaLink="false">http://orastory.wordpress.com/?p=342</guid>
		<description><![CDATA[This is not an oracle-related post. 
Just a warning about using one.com for domain hosting.
Unlike previous domain registration and hosting companies which I have used before, with one.com if you don&#8217;t give them 35 days notice before the end of your domain &#8220;lease&#8221; that you do not wish to renew, then you are obliged to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=342&subd=orastory&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is not an oracle-related post. </p>
<p>Just a warning about using one.com for domain hosting.</p>
<p>Unlike previous domain registration and hosting companies which I have used before, with one.com if you don&#8217;t give them 35 days notice before the end of your domain &#8220;lease&#8221; that you do not wish to renew, then you are obliged to pay for a further 12 months. If you then fail to pay to their schedule they then add late payment charges within a week of the domain renewal timeline with threats to raise late payment charges of 50% of the domain renewal fee per week.</p>
<p>Of course, caveat emptor.<br />
I should have read the alleged terms and conditions.</p>
<p>But if you are looking at the various &#8220;deals&#8221; on domain registration and hosting, bear this opinion in mind.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orastory.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orastory.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orastory.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orastory.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orastory.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orastory.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orastory.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orastory.wordpress.com/342/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orastory.wordpress.com/342/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orastory.wordpress.com/342/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=342&subd=orastory&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://orastory.wordpress.com/2009/05/20/dont-use-one-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dombrooks</media:title>
		</media:content>
	</item>
		<item>
		<title>YAGNI?</title>
		<link>http://orastory.wordpress.com/2009/05/14/yagni/</link>
		<comments>http://orastory.wordpress.com/2009/05/14/yagni/#comments</comments>
		<pubDate>Thu, 14 May 2009 20:47:20 +0000</pubDate>
		<dc:creator>dombrooks</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[yagni]]></category>

		<guid isPermaLink="false">http://orastory.wordpress.com/?p=338</guid>
		<description><![CDATA[YAGNI, it&#8217;s a very common term in development teams these days. Overused even.
However, in today&#8217;s more austere and economically challenging times, I have some new acronyms for you.
I&#8217;m not really up on popular acronyms so these may already exist in some form or another, but here are some more appropriate sayings that I&#8217;m saying/seeing more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=338&subd=orastory&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://en.wikipedia.org/wiki/You_Ain%27t_Gonna_Need_It">YAGNI</a>, it&#8217;s a very common term in development teams these days. Overused even.</p>
<p>However, in today&#8217;s more austere and economically challenging times, I have some new acronyms for you.</p>
<p>I&#8217;m not really up on popular acronyms so these may already exist in some form or another, but here are some more appropriate sayings that I&#8217;m saying/seeing more and more, together especially:</p>
<p>I Do Bloody Well Need It (IBLOWENI &#8211; ha ha) &#8230; but &#8230; NO-one&#8217;s Gonna Pay For It (NOGOPAFI).</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orastory.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orastory.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orastory.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orastory.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orastory.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orastory.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orastory.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orastory.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orastory.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orastory.wordpress.com/338/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=338&subd=orastory&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://orastory.wordpress.com/2009/05/14/yagni/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dombrooks</media:title>
		</media:content>
	</item>
		<item>
		<title>Motivation</title>
		<link>http://orastory.wordpress.com/2009/02/19/motivation/</link>
		<comments>http://orastory.wordpress.com/2009/02/19/motivation/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 21:28:45 +0000</pubDate>
		<dc:creator>dombrooks</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://orastory.wordpress.com/?p=303</guid>
		<description><![CDATA[I&#8217;ve mentioned before that I&#8217;m lucky enough, given my own database-heavy focus, to be currently servicing a client whose applications tend to be database-heavy in terms of logic.
They are moving their applications gradually, yet wholesale and with no exceptions, towards an N-tier architecture throughout the company and their particular interpretation of N-tier means treating the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=303&subd=orastory&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve mentioned before that I&#8217;m lucky enough, given my own database-heavy focus, to be currently servicing a client whose applications tend to be database-heavy in terms of logic.</p>
<p>They are moving their applications gradually, yet wholesale and with no exceptions, towards an N-tier architecture throughout the company and their particular interpretation of N-tier means treating the database like a bit bucket (the only place I&#8217;ve been where they treat n-tier and database independent as synonymous although I know this is not an uncommon misunderstanding).</p>
<p>Today I had a conversation with one of the .Net developers along the lines of &#8220;you must be gutted given your database expertise.&#8221;</p>
<p>To which my response was that I was not particularly bothered which tier had the most lines of code &#8211; at the end of the day, it&#8217;s not a competition.</p>
<p>There are four things which primarily motivate me, or give me the most pleasure, in a professional capacity:</p>
<ol>
<li>Making slow, inefficient code fly.</li>
<li>*Writing <del datetime="2009-02-20T08:39:43+00:00">cool</del> satisfying code.</li>
<li>*Good design and good data modelling .</li>
<li>Using databases efficiently.</li>
</ol>
<p><span><font size="-2">*Incidentally, when designing and developing, I&#8217;m a great believer in the frequent need to not force it but wait for the right way to make itself known (at whatever time of day or night that might be).</font></span></p>
<p>So, moving a bunch of business logic (and in general very poorly written database logic) out of the database doesn&#8217;t bother me &#8211; the location of this logic doesn&#8217;t matter as long as it makes sense.</p>
<p>Remodelling and rearchitecting processes out of the database doesn&#8217;t bother me as long as it&#8217;s done accurately and properly wherever, and data is modelled appropriately.</p>
<p>In fact, the only thing which bothers me is that this rearchitecture is going to eventually involve Hibernate or similar, which will translate a single object save into a hundred individual insert or update statements, no bulk operations, nothing. I don&#8217;t like ORM (although I am very fond of OR views or an OR api in the database which can map one object save to as few operations in the database as is necessary).</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/orastory.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/orastory.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/orastory.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/orastory.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/orastory.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/orastory.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/orastory.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/orastory.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/orastory.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/orastory.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=orastory.wordpress.com&blog=672199&post=303&subd=orastory&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://orastory.wordpress.com/2009/02/19/motivation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dombrooks</media:title>
		</media:content>
	</item>
	</channel>
</rss>