<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>ThoughtHook</title>
	
	<link>http://blog.thoughthook.com</link>
	<description>A place to hang my brain</description>
	<pubDate>Tue, 16 Jun 2009 13:27:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/thoughthook" /><feedburner:info uri="thoughthook" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Opera Unite - Reinventing the web?  We’ll see.</title>
		<link>http://feedproxy.google.com/~r/thoughthook/~3/qbg14OkmQlY/</link>
		<comments>http://blog.thoughthook.com/?p=23#comments</comments>
		<pubDate>Tue, 16 Jun 2009 13:19:33 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[opera cloudcomputing webservice]]></category>

		<guid isPermaLink="false">http://blog.thoughthook.com/?p=23</guid>
		<description><![CDATA[Opera, a Norwegian software company, known for the Opera web browser, has promised to re-invent the web with their new Unite service.  It certainly looks promising, allowing users to share files, play music/movies, etc. on their computers from a web brower anywhere on the internet.  I&#8217;m going to look into it, but the [...]]]></description>
			<content:encoded><![CDATA[<p>Opera, a Norwegian software company, known for the Opera web browser, has promised to re-invent the web with their new Unite service.  It certainly looks promising, allowing users to share files, play music/movies, etc. on their computers from a web brower anywhere on the internet.  I&#8217;m going to look into it, but the technology does look promising.  Check it out for yourself: 
<a  href="http://unite.opera.com" onclick="javascript:pageTracker._trackPageview('/external/unite.opera.com');" >http://unite.opera.com/</a></p>
<img src="http://feeds.feedburner.com/~r/thoughthook/~4/qbg14OkmQlY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thoughthook.com/?feed=rss2&amp;p=23</wfw:commentRss>
		<feedburner:origLink>http://blog.thoughthook.com/?p=23</feedburner:origLink></item>
		<item>
		<title>Back again…</title>
		<link>http://feedproxy.google.com/~r/thoughthook/~3/Y5zwBIEegu4/</link>
		<comments>http://blog.thoughthook.com/?p=22#comments</comments>
		<pubDate>Wed, 03 Jun 2009 09:03:24 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[admin]]></category>

		<guid isPermaLink="false">http://blog.thoughthook.com/?p=22</guid>
		<description><![CDATA[I apologize for the downtime - One of my plugins decided to stop playing nicely so I had to shuffle some things around.  Code coloration is disabled for the time being.
]]></description>
			<content:encoded><![CDATA[<p>I apologize for the downtime - One of my plugins decided to stop playing nicely so I had to shuffle some things around.  Code coloration is disabled for the time being.</p>
<img src="http://feeds.feedburner.com/~r/thoughthook/~4/Y5zwBIEegu4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thoughthook.com/?feed=rss2&amp;p=22</wfw:commentRss>
		<feedburner:origLink>http://blog.thoughthook.com/?p=22</feedburner:origLink></item>
		<item>
		<title>The Ruby Toolbox: Look up gems by category and popularity</title>
		<link>http://feedproxy.google.com/~r/thoughthook/~3/vip_wpoAxes/</link>
		<comments>http://blog.thoughthook.com/?p=19#comments</comments>
		<pubDate>Tue, 19 May 2009 13:10:52 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.thoughthook.com/?p=19</guid>
		<description><![CDATA[I heard about The Ruby Toolbox today: http://ruby-toolbox.com/

Here is a brief description, taken from their site:

The Ruby Toolbox gives you an overview of these tools, sorted in categories and rated by the amount of watchers and forks in the corresponding source code repository on GitHub so you can find out easily what options you have and which are the most common ones in the Ruby community.]]></description>
			<content:encoded><![CDATA[<p>I heard about The Ruby Toolbox today: 
<a  href="http://ruby-toolbox.com/" onclick="javascript:pageTracker._trackPageview('/external/ruby-toolbox.com/');" >http://ruby-toolbox.com/</a></p>
<p>Here is a brief description, taken from their site:</p>
<blockquote><p>The Ruby Toolbox gives you an overview of these tools, sorted in categories and rated by the amount of watchers and forks in the corresponding source code repository on GitHub so you can find out easily what options you have and which are the most common ones in the Ruby community.</p></blockquote>
<p>They basically list Ruby libraries by category and &#8216;popularity&#8217; (defined above.)  I think it&#8217;s really interesting how influential GitHub has been to Ruby development, and in my opinion it is only natural that sites like The Ruby Toolbox are created.  I like the site because it lets me quickly choose candidates for evaluation when I am looking for a library to help with a particular task.</p>
<img src="http://feeds.feedburner.com/~r/thoughthook/~4/vip_wpoAxes" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thoughthook.com/?feed=rss2&amp;p=19</wfw:commentRss>
		<feedburner:origLink>http://blog.thoughthook.com/?p=19</feedburner:origLink></item>
		<item>
		<title>Adding additional controlfiles (multiplexing) in Oracle using ASM</title>
		<link>http://feedproxy.google.com/~r/thoughthook/~3/1I6emcxt58s/</link>
		<comments>http://blog.thoughthook.com/?p=13#comments</comments>
		<pubDate>Tue, 12 May 2009 06:07:27 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[DBA]]></category>

		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://blog.thoughthook.com/?p=13</guid>
		<description><![CDATA[When creating a database using ASM, the Oracle database creation assistant, ordbca, has an annoying tendency to only create one controlfile by default.  This is unequivocally a bad idea for any database that contains meaningful data, therefore it is necessary to add additional controlfiles.  Before ASM, you could shutdown the db, copy the controlfile on the OS level and modify [...]]]></description>
			<content:encoded><![CDATA[<p>When creating a database using ASM, the Oracle database creation assistant, ordbca, has an annoying tendency to only create one controlfile by default.  This is unequivocally a bad idea for any database that contains meaningful data, therefore it is necessary to add additional controlfiles.  Before ASM, you could shutdown the db, copy the controlfile on the OS level and modify the control_files parameter to add additional controlfiles.  If you use ASM, the operation is not that simple anymore, you need to use RMAN to perform the copy.  Here&#8217;s how I did it on my RAC database (10.2.0.3.0) on ASM (Note: check your ASM locations - this is only an example) :<span id="more-13"></span></p>
<p>Stop the database and make sure that no instance has mounted the controlfile:</p>
<pre>
srvctl stop database -d db1
</pre>
<p>Now, log onto the database, start it in nomount mode and set the control_files parameter:              </p>
<pre>
sqlplus / as sysdba              
startup nomount             
alter system set control_files = +DATA/db1/controlfile/current_controlfile_1.ctl','+DATA/db1/controlfile/current_controlfile_2.ctl'
</pre>
<pre>
scope = spfile sid = '*';
exit;
</pre>
<p>Next, log into RMAN and copy the controlfiles to the new destination:              </p>
<pre>
rman target=/              
restore controlfile to '+DATA/db1/controlfile/current_controlfile_1.ctl'
from '+DATA/db1/controlfile/Current.controlfile.260.3462344';                          
restore controlfile to '+DATA/db1/controlfile/current_controlfile_2.ctl' from
'+DATA/db1/controlfile/Current.controlfile.260.3462344';              
exit; 
</pre>
<p>Finally,  shutdown and startup the database:              </p>
<pre>
sqlplus / as sysdba              
shutdown immediate              
exit;              
srvctl start database -d db1
</pre>
<p>The database should start up using your new controlfiles.  You can use ASMCMD to delete the old controlfile once everything is verified to be working with the new controlfiles.</p>
<img src="http://feeds.feedburner.com/~r/thoughthook/~4/1I6emcxt58s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thoughthook.com/?feed=rss2&amp;p=13</wfw:commentRss>
		<feedburner:origLink>http://blog.thoughthook.com/?p=13</feedburner:origLink></item>
		<item>
		<title>UPDATE! - Ruby ActiveRecord and Oracle: Auto Incrementing Primary Keys using Triggers</title>
		<link>http://feedproxy.google.com/~r/thoughthook/~3/rsixfe_LgvE/</link>
		<comments>http://blog.thoughthook.com/?p=11#comments</comments>
		<pubDate>Fri, 11 Jul 2008 18:55:32 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Active Record]]></category>

		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.thoughthook.com/?p=11</guid>
		<description><![CDATA[Well, it looks like this has been fixed in the latest versions of the Oracle enhanced adapter for ActiveRecord.  It looks like there was a reorganization of the different components of the ActiveRecord/Adapter relationship that had originally led to this problem, according to the documentation submitted with the fix.  Thanks to whomever was [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it looks like this has been fixed in the latest versions of the Oracle enhanced adapter for ActiveRecord.  It looks like there was a reorganization of the different components of the ActiveRecord/Adapter relationship that had originally led to this problem, according to the documentation submitted with the fix.  Thanks to whomever was able to provide the patch; You just made my life a little bit easier.</p>
<img src="http://feeds.feedburner.com/~r/thoughthook/~4/rsixfe_LgvE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thoughthook.com/?feed=rss2&amp;p=11</wfw:commentRss>
		<feedburner:origLink>http://blog.thoughthook.com/?p=11</feedburner:origLink></item>
		<item>
		<title>Martin Fowler’s article “Using the Rake Build Language”</title>
		<link>http://feedproxy.google.com/~r/thoughthook/~3/DN86nbTz2oQ/</link>
		<comments>http://blog.thoughthook.com/?p=9#comments</comments>
		<pubDate>Thu, 27 Mar 2008 16:24:37 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Rake]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[build]]></category>

		<guid isPermaLink="false">http://blog.thoughthook.com/?p=9</guid>
		<description><![CDATA[I just got through reading Martin Fowler&#8217;s excellent article on using the Rake build Language.  It is a very easy to understand and fairly complete initiation into basic and intermediate build/automation techniques using Rake.  It is old (Aug 10th 05) but, in my opinion, still quite relevant.
You can find the article 
here, and [...]]]></description>
			<content:encoded><![CDATA[<p>I just got through reading Martin Fowler&#8217;s excellent article on using the Rake build Language.  It is a very easy to understand and fairly complete initiation into basic and intermediate build/automation techniques using Rake.  It is old (Aug 10th 05) but, in my opinion, still quite relevant.</p>
<p>You can find the article 
<a  href="http://www.martinfowler.com/articles/rake.html" title="Using the Rake Build Language" onclick="javascript:pageTracker._trackPageview('/external/www.martinfowler.com/articles/rake.html');" >here</a>, and his main site (excellent!) is here: 
<a  href="http://www.martinfowler.com" onclick="javascript:pageTracker._trackPageview('/external/www.martinfowler.com');" >http://www.martinfowler.com</a></p>
<p>I stumbled across the article while exploring deployment/system administration options utilizing Ruby.  Because I am using RAC for my database instances, I have multiple servers that I need to consistently update with scripts, configuration, data, etc.  I have been looking into Capistrano for this task (even though it is an Oracle system) and it looks promising, if a bit kludgy to implement without SCM in place and accessible from the server.</p>
<p>Once I have the deployment solution figured out, I&#8217;ll write it up.</p>
<img src="http://feeds.feedburner.com/~r/thoughthook/~4/DN86nbTz2oQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thoughthook.com/?feed=rss2&amp;p=9</wfw:commentRss>
		<feedburner:origLink>http://blog.thoughthook.com/?p=9</feedburner:origLink></item>
		<item>
		<title>Ruby ActiveRecord and Oracle: Auto Incrementing Primary Keys using Triggers</title>
		<link>http://feedproxy.google.com/~r/thoughthook/~3/TDMqLXBbsUE/</link>
		<comments>http://blog.thoughthook.com/?p=7#comments</comments>
		<pubDate>Wed, 30 Jan 2008 18:06:56 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.thoughthook.com/?p=7</guid>
		<description><![CDATA[One of the most obvious limitations that I have faced when using ActiveRecord is it&#8217;s ability to adapt to legacy systems, especially Oracle databases.  Many of the Oracle databases that I have used employ triggers to populate numeric primary key columns when data is inserted into the database tables.  While this is a [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most obvious limitations that I have faced when using ActiveRecord is it&#8217;s ability to adapt to legacy systems, especially Oracle databases.  Many of the Oracle databases that I have used employ triggers to populate numeric primary key columns when data is inserted into the database tables.  While this is a very nice and easy way to hide the mechanisms used to identify the data from the application developers when they are using straight DML, when you try to use ActiveRecord on these tables, ESPECIALLY when dealing with large object (LOB) fields, you get into some real hair-pulling situations.</p>
<p>ActiveRecord handles LOB inserts in two steps:</p>
<ol>
<li>The data is inserted into the database and the LOB field is initialized with an empty lob.</li>
<li>The record is updated with the provided LOB data, replacing the empty lob.</li>
</ol>
<p>As part of step 1 above, ActiveRecord pre-fetches the sequence that is used to populate the primary key field of the table.  If you then have a trigger on that table that updates the incoming primary key column with the next sequence value, your Ruby object and the data inserted into the database are out of sync.  Therefore, in step<br />
2 of the LOB insert process described above, ActiveRecord is attempting to update a row with a primary key value that does not exist and no LOB values are ever populated.</p>
<p>To prevent this, I created the following code that alters ActiveRecord::Base and ActiveRecord::ConnectionAdapters::OracleAdapter to use the trigger-generated key (via the Oracle &#8216;RETURNING&#8217; clause) in the AR object.<br />
[ruby]</p>
<p>module ActiveRecord<br />
module ConnectionAdapters #:nodoc:<br />
class OracleAdapter &lt; AbstractAdapter<br />
def insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) #:nodoc:<br />
cursor = @connection.parse(sql)<br />
log(sql, name) { cursor.exec(0) }<br />
# return the  primary key value for the record just inserted<br />
cursor[1]<br />
end<br />
end<br />
end</p>
<p>class Base<br />
# Creates a record with values matching those of the instance attributes and<br />
# returns its id.<br />
def create<br />
if self.id.nil? &amp;&amp; connection.prefetch_primary_key?(self.class.table_name)<br />
self.id = connection.next_sequence_value(self.class.sequence_name)<br />
end</p>
<p>quoted_attributes = attributes_with_quotes</p>
<p>statement = if quoted_attributes.empty?<br />
connection.empty_insert_statement(self.class.table_name)<br />
else<br />
&#8220;INSERT INTO #{self.class.quoted_table_name} &#8221; +<br />
&#8220;(#{quoted_column_names.join(&#8217;, &#8216;)}) &#8221; +<br />
&#8220;VALUES(#{quoted_attributes.values.join(&#8217;, &#8216;)}) returning #{self.class.primary_key} into :1&#8243;<br />
end</p>
<p>self.id = connection.insert(statement, &#8220;#{self.class.name} Create&#8221;,<br />
self.class.primary_key, self.id, self.class.sequence_name)</p>
<p>@new_record = false<br />
id<br />
end<br />
end<br />
end<br />
[/ruby]</p>
<p>Now, this is really, really rough.  I am using the 2.x version of ActiveRecord, and any updates to these sections in future releases will break my changes.  It does, however, work for me right now.  As I have time I will refactor this and increase its maintainablility.</p>
<p>Comments?</p>
<img src="http://feeds.feedburner.com/~r/thoughthook/~4/TDMqLXBbsUE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thoughthook.com/?feed=rss2&amp;p=7</wfw:commentRss>
		<feedburner:origLink>http://blog.thoughthook.com/?p=7</feedburner:origLink></item>
		<item>
		<title>Open!</title>
		<link>http://feedproxy.google.com/~r/thoughthook/~3/TmFYdRbaZrk/</link>
		<comments>http://blog.thoughthook.com/?p=4#comments</comments>
		<pubDate>Thu, 16 Aug 2007 06:06:25 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.thoughthook.com/?p=4</guid>
		<description><![CDATA[Greetings, and welcome to ThoughtHook!  This is the obligatory here-I am post - But you deserve more than just an announcement, don&#8217;t you?
What is this place about?
ThoughtHook is a place where I can share my thoughts and ideas about surviving and thriving in the jungle that is software development. I relish programming in Ruby, [...]]]></description>
			<content:encoded><![CDATA[<p>Greetings, and welcome to ThoughtHook!  This is the obligatory here-I am post - But you deserve more than just an announcement, don&#8217;t you?</p>
<p><strong>What is this place about?</strong></p>
<p>ThoughtHook is a place where I can share my thoughts and ideas about surviving and thriving in the jungle that is software development. I relish programming in Ruby, so much of what I post about will be ruby-related (<em>not</em> necessarily Rails-related.)  You will also see posts about Programming Languages, Oracle, PL/SQL, general coding, etc.; Whatever interests me and/or is relevant to my current work.</p>
<p>So now you have a better idea of what I am trying to do here. Hopefully, we can all learn from each other.</p>
<img src="http://feeds.feedburner.com/~r/thoughthook/~4/TmFYdRbaZrk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thoughthook.com/?feed=rss2&amp;p=4</wfw:commentRss>
		<feedburner:origLink>http://blog.thoughthook.com/?p=4</feedburner:origLink></item>
	</channel>
</rss>
