<?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>Boneist&#039;s Oracle Blog</title>
	<atom:link href="http://www.orchestrapit.co.uk/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.orchestrapit.co.uk</link>
	<description>The ramblings of an Oracle developer</description>
	<lastBuildDate>Fri, 16 Dec 2011 17:20:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Dev or DBA? Where does the responsibility lie&#8230;</title>
		<link>http://www.orchestrapit.co.uk/?p=131&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dev-or-dba-where-does-the-responsibility-lie</link>
		<comments>http://www.orchestrapit.co.uk/?p=131#comments</comments>
		<pubDate>Fri, 16 Dec 2011 17:20:19 +0000</pubDate>
		<dc:creator>boneist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DBAs vs Devs]]></category>

		<guid isPermaLink="false">http://www.orchestrapit.co.uk/?p=131</guid>
		<description><![CDATA[&#8230; which could be the title of a really great post about a big prod issue debriefing, but sadly, all you&#8217;re getting is this post instead! At the UKOUG 2011 conference, I attended a presentation by Michael Salt about indexes. &#8230;<p class="read-more"><a href="http://www.orchestrapit.co.uk/?p=131">Continue reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>&#8230; which could be the title of a really great post about a big prod issue debriefing, but sadly, all you&#8217;re getting is this post instead!</p>
<p>At the UKOUG 2011 conference, I attended a presentation by Michael Salt about indexes. During the course of the presentation, he mentioned something along the lines of &#8220;DBA&#8217;s should be responsible for indexes (including creating them)&#8221; (that&#8217;s not a quote; I can&#8217;t remember exactly what he said, unfortunately!). I more or less recoiled, because as a database developer, I would expect to be the person worrying about whether I should be creating an index on a column(s) or not, as part of the design / coding phase. Or even as part of the &#8220;why is this query going soooo sloooooooowly?!&#8221; prod issue investigation phase.</p>
<p>When I mentioned this on Twitter and Facebook, one of my friends said it was because I was a control freak. He&#8217;s not wrong &#8211; I am a control freak &#8211; but I think that&#8217;s irrelevant in this case; the time for thinking about index creation is at design phase, and that (at least, to my mind) is firmly in the developer&#8217;s area.</p>
<p>Don&#8217;t get me wrong; DBAs are fantastic, knowledgable people (I have to say that, I know far more DBAs than Oracle devs! Anyway, it&#8217;s true &#8211; at least for most of the DBAs I know) and I&#8217;m more than willing to take up my DBA&#8217;s advice whenever he&#8217;s got some to dispense, but DBA&#8217;s are always busy looking after far more systems than I do, so I try hard not to take up more of their time than I have to.</p>
<p>It seems that I&#8217;m in a minority over where the dev responsibility ends and the DBA&#8217;s starts &#8211; things like schema / app design, index creation, SQL optimisation etc are dev activities, whereas things like backups, restores, db creations, GoldenGate setup and tinkering, db tuning, giving advice on poorly performing areas of the code, etc etc are more DBA concerns.</p>
<p>Is it just me? Who should deal with thinking about indexes? Devs or DBA&#8217;s? What are your thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.orchestrapit.co.uk/?feed=rss2&#038;p=131</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>UKOUG 2011 &#8211; Social stuff</title>
		<link>http://www.orchestrapit.co.uk/?p=124&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ukoug-2011-social-stuff</link>
		<comments>http://www.orchestrapit.co.uk/?p=124#comments</comments>
		<pubDate>Fri, 16 Dec 2011 16:46:16 +0000</pubDate>
		<dc:creator>boneist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[ukoug_2011]]></category>

		<guid isPermaLink="false">http://www.orchestrapit.co.uk/?p=124</guid>
		<description><![CDATA[I go to the UKOUG conferences to learn stuff from the presentations, but I also go to meet people. If I didn&#8217;t really know anyone, I wouldn&#8217;t go! (As evidenced by the fact that I didn&#8217;t go until 2 years &#8230;<p class="read-more"><a href="http://www.orchestrapit.co.uk/?p=124">Continue reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I go to the UKOUG conferences to learn stuff from the presentations, but I also go to meet people. If I didn&#8217;t really know anyone, I wouldn&#8217;t go! (As evidenced by the fact that I didn&#8217;t go until 2 years ago, which was not long after I&#8217;d met Doug Burns and let him talk me into going! Doug knows *everyone*, I swear!).</p>
<p>Here are the Social highlights of this year&#8217;s conference for me (I could detail every meeting, but even I would get bored of reading all that! Needless to say, everyone I met was brilliant, and the discussions etc that we had were entertaining.):</p>
<p><b>People I met/met up with during the conference (in no particular order!):</b></p>
<ul>
<li>David (<a href="http://twitter.com/Farkough">@Farkough</a> on Twitter), who is an old friend (and fellow spod!(*))</li>
<li>Martin Widlake (<a href="http://twitter.com/MDWidlake">@MDWidlake</a> on Twitter). A fellow Oracle London Beer conspiritor</li>
<li>Neil Chandler (<a href="http://twitter.com/ChandlerDBA">@ChandlerDBA</a> on Twitter). A fellow Oracle London Beer conspiritor</li>
<li>Doug Burns (<a href="http://twitter.com/orcldoug">@orcldoug</a> on Twitter). Yet another fellow Oracle London Beer conspiritor (they get around, right?!)</li>
<li>David Kurtz (<a href="http://twitter.com/davidmkurtz">@davidmkurtz</a> on Twitter).</li>
<li>Niall Litchfield (<a href="http://twitter.com/nlitchfield">@nlitchfield</a> on Twitter). An occasional Oracle London Beer attendee</li>
<li>Patrick Hurley (<a href="http://twitter.com/phurley">@phurley</a> on Twitter).</li>
<li>Piet de Visser (<a href="http://twitter.com/pdevisser">@pdevisser</a> on Twitter).</li>
<li>Tony Sleight (? I think that was his surname!)</li>
<li>&#8220;Big&#8221; Dave Roberts (<a href="http://bigdaveroberts.wordpress.com/">blog</a>).</li>
<li>Karen, Tony, Kalyan, and Aftab (? I think I&#8217;ve probably got the wrong name here; hope somebody will correct me!) &#8211; ex-colleagues of Martin Widlake&#8217;s.</li>
<li>Jonathan Lewis (<a href="http://jonathanlewis.wordpress.com/all-postings/">blog</a>). Another occasional Oracle London Beer attendee.</li>
<li>Connor McDonald (<a href="http://twitter.com/connor_mc_d">@connor_mc_d</a> on Twitter).</li>
<li>Kyle Hailey (<a href="http://twitter.com/dboptimizer">@dboptimizer</a> on Twitter).</li>
<li>Marco Gralike (<a href="http://twitter.com/MGralike">@MGralike</a> on Twitter).</li>
<li>Alex Gorbachev (<a href="http://twitter.com/alexgorbachev">@alexgorbachev</a> on Twitter).</li>
<li>Debra Lilley (<a href="http://twitter.com/debralilley">@debralilley</a> on Twitter).</li>
<li>Lisa Dobson (<a href="http://twitter.com/lj_dobson">@lj_dobson</a> on Twitter).</li>
<li>Alex Nuijten (<a href="http://twitter.com/alexnuijten">@alexnuijten</a> on Twitter).</li>
<li>Tim Hall (<a href="http://twitter.com/oraclebase">@oraclebase</a> on Twitter).</li>
<li>Ben Burrell, aka Munky (<a href="http://twitter.com/munkyben">@munkyben</a> on Twitter).</li>
<li>Martin Bach (<a href="http://twitter.com/MartinDBA">@MartinDBA</a> on Twitter).</li>
</ul>
<p>(If I&#8217;ve forgotten to add anyone, it&#8217;ll be my shoddy memory, and not down to them!)</p>
<p><b>Highlights</b></p>
<ul>
<li>Going out for a meal on the Monday night with David (@Farkough), Martin W and Neil, and having a laugh</li>
<li>Going on to the Tap and Spile following the focus pubs on the Monday night with Niall, Martin, Neil, Dave R and Tony, with Munky popping his head in occasionally. I shall never look at carrots in the same way again!</li>
<li>Going out for a meal on the Tuesday night with Martin W, Dave R and Martin W&#8217;s ex-colleagues, then heading off to the masked ball, and bumping into Connor, Kyle, Doug, Niall and Tony amongst others</li>
<li>Ending up at the Jury&#8217;s bar until the wee small hours of Monday evening, and talking lots of random stuff with various people, including particle physics, and also getting told off by Marco about my shoddy XML db design *{;-)</li>
<li>The Oak Talks, whilst not strictly a social thing, were fun and entertaining. I hope they have them again next year!</li>
</ul>
<p>(*) We&#8217;re both members of the same BBS: http://www.mono.org/  &#8211; still accessible via telnet!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.orchestrapit.co.uk/?feed=rss2&#038;p=124</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>UKOUG2011 &#8211; Day 3 (Wednesday)</title>
		<link>http://www.orchestrapit.co.uk/?p=122&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ukoug2011-day-3-wednesday</link>
		<comments>http://www.orchestrapit.co.uk/?p=122#comments</comments>
		<pubDate>Sun, 11 Dec 2011 23:15:13 +0000</pubDate>
		<dc:creator>boneist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[ukoug_2011]]></category>

		<guid isPermaLink="false">http://www.orchestrapit.co.uk/?p=122</guid>
		<description><![CDATA[After a late night (um, < 4 hours sleep...) I was up bright and... well, just early now I come to think of it! I checked out, retrieved the coat (phew!) I hadn't realised I'd left in the hotel bar &#8230;<p class="read-more"><a href="http://www.orchestrapit.co.uk/?p=122">Continue reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>After a late night (um, < 4 hours sleep...) I was up bright and... well, just early now I come to think of it! I checked out, retrieved the coat (phew!) I hadn't realised I'd left in the hotel bar until just before I was about to leave the hotel room for the final time and had breakfast.</p>
<p>Then it was off to the first presentation of the day...</p>
<p><b><u>Statistics On Partitioned Objects &#8211; Doug Burns</u></b></p>
<p>I have a feeling that I&#8217;ve seen this presentation before &#8211; it&#8217;s possible that I haven&#8217;t seen the entire presentation, but I believe Doug did a couple of work presentations around this subject. Anyway, whether it was those or his blog entries on the subject, a lot of it felt familiar. Doug is an engaging speaker, and the subject is an interesting one. I&#8217;m not sure whether it&#8217;s applicable to the way our databases are designed, but I will be recalling this talk (amongst others) when I think of ways to improve our stats gathering when we go to 11g.</p>
<p><b><u>Using GoldenGate To Minimize Database Upgrade Risk &#8211; Marc Fielding</u></b></p>
<p>I didn&#8217;t fully understand what this talk was going to be about when I signed up for it, but having just worked with and upgraded GoldenGate following a bug in the version we use, plus the upcoming 11g upgrade, I thought it would be a good thing to go to.</p>
<p>Ultimately, I don&#8217;t think it&#8217;s applicable in our situation this time, but it was about using GoldenGate to copy the data changes from a, for example, 10g database up to the same db but in 11g. Potentially very useful, so a good idea to have in the back of my mind, should I ever come across a situation where it could be used.</p>
<p>The talk was aimed more at DBAs than devs, I think, but I was pleased that I understood most of the GG terms he used &#8211; our recent issues at least consolidated my GG knowledge, so it wasn&#8217;t all bad!</p>
<p><b><u>Optimizer Statistics &#8211; A Fresh Approach &#8211; Connor McDonald</u></b></p>
<p>Yes, the keener eyed/memoried amongst you will spot that I attended this on Sunday. Well, I did have another session lined up to go to, but by this time, my brain couldn&#8217;t handle much! Connor was just as amazing as he was on Sunday (no surprise there, then!), and I was able to just sit back and be entertained! (Thanks Connor!)</p>
<p><b><u>Faster, Leaner, More Efficient Databases &#8211; Index Organised Tables &#8211; Martin Widlake</u></b></p>
<p>Martin has done a series of blog entries on IOTs and this proved to be an interesting talk. I&#8217;ve used IOTs in the past, and will perhaps again, now that our version of GG has gone up to the latest version (the version we had previously couldn&#8217;t handle IOTs; I&#8217;m not sure about the new version, but I&#8217;d hope it would!).</p>
<p>The performance stuff was especially interesting, so I&#8217;ll have to go away and see how it might be applied in our databases. A good talk to have gone to.</p>
<p><b><u>What Shape Is Your Data? &#8211; Niall Litchfield</u></b></p>
<p>This was the last talk of the conference, and it was interesting. Niall took us through some examples of how data might be organised and what can be done to best optimize it.</p>
<p>Truth be told, I was flagging a little by this point, so didn&#8217;t retain as much of the talk as I&#8217;d have liked &#8211; I&#8217;ll definitely be downloading the slides, when they appear!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.orchestrapit.co.uk/?feed=rss2&#038;p=122</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>UKOUG2011 &#8211; Day 2 (Tuesday)</title>
		<link>http://www.orchestrapit.co.uk/?p=118&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ukoug2011-day-2-tuesday</link>
		<comments>http://www.orchestrapit.co.uk/?p=118#comments</comments>
		<pubDate>Sat, 10 Dec 2011 22:00:40 +0000</pubDate>
		<dc:creator>boneist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[ukoug_2011]]></category>

		<guid isPermaLink="false">http://www.orchestrapit.co.uk/?p=118</guid>
		<description><![CDATA[So, Tuesday dawned bright and &#8230; er, well I didn&#8217;t go in for the first session of the day (not that I&#8217;d found one I wanted to go in for anyway, so nothing lost there!) but I was definitely there &#8230;<p class="read-more"><a href="http://www.orchestrapit.co.uk/?p=118">Continue reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>So, Tuesday dawned bright and &#8230; er, well I didn&#8217;t go in for the first session of the day (not that I&#8217;d found one I wanted to go in for anyway, so nothing lost there!) but I was definitely there for the second session!</p>
<p><b><u>Who&#8217;s Afraid Of Analytic Functions? &#8211; Alex Nuijten</u></b></p>
<p>Alex is someone I&#8217;ve known from the OTN SQL &#038; PL/SQL forum for quite some time now, although I&#8217;ve only met him in person a couple of times now. He&#8217;s a massive proponent of analytic functions (as am I &#8211; seriously, they *rock*!) and I couldn&#8217;t miss his analytics talk. Sorry Niall &#8211; I would have loved to have gone to yours too, but this just pipped yours!</p>
<p>This was one of the few that I came out of thinking that maybe I wasn&#8217;t actually so dumb after all! As with everything, there are lots of ways of doing the same thing, and although I&#8217;m fairly comfortable with analytic functions, there are still ways that I approach things that aren&#8217;t the most efficient. Some of Alex&#8217;s examples highlighted that for me!</p>
<p>If you aren&#8217;t familiar or comfortable with analytic functions yet, I would highly recommend you go see one of Alex&#8217;s talks on the subject!</p>
<p><b><u>A Year In Purgatory &#8211; Diary Of An 11.2 Upgrade &#8211; Connor McDonald</u></b></p>
<p>This was a presentation that very nearly wasn&#8217;t given! Debra Lilley had seen it when Connor did it in Perth, and was determined to get him to do it at UKOUG. Given that he&#8217;d already used up both slots for other presentations, this one was going to be saved for next year but, due to someone else having to pull out at the last minute, Debra got her wish!</p>
<p>All I can say about this is poor, poor Connor and his team (I assume there was a team?!). He took us through all the mishaps that occured in the past year or so when upgrading to an 11g Rac environment. As per his normal presentation style there was plenty of humour and entertainment, but I&#8217;m amazed that he&#8217;s got any hair left after the nightmare he described!</p>
<p><b><u>Troubleshooting The Most Complex Oracle Performance Problem I&#8217;ve Ever Seen &#8211; Tanel Poder</u></b></p>
<p>This was an intersting talk in that for most of it, I was scratching my head as to why it was an Oracle problem! It turned out to be a problem that Doug Burns had encountered (sorry, no spoilers here!), and whilst I basically followed things, I think it was more aimed at a DBA than someone like me. Still, it&#8217;s interesting to pick up little tips and tricks on the O/S side of things. And of course, the more I know about the underneath areas of Oracle, the easier it is to talk to my DBAs!</p>
<p><b><u>It&#8217;s All In The Index &#8211; Michael Salt </u></b></p>
<p>Poor Michael only just made his presentation, by the sounds of it &#8211; massive train problems! However, he made it and produced a useful talk on indexes and how they can be used to improve the performance of poorly running SQL statements.</p>
<p>I didn&#8217;t always agree with what Michael said (add an index to aid queries on tables where the data is stored in the wrong datatype? Fix the table/data, not mitigate the symptoms! Meanwhile, back in the real world, I know that&#8217;s not always possible!), but he did throw up an interesting off-the-cuff remark that completely stopped me in my tracks! I&#8217;ll be blogging on this shortly!</p>
<p><b><u>Beating The Oracle Optimizer &#8211; Jonathan Lewis</u></b></p>
<p>This was a tour of how to optimise a two-table query in 7 different ways &#8211; some of which I would never have come up with in a million years! An excellent presentation, as always.</p>
<p>This also happened to be the one that Jonathan asked me to be his alarm clock! I was so worried about missing the 10min / 5min warnings that he&#8217;d requested, I was checking the time every other minute or so throughout his presentation&#8230; only for him to finish 3 minutes before I was due to give him his 10 minute warning! By this time, I was panicking that the time on both my watch and my mobile phone was wrong or something, whereas Jonathan had apparently been thinking that I&#8217;d be waving at him any second for quite a while! Hehehe; I got all worked up for no reason!</p>
<p><b><u>Challenges And Chances Of The 11g Query Optimizer &#8211; Christian Antognini</u></b></p>
<p>This was a bit of a whistlestop tour through the 11g Query Optimizer changes and what we could expect to see once we&#8217;ve upgraded to 11g. Some of these I&#8217;d already seen covered in earlier presentations, such as SQL Plan Management, but others I was completely unaware of! A useful session to go to if, like me, you&#8217;re contemplating upgrading to 11g.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.orchestrapit.co.uk/?feed=rss2&#038;p=118</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>UKOUG2011 &#8211; Day 1 (Monday)</title>
		<link>http://www.orchestrapit.co.uk/?p=115&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ukoug2011-day-1-monday</link>
		<comments>http://www.orchestrapit.co.uk/?p=115#comments</comments>
		<pubDate>Thu, 08 Dec 2011 23:06:57 +0000</pubDate>
		<dc:creator>boneist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[ukoug_2011]]></category>

		<guid isPermaLink="false">http://www.orchestrapit.co.uk/?p=115</guid>
		<description><![CDATA[Opening Keynote &#8211; Mark Sunday Before Mark came on, we had Debra Lilley and Lisa Dobson give a short talk about the changes in structure in the UKOUG organisation, which was interesting &#8211; I wasn&#8217;t aware that there&#8217;d been such &#8230;<p class="read-more"><a href="http://www.orchestrapit.co.uk/?p=115">Continue reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><b><u>Opening Keynote &#8211; Mark Sunday</b></u></p>
<p>Before Mark came on, we had Debra Lilley and Lisa Dobson give a short talk about the changes in structure in the UKOUG organisation, which was interesting &#8211; I wasn&#8217;t aware that there&#8217;d been such big changes.</p>
<p>Mark came on and gave a talk about how fab Oracle was, and &#8230; well, that was my take-home message *{;-) I suspect I may not have been part of the ideal target audience!</p>
<p><b><u>SQL Tuning &#8211; Kyle Hailey</b></u></p>
<p>I&#8217;ve seen a couple of presentations in previous UKOUG conferences that were similar to what Kyle presented here &#8211; one by Jonathan Lewis on diagraming SQL statements and one by Wolfgang Breitling on tuning sql by cardinality. What I particularly liked about this one is that Kyle used a program to do the diagramming &#8211; it can be done by hand, but boy, do I now want that program! I&#8217;ll have to research it and see if I can navigate my work&#8217;s purchasing maze to get it, assuming we don&#8217;t already have it!</p>
<p>I also need to get Dan Tow&#8217;s book, which Kyle had based his talk upon.</p>
<p><b><u>Partitioning 101 &#8211; Connor McDonald</u></b></p>
<p>Yes, another entertaining Connor show! This time, all about partitions. I knew most of the pre-11g stuff, but not too much about the new 11g features (I&#8217;d heard about the new Interval partions, but not the rest). Connor took us through the different types of partitions and gotchas, tips etc. I shall definitely be revisiting partitions when we go to 11g!</p>
<p><b><u>Oracle Optimizer &#8211; Upgrading to Oracle Database 11g Without Pain &#8211; <strike>Maria Colgan</strike> The Optimizer Lady</u></b></p>
<p>Maria took us through the steps required to successfully upgrade to 11g with minimal pain due to the optimizer changes. A lot of this revolved around SQL Plan Baselines, which sound useful, but I&#8217;m not sure I fully &#8220;got&#8221; it, or how it could apply in our 11g migrations. Yet more things I&#8217;ll be adding into the &#8220;Things To Consider&#8221; pile for our migration!</p>
<p>With all the steps Maria was covering, I was beginning to panic about our migration, until right at the very end, someone asked a question of the rest of the audience: &#8220;Has anyone had a bad upgrade to 11g?&#8221; which got a tumbleweed! Someone replied and said it had gone smoothly for them, and another response was that they&#8217;d not heard of a bad upgrade, so that somehwat put my mind at rest!</p>
<p><b><u>Database I/O Performance Measuring and Planning &#8211; Alex Gorbachev</u></b></p>
<p>I suspect this was aimed mostly towards DBAs, but it sounded interesting, so I thought I&#8217;d go along anyway. Some of the technicalities went over my head, but it was useful &#8211; I can at least raise the discussion of I/O capacity planning with my DBAs and at least have some vague understanding of what I&#8217;m talking about! *{:-)</p>
<p><b><u>Performance and Stability with Oracle 11g SQL Plan Management &#8211; Doug Burns</u></b></p>
<p>Doug went into SQL Plan Management a bit more in depth than Maria &#8211; whom he insisted on calling &#8220;The Optimizer Lady&#8221; throughout his talk! &#8211; did, but it wasn&#8217;t too indepth, which was perfect for the time of day (being the last presentation before the final keynote of the (very long and full) day, and also served as excellent consolidation for Maria&#8217;s earlier presentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.orchestrapit.co.uk/?feed=rss2&#038;p=115</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>UKOUG2011 &#8211; Day 0 (Oak Table Sunday)</title>
		<link>http://www.orchestrapit.co.uk/?p=111&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ukoug2011-day-0-oak-table-sunday</link>
		<comments>http://www.orchestrapit.co.uk/?p=111#comments</comments>
		<pubDate>Thu, 08 Dec 2011 21:42:23 +0000</pubDate>
		<dc:creator>boneist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[ukoug_2011]]></category>

		<guid isPermaLink="false">http://www.orchestrapit.co.uk/?p=111</guid>
		<description><![CDATA[First, a note about how I&#8217;m going to write up this year&#8217;s UKOUG Conference. There was a looooot happening this conference, both socially and learning-wise, so I&#8217;m going to break things up &#8211; first, I&#8217;ll write up my thoughts on &#8230;<p class="read-more"><a href="http://www.orchestrapit.co.uk/?p=111">Continue reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>First, a note about how I&#8217;m going to write up this year&#8217;s UKOUG Conference. There was a looooot happening this conference, both socially and learning-wise, so I&#8217;m going to break things up &#8211; first, I&#8217;ll write up my thoughts on the presentations (over several blog entries!) and then I&#8217;ll write up my networking/social/fun thoughts.</p>
<p>So anyway, this year, UKOUG and the Oak Table guys got together and put on an extra day&#8217;s worth of sessions (which were repeated later on in the conference). Despite National Express East Anglia/Network Rail&#8217;s best efforts (Cambridge train station was closed!) I managed to get to Birmingham in time for the start of OakTable Sunday &#8211; mainly due to the fact that my other half very kindly drove me to Milton Keynes so that I could catch the train from there! This had the bonus side effect of me not having to get up early enough to catch the coach from Cambridge station at 5:50am!</p>
<p>Anyway, on with the presentation write-ups:</p>
<p><b><u>Tales From The OakTable &#8211; Mogens Nørgaard</b></u></p>
<p>I&#8217;ve never seen Mogens before, though I&#8217;ve heard plenty about him, and it was somewhat of a shock! He was incredibly laid back, and started off by saying that we were probably not going to learn anything over the conference, or at most, about 5% would stick with us after the conference. </p>
<p>He treated us to a few stories about the OakTable and its members, encouraging stories from Oakies in the audience too. I wasn&#8217;t quite sure what to make of this, really, as it was a very strange talk! Perhaps if I&#8217;d seen Mogens present before, then it wouldn&#8217;t have been a surprise!</p>
<p><b><u>About Multiblock Reads &#8211; Frits Hoogland</b></u></p>
<p>This was about the changes to multiblock reads in 11g, and how you cannot rely on scattered reads anymore &#8211; sometimes it will choose to do direct path reads, which means that you lose the advantages of query results being cached. This could be a good thing or not, but it was something I was unaware of (even though Doug has apparently already blogged about it!). Given that we will hopefully be migrating our 10g databases to 11g next year, I&#8217;m very glad I went to this session!</p>
<p><b><u>Optimizer Statistics &#8211; A Fresh Approach &#8211; Connor McDonald</b></u></p>
<p>Having seen Connor present at the 2009 UKOUG conference, I was determined that I was going to see as many of his presentations as I could. Thankfully, he presents on topics that are relevant to me, but even if he didn&#8217;t, I&#8217;d go along and see him in action! Honestly, if you&#8217;ve never seen him present, if you should ever get the chance to do so, do! He is *a* *maze* *ing!</p>
<p>Connor talked about statisics, both object and database stats, such as how you should gather stats, etc. There were some ideas in there that I&#8217;d never considered before (pending stats), but I&#8217;ll definitely go back to work and think about our stats strategies etc!</p>
<p><b><u>Statistics Gathering and Histograms &#8211; DOs and DON&#8217;Ts &#8211; Wolfgang Breitling</b></u></p>
<p>Following on from Connor&#8217;s presentation was Wolfgang&#8217;s. He went into more detail on histograms and was of the same opinion as Connor &#8211; don&#8217;t use histograms if you don&#8217;t need to; set them explicitly. Another talk I shall consider when looking at our stats gathering!</p>
<p><b><u>Performance and High Availablility Panel Session</b></u></p>
<p>Finally, the OakTable Sunday was topped off by a panel session of various OakTable members who took questions from the audience and wanted to know about the longest prod outage that people were brave enough to own up to! Thankfully, I&#8217;ve never caused a prod outage, but someone had had an overnight outage and someone else had had 18 hours although I don&#8217;t think it was caused by them. Connor won on the monetary outage front &#8211; he managed to hose a 10 million Aussie dollar truck through a bit of dodgy code!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.orchestrapit.co.uk/?feed=rss2&#038;p=111</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Writing “complex” SQL – a how to, pt1b</title>
		<link>http://www.orchestrapit.co.uk/?p=98&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=writing-%25e2%2580%259ccomplex%25e2%2580%259d-sql-%25e2%2580%2593-a-how-to-pt1b</link>
		<comments>http://www.orchestrapit.co.uk/?p=98#comments</comments>
		<pubDate>Wed, 02 Nov 2011 18:23:39 +0000</pubDate>
		<dc:creator>boneist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.orchestrapit.co.uk/?p=98</guid>
		<description><![CDATA[As a corollary to the previous entry in this series, we can take the question further. When I first heard the requirement: I need to display the numbers 1-12 in 3 rows of four columns, like so: 1 2 3 &#8230;<p class="read-more"><a href="http://www.orchestrapit.co.uk/?p=98">Continue reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>As a corollary to <a href="http://www.orchestrapit.co.uk/?p=81">the previous entry in this series</a>, we can take the question further.</p>
<p>When I first heard the requirement:</p>
<p><i>I need to display the numbers 1-12 in 3 rows of four columns, like so:</p>
<p>1 2 3 4<br />
5 6 7 8<br />
9 10 11 12</i></p>
<p>my first reaction was &#8220;really? Just the numbers 1 to 12? You won&#8217;t be given other numbers or values to display in that particular way?&#8221;</p>
<p>The answer to that was &#8220;no&#8221;, so the solution I gave in the last post did the trick.</p>
<p>What if the answer had been &#8220;yes &#8211; I need to display &lt;some other list of twelve bits of info&gt; in that format&#8221;?</p>
<p>Thankfully, we&#8217;ve already done most of the work &#8211; we know how to display twelve things in 3 rows of 4 columns. The trick with the new requirement is identifying which values go in which place.</p>
<p>We&#8217;d do that by artificially labelling the rows with a number from 1 &#8211; 12.</p>
<p>Lets take our sample data as:</p>
<pre class="brush: sql; gutter: true">
with sample_data as (select 12 col1 from dual union all
                     select -1 col1 from dual union all
                     select 3 col1 from dual union all
                     select 13 col1 from dual union all
                     select -20 col1 from dual union all
                     select 31 col1 from dual union all
                     select 0 col1 from dual union all
                     select -9 col1 from dual union all
                     select -2 col1 from dual union all
                     select 18 col1 from dual union all
                     select 7 col1 from dual union all
                     select 4 col1 from dual)
select col1
from   sample_data
order by col1;
</pre>
<p>which gives us:</p>
<pre class="brush: sql; gutter: false">
      COL1
----------
       -20
        -9
        -2
        -1
         0
         3
         4
         7
        12
        13
        18
        31
</pre>
<p>Reaching into our SQL toolbox, we&#8217;ll use the ROW_NUMBER() analytic function to assign a number for each row:</p>
<pre class="brush: sql; gutter: true">
with sample_data as (select 12 col1 from dual union all
                     select -1 col1 from dual union all
                     select 3 col1 from dual union all
                     select 13 col1 from dual union all
                     select -20 col1 from dual union all
                     select 31 col1 from dual union all
                     select 0 col1 from dual union all
                     select -9 col1 from dual union all
                     select -2 col1 from dual union all
                     select 18 col1 from dual union all
                     select 7 col1 from dual union all
                     select 4 col1 from dual)
select col1,
       row_number() over (order by col1) rn
from   sample_data
order by col1;
</pre>
<p>which gives us:</p>
<pre class="brush: sql; gutter: false">
      COL1         RN
---------- ----------
       -20          1
        -9          2
        -2          3
        -1          4
         0          5
         3          6
         4          7
         7          8
        12          9
        13         10
        18         11
        31         12
</pre>
<p>Aha, now we&#8217;re back in familiar territory &#8211; we&#8217;re back to the numbers 1-12 again!</p>
<p>So, amending the solution from the previous post slightly, we can add it in to give us the results we want:</p>
<pre class="brush: sql; gutter: true">
with sample_data as (select 12 col1 from dual union all
                     select -1 col1 from dual union all
                     select 3 col1 from dual union all
                     select 13 col1 from dual union all
                     select -20 col1 from dual union all
                     select 31 col1 from dual union all
                     select 0 col1 from dual union all
                     select -9 col1 from dual union all
                     select -2 col1 from dual union all
                     select 18 col1 from dual union all
                     select 7 col1 from dual union all
                     select 4 col1 from dual),
         results as (select col1,
                            ceil(row_number() over (order by col1)/4) grp,
                            mod(row_number() over (order by col1), 4) col_pos
                     from   sample_data)
select max(case when col_pos = 1 then col1 end) col1,
       max(case when col_pos = 2 then col1 end) col2,
       max(case when col_pos = 3 then col1 end) col3,
       max(case when col_pos = 0 then col1 end) col4
from   results
group by grp
order by grp;
</pre>
<p>giving us:</p>
<pre class="brush: sql; gutter: false">
      COL1       COL2       COL3       COL4
---------- ---------- ---------- ----------
       -20         -9         -2         -1
         0          3          4          7
        12         13         18         31
</pre>
<p>If you had to adjust the format of the columns &#8211; eg. you wanted the resuls in 4 rows of 3 columns, or 6 rows of 2 columns, etc, then you&#8217;d have to amend the number you&#8217;re using in the ceil and mod functions in the &#8220;results&#8221; subquery to reflect the number of columns you&#8217;re expecting.</p>
<p>Then, in the main query, you&#8217;d have to extend or reduce the number of columns accordingly.</p>
<p>I haven&#8217;t restricted the number of rows to 12 in my queries above, because my sample data had at most 12 rows. If your requirement was to only display the first (or last!) 12 values of a larger set of data, you&#8217;d have to restrict the rows accordingly. I&#8217;d simply expose the row_number() as a colum in the &#8220;results&#8221; subquery and call it something like &#8220;rn&#8221;, then I&#8217;d use &#8220;and rn &lt;= 12&#8243; in the main query.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.orchestrapit.co.uk/?feed=rss2&#038;p=98</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>My UKOUG 2011 Conference Agenda</title>
		<link>http://www.orchestrapit.co.uk/?p=86&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-ukoug-2011-conference-agenda</link>
		<comments>http://www.orchestrapit.co.uk/?p=86#comments</comments>
		<pubDate>Wed, 26 Oct 2011 15:24:15 +0000</pubDate>
		<dc:creator>boneist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ukoug_2011]]></category>

		<guid isPermaLink="false">http://www.orchestrapit.co.uk/?p=86</guid>
		<description><![CDATA[Sunday OakTable registration opening times 11:00 &#8211; 12:00 Exhibition registration opening times &#8211; 15:00 &#8211; 18:00 12:15 &#8211; 13:15 OakTable Sunday &#8211; Tales From The OakTable Mr Mogens Nørgaard, ACE Director Miracle AS Hall: 14:35 &#8211; 15:20 OakTable Sunday &#8211; &#8230;<p class="read-more"><a href="http://www.orchestrapit.co.uk/?p=86">Continue reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td colspan="2">
<h2>Sunday</h2>
</td>
</tr>
<tr>
<td colspan="2">
<p align="center"><b>OakTable registration opening times 11:00 &#8211; 12:00</b></p>
<p align="center"><b>Exhibition registration opening times &#8211; 15:00 &#8211; 18:00</b></p>
</td>
</tr>
<tr>
<td valign="top">12:15 &#8211; 13:15</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6943">OakTable Sunday &#8211; Tales From The OakTable</a><br />
		Mr Mogens Nørgaard, ACE Director<br />
		Miracle AS<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">14:35 &#8211; 15:20</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6897">OakTable Sunday &#8211; Join Techniques</a><br />
		Mr Christian Antognini, OakTable<br />
		Trivadis AG<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">15:30 &#8211; 16:15</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6895">OakTable Sunday &#8211; Statistics Gathering and Histograms &#8211; DOs and DON&#39;Ts</a><br />
		Mr Wolfgang Breitling, OakTable<br />
		Centrex Consulting Corporation<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">16:15 &#8211; 16:40</td>
<td valign="top">Tea break</td>
</tr>
<tr>
<td valign="top">16:40 &#8211; 17:30</td>
<td valign="top">Performance &amp; High Availability Panel Session</td>
</tr>
<tr>
<td colspan="2">
<h2>Monday</h2>
</td>
</tr>
<tr>
<td colspan="2">
<p align="center"><b>Registration opening times 08:00 &#8211; 20:00</b> </p>
<p align="center"><b>Exhibition opening times 10:00 &#8211; 20:45</b></p>
</p>
</td>
</tr>
<tr>
<td valign="top">09:00 &#8211; 09:20</td>
<td valign="top">UKOUG Introduction</td>
</tr>
<tr>
<td valign="top">09:20 &#8211; 09:50</td>
<td valign="top">Opening Keynote</p>
<p>		Mark Sunday, Oracle</td>
</tr>
<tr>
<td valign="top">10:00 &#8211; 10:45</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6326">SQL Tuning</a><br />
		Mr Kyle Hailey, ACE<br />
		Delphix<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">10:45 &#8211; 11:05</td>
<td valign="top">Coffee break</td>
</tr>
<tr>
<td valign="top">11:05 &#8211; 12:05</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6071">Partitioning 101</a><br />
		Mr Connor McDonald, ACE &amp; OakTable<br />
		Independent<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">12:15 &#8211; 13:15</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6044">Oracle Optimizer &#8211; Upgrading to Oracle Database 11g without Pain</a><br />
		Ms Maria Colgan<br />
		Oracle<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">13:15 &#8211; 14:30</td>
<td valign="top">Lunch</td>
</tr>
<tr>
<td valign="top">14:30 &#8211; 15:15</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6681">High Availability Options for Modern Oracle Infrastructures</a><br />
		Mr Simon Haslam, ACE Director<br />
		Veriton Limited<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">15:25 &#8211; 16:10</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6515">Implementing Effective Oracle Database Auditing in 3 Steps</a><br />
		Ms Tammy Bednar<br />
		Oracle<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">16:35 &#8211; 17:35</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6822">Database I/O Performance: Measuring and Planning</a><br />
		Mr Alex Gorbachev, ACE &amp; OakTable<br />
		Pythian<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">17:45 &#8211; 18:30</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6367">Performance and Stability with Oracle 11g SQL Plan Management</a><br />
		Mr Doug Burns, ACE Director &amp; OakTable<br />
		Bayvale Consulting Services Ltd<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">18:45 &#8211; 19:45</td>
<td valign="top">Learning about Life through Business and Software</p>
<p>		Cary Millsap, Method R Corporation</td>
</tr>
<tr>
<td colspan="2">
<p align="center"><b>Exhibition Welcome Drinks 19:45 &#8211; 20:45</b></p>
<p align="center"><b>Focus Pubs and Inspiring Presentation Awards 20:45 &#8211; late</b></p>
</p>
</td>
</tr>
<tr>
<td colspan="2">
<h2>Tuesday</h2>
</td>
</tr>
<tr>
<td colspan="2">
<p align="center"><b>Registration opening times 08:00 &#8211; 20:00</b> </p>
<p align="center"><b>Exhibition opening times 08:00 &#8211; 18:30</b></p>
</p>
</td>
</tr>
<tr>
<td valign="top">10:10 &#8211; 10:55</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6098">First Things First: Getting the basics right</a><br />
		Mr Niall Litchfield<br />
		Maxima Managed Services<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">10:10 &#8211; 10:55</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6284">Who’s afraid of Analytic Functions?</a><br />
		Mr Alex Nuijten, ACE Director<br />
		AMIS<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">10:55 &#8211; 11:15</td>
<td valign="top">Coffee break</td>
</tr>
<tr>
<td valign="top">11:15 &#8211; 12:15</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6323">Analysing Your Data with Analytic Functions</a><br />
		Mr Carl Dudley, ACE<br />
		University of Wolverhampton<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">11:15 &#8211; 12:15</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6604">Execution Plan Interpretation</a><br />
		Mr Joze Senegacnik, ACE Director &amp; OakTable<br />
		DbProf d.o.o.<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">12:25 &#8211; 13:25</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6043">Oracle Optimizer – Best Practices for Managing Optimizer Statistics </a><br />
		Ms Maria Colgan<br />
		Oracle<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">12:25 &#8211; 13:25</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6954">Tuning, Refactoring, and Instrumenting Code for Developers </a><br />
		Mr Barry McGillin<br />
		Oracle<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">12:25 &#8211; 13:25</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6969">Troubleshooting the Most Complex Oracle Performance Problem I&#39;ve Ever Seen</a><br />
		Mr Tanel Poder, ACE Director<br />
		Enkitec Europe<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">13:25 &#8211; 14:40</td>
<td valign="top">Lunch</td>
</tr>
<tr>
<td valign="top">14:40 &#8211; 15:25</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6709">ASH Outliers: Detecting Unusual Events in Active Session History</a><br />
		Mr John Beresniewicz, OakTable<br />
		Oracle<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">15:35 &#8211; 16:20</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6450">Can people be identified in the database?</a><br />
		Mr Pete Finnigan, OakTable<br />
		PeteFinnigan.com Ltd<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">16:20 &#8211; 16:40</td>
<td valign="top">Tea break</td>
</tr>
<tr>
<td valign="top">16:40 &#8211; 17:40</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6354">Beating the Oracle Optimizer</a><br />
		Mr Jonathan Lewis, ACE Director &amp; OakTable<br />
		JL Computer Consultancy<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">17:50 &#8211; 18:35</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6700">Challenges and Chances of the 11g Query Optimizer</a><br />
		Mr Christian Antognini, OakTable<br />
		Trivadis AG<br />
		Hall: </td>
</tr>
<tr>
<td colspan="2">
<p align="center"><b>Evening social and networking 20:00 &#8211; late</b></p>
</p>
</td>
</tr>
<tr>
<td colspan="2">
<h2>Wednesday</h2>
</td>
</tr>
<tr>
<td colspan="2">
<p align="center"><b>Registration opening times 08:30 &#8211; 13:30</b></p>
<p align="center"><b>Exhibition opening times 08:30 &#8211; 14:30</b></p>
</p>
</td>
</tr>
<tr>
<td valign="top">09:00 &#8211; 10:00</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6366">Statistics on Partitioned Objects</a><br />
		Mr Doug Burns, ACE Director &amp; OakTable<br />
		Bayvale Consulting Services Ltd<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">10:10 &#8211; 10:55</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6174">Using Oracle GoldenGate to Minimize Database Upgrade Risk</a><br />
		Mr Marc Fielding<br />
		Pythian<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">11:20 &#8211; 12:20</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6533">Latch Internals in 2011</a><br />
		Mr Andrey Nikolaev<br />
		RDTeX<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">12:30 &#8211; 13:30</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6553">Avoiding Execution Plan instability with SQL Plan Baselines</a><br />
		Mr Chris Dunscombe<br />
		Christallize Ltd<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">14:25 &#8211; 15:10</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6388">Faster, Leaner, More Efficient databases &#8211; Index Organised Tables</a><br />
		Mr Martin Widlake, OakTable<br />
		ORA600<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">14:25 &#8211; 15:10</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6728">Six Easy Pieces: Essentials of Database Tuning for Packaged Applications</a><br />
		Mr Mike Swing<br />
		TruTek<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">15:20 &#8211; 16:05</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6748">Is This The Future of Load and Performance Testing?</a><br />
		Mr Chris Jones<br />
		Oracle<br />
		Hall: </td>
</tr>
<tr>
<td valign="top">16:15 &#8211; 17:00</td>
<td valign="top">
		<a href="http://2011.ukoug.org/default.asp?p=8850&amp;dlgact=shwprslist&amp;prs_prsid=6099">What shape is your data? </a><br />
		Mr Niall Litchfield<br />
		Maxima Managed Services<br />
		Hall: </td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.orchestrapit.co.uk/?feed=rss2&#038;p=86</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Writing &#8220;complex&#8221; SQL &#8211; a how to, pt1</title>
		<link>http://www.orchestrapit.co.uk/?p=81&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=writing-complex-sql-a-how-to-pt1</link>
		<comments>http://www.orchestrapit.co.uk/?p=81#comments</comments>
		<pubDate>Tue, 25 Oct 2011 22:23:59 +0000</pubDate>
		<dc:creator>boneist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.orchestrapit.co.uk/?p=81</guid>
		<description><![CDATA[Not so long ago, someone on our work Oracle IM channel asked a question, and then several people were amazed at the solution provided. I&#8217;m not sure why; it doesn&#8217;t seem so difficult to me, but it strikes me that &#8230;<p class="read-more"><a href="http://www.orchestrapit.co.uk/?p=81">Continue reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Not so long ago, someone on our work Oracle IM channel asked a question, and then several people were amazed at the solution provided. I&#8217;m not sure why; it doesn&#8217;t seem so difficult to me, but it strikes me that the practice I&#8217;ve had via the <a href="https://forums.oracle.com/forums/forum.jspa?forumID=75">SQL &#038; PL/SQL OTN Forum</a> probably has a lot to do with that.</p>
<p>So, anyway, I thought I would start a little series on writing complicated sql, by taking you through the steps I would typically take in order to solve the requirement.</p>
<p>I&#8217;ll start with that simple request from my colleague:</p>
<p><i>I need to display the numbers 1-12 in 3 rows of four columns, like so:</p>
<p>1   2   3   4<br />
5   6   7   8<br />
9  10  11  12</i></p>
<p>Looking in my SQL toolbox, the very first thing I reach for is how to create the list of numbers from 1 to 12:</p>
<pre class="brush: sql; gutter: true">
with nums as (select level rn
              from   dual
              connect by level <= 12)
select *
from   nums;
</pre>
<p>which gives us:</p>
<pre class="brush: sql; gutter: false">
   RN
-----
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
</pre>
<p>Next thing, I know I need to pivot the results (I should add that I don't have 11g yet, so can't use the nice new functionality!), so now I know I need two things:</p>
<ul>
<li>how to identify the row a number belongs to</li>
<li>how to identify the column a number belongs to</li>
</ul>
<p>Let's take the first item - identifying the row each number belongs to. We know that the numbers 1-4 will go on the first row, 5-8 on the second and 9-12 on the third. I can acheive that by dividing each number by 4 and then take the ceiling value of it, like so:</p>
<pre class="brush: sql; gutter: true">
with nums as (select level rn, ceil(level/4) grp
              from   dual
              connect by level <= 12)
select *
from   nums;
</pre>
<p>which gives us:</p>
<pre class="brush: sql; gutter: false">
   RN        GRP
----- ----------
    1          1
    2          1
    3          1
    4          1
    5          2
    6          2
    7          2
    8          2
    9          3
   10          3
   11          3
   12          3
</pre>
<p>Next, I need to work out the column position each number belongs in - that's where the mod() function comes in handy!</p>
<pre class="brush: sql; gutter: true">
with nums as (select level rn, ceil(level/4) grp, mod(level, 4) col_pos
              from   dual
              connect by level <= 12)
select *
from   nums;
</pre>
<p>which gives us:</p>
<pre class="brush: sql; gutter: false">
   RN        GRP    COL_POS
----- ---------- ----------
    1          1          1
    2          1          2
    3          1          3
    4          1          0
    5          2          1
    6          2          2
    7          2          3
    8          2          0
    9          3          1
   10          3          2
   11          3          3
   12          3          0
</pre>
<p>So, having identified the row and the column position, we can now use pivoting to display the numbers in the desired format:</p>
<pre class="brush: sql; gutter: true">
with nums as (select level rn, ceil(level/4) grp, mod(level, 4) col_pos
              from   dual
              connect by level <= 12)
select max(case when col_pos = 1 then rn end) col1,
       max(case when col_pos = 2 then rn end) col2,
       max(case when col_pos = 3 then rn end) col3,
       max(case when col_pos = 0 then rn end) col4
from   nums
group by grp;
</pre>
<p>Giving us:</p>
<pre class="brush: sql; gutter: false">
 COL1       COL2       COL3       COL4
----- ---------- ---------- ----------
    1          2          3          4
    5          6          7          8
    9         10         11         12
</pre>
<p>Et voilà!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.orchestrapit.co.uk/?feed=rss2&#038;p=81</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>My CLOBs are trunca</title>
		<link>http://www.orchestrapit.co.uk/?p=57&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-clobs-are-trunca</link>
		<comments>http://www.orchestrapit.co.uk/?p=57#comments</comments>
		<pubDate>Thu, 28 Apr 2011 15:31:00 +0000</pubDate>
		<dc:creator>boneist</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[oracle bug]]></category>

		<guid isPermaLink="false">http://www.orchestrapit.co.uk/?p=57</guid>
		<description><![CDATA[As the title of this blog entry indicates, I encountered a problem yesterday with my CLOBs somehow ending up being truncated. I scratched my head, poured over the documentation and still came up blank. I felt sure the problem was &#8230;<p class="read-more"><a href="http://www.orchestrapit.co.uk/?p=57">Continue reading &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>As the title of this blog entry indicates, I encountered a problem yesterday with my CLOBs somehow ending up being truncated. I scratched my head, poured over the documentation and still came up blank.</p>
<p>I felt sure the problem was something to do with the multibyte character set my database (10.2.0.4) was set up with, but everything in the documentation indicated that DBMS_LOB subprograms worked in terms of characters, not bytes, when CLOBs were involved.</p>
<p>I managed to recreate my issue:</p>
<pre class="brush: sql">declare
    l_finalSQL VARCHAR2(32767 char);
    l_innerSQL CLOB := 'a';
    l_outerSQL CLOB := 'b';
    l_userid   INT;
    gOutersql varchar2(113) := 'ccccccccccccccccccccccccccccccccccccccccc'||
                               'ccccccccccccccccccccccccccccccccccccccc'||
                               'ccccccccccccccccccccccccccccccccc';
begin
  for i in 1..1342
  loop
    l_outersql := l_outersql||'b';
  end loop;

  dbms_output.put_line('l_outersql = '||length(l_outersql));

  for i in 1..10860
  loop
    l_innersql := l_innersql||'a';
  end loop;

  dbms_output.put_line('l_innersql = '||length(l_innersql));

  l_userid := 123;

  dbms_output.put_line('l_userid = '||length(l_userid));

  l_outerSQL := l_outerSQL||' FROM ('||l_innerSQL||gOUTERSQL||
                                      TO_CHAR(l_userid);

  dbms_output.put_line('appended l_outersql = '||
                                dbms_lob.getlength(l_outersql));

  IF dbms_lob.getlength(l_outerSQL) &lt;= 32767 THEN
    l_finalSQL := dbms_lob.substr(l_outerSQL, 32767, 1);
  else raise too_many_rows;
  end if;

  dbms_output.put_line('l_finalsql = '||length(l_finalsql));
end;
/
</pre>
<p>which produced the following output:</p>
<pre class="brush: sql; gutter: false">
l_outersql = 1343
l_innersql = 10861
l_userid = 3
appended l_outersql = 12327
l_finalsql = 10922</pre>
<p>Note the 12327 vs 10922 &#8211; the expected and actual lengths of the l_finalSQL string.</p>
<p>I could not spot what the problem was for the life of me, so I asked for help on my work&#8217;s Oracle chat channel (don&#8217;t think I didn&#8217;t have a chuckle about that given my previous blog entry!). Thankfully, someone else had the presence of mind to check My Oracle Support, and it turned out that I have most likely tripped over bug 9020537. This isn&#8217;t fixed until 12.1 (!) or 11.2.0.2 (Server Patch Set) or 10.2.0.5.3 (Patch Set Update).</p>
<p>Unfortunately, upgrading to any of these versions is not an option for us in the timescale I needed my code to be working, and there is no workaround (boo!) so I&#8217;ve had to rewrite my code to work around the issue. Annoying! (Even more so when what I&#8217;m doing is to work around the fact that EXECUTE IMMEDIATE doesn&#8217;t handle CLOBs until 11g&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.orchestrapit.co.uk/?feed=rss2&#038;p=57</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

