<?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>UseStrict Consulting &#187; shell</title>
	<atom:link href="http://usestrict.net/tag/shell/feed/" rel="self" type="application/rss+xml" />
	<link>http://usestrict.net</link>
	<description>Professional IT Solutions &#38; Training</description>
	<lastBuildDate>Sat, 12 May 2012 14:25:42 +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>Perl: Installing DBD::Oracle + Oracle Instant Client on Ubuntu 9.04</title>
		<link>http://usestrict.net/2009/07/perl-installing-dbdoracle-on-ubuntu-904-and-oracle-instant-client/</link>
		<comments>http://usestrict.net/2009/07/perl-installing-dbdoracle-on-ubuntu-904-and-oracle-instant-client/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 16:17:20 +0000</pubDate>
		<dc:creator>vinny</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Accept]]></category>
		<category><![CDATA[article material]]></category>
		<category><![CDATA[course]]></category>
		<category><![CDATA[CPAN]]></category>
		<category><![CDATA[dbd]]></category>
		<category><![CDATA[dbd::oracle]]></category>
		<category><![CDATA[dbi]]></category>
		<category><![CDATA[distro]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[dpkg]]></category>
		<category><![CDATA[everything]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[gazillion times]]></category>
		<category><![CDATA[home directory]]></category>
		<category><![CDATA[Install]]></category>
		<category><![CDATA[Instant]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[LIBRARY]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[nbsp]]></category>
		<category><![CDATA[oracle db]]></category>
		<category><![CDATA[oracle distribution]]></category>
		<category><![CDATA[Oracle Instant Client]]></category>
		<category><![CDATA[perl 5]]></category>
		<category><![CDATA[perl mcpan]]></category>
		<category><![CDATA[pre requisites]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[root password]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[Set]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[surprise]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[using oracle]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://usestrict.net/?p=789</guid>
		<description><![CDATA[Easy to follow steps on how to install DBD::Oracle using Oracle Instant Client on Ubuntu 9.04]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks ago I finally got a new laptop at work &#8211; which meant of course that I had to reinstall everything. Although we use Windows XP, there&#8217;s one app that I have to run through Linux. The solution was <a href="http://www.virtualbox.org/" target="_blank">Sun&#8217;s VirtualBox</a> running <a href="http://www.ubuntu.com/" target="_blank">Ubuntu 9.04</a>. When I tried to run the app, I realized that I still needed to install DBI and DBD::Oracle &#8211; which brings me to this article. Nothing better than a reinstall to generate article material <img src='http://usestrict.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>DBD::Oracle is usually a pain to install if you haven&#8217;t already done it a gazillion times. After that, it&#8217;s just an annoying itch. In this article I&#8217;ll cover installing DBD::Oracle using Oracle Instant Client, Ubuntu 9.04, and Perl 5.10. Since we&#8217;re using the Instant Client, you&#8217;ll need some Oracle DB you can connect to in order to do the testing. You can choose to skip testing altogether, but you might be into a surprise later.<span id="more-789"></span></p>
<p>&nbsp;</p>
<h2>DBI and DBD::Oracle</h2>
<p>Installing the <strong>DBI</strong> is always easy &#8211; regardless if you&#8217;re running Windows or Linux. Just follow the steps.</p>
<ol>
<li>Get root password if you don&#8217;t already have one: <code><strong><em>sudo passwd root</em></strong></code></li>
<li>Switch to root: <code><strong><em>su -</em></strong></code></li>
<li>Run CPAN: <code><em>perl -MCPAN -e shell</em></code></li>
<li>Check if DBI is already installed: <code><strong><em>m DBI</em></strong></code></li>
<li>If it&#8217;s not installed, install it: <code><strong><em>install DBI</em></strong></code></li>
</ol>
<p>That should do the trick for the DBI. The DBD::Oracle is a bit more complicated and we&#8217;ll just use CPAN to download it for us. The rest is manual.</p>
<ol>
<li>Check for DBD::Oracle: <code><strong><em>m DBD::Oracle</em></strong></code></li>
<li>Download it: <code><strong><em>get DBD::Oracle</em></strong></code></li>
<li>Exit CPAN: <code><strong><em>q</em></strong></code></li>
</ol>
<p>Now we should have the DBD::Oracle distribution downloaded to our CPAN build directory. If you don&#8217;t know where to find it, look for <code>.cpan</code> dir under your root home or (if you started CPAN for the first time doing <code>sudo</code> from your main user, look for it under your main user&#8217;s home directory). We&#8217;ll leave that distro aside for a moment and work on the other pre-requisites.</p>
<p>&nbsp;</p>
<h2>Oracle Instant Client</h2>
<p>Download the instant client packages you&#8217;ll need. I chose to download the RPMs and convert them to .deb files using <code>alien</code>. Oracle also provides .zip files if you don&#8217;t want to do it the <code>alien</code> way.</p>
<p><a href="http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html" target="_blank">Oracle Instant Client Download Site i386</a><br />
<a href="http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linux-amd64.html" target="_blank">Oracle Instant Client Download Site AMD64 32- and 64-bit</a></p>
<p>Accept the license agreement by clicking the Accept radio button. Since the i386 and amd64 files have different names, check the bold words in the file names to know which ones to download (the names below are for the i386 platform). Also, if you don&#8217;t have a user_id for Oracle, you&#8217;ll be prompted to register one once you click the link. It&#8217;s free of charge.</p>
<ul>
<li>oracle-instantclient11.1-<strong>basic</strong>-xx.x.x.x.x-x.i386.rpm</li>
<li>oracle-instantclient11.1-<strong>sqlplus</strong>-xx.x.x.x.x-x.i386.rpm</li>
<li>oracle-instantclient11.1-<strong>devel</strong>-xx.x.x.x.x-x.i386.rpm</li>
</ul>
<p>AMD64 has only zip files from what I could find, and they&#8217;re named a bit differently, too (remove the <span style="color: red;">32</span> for the 64-bit version:</p>
<ul>
<li>instantclient-<strong>basic</strong>-linuxAMD64-<span style="color: red;">32</span>-xx.x.x.x.x-yyyymmdd.zip</li>
<li>instantclient-<strong>sqlplus</strong>-linuxAMD64-<span style="color: red;">32</span>-xx.x.x.x.x-yyyymmdd.zip</li>
<li>instantclient-<strong>sdk</strong>-linuxAMD64-<span style="color: red;">32</span>-xx.x.x.x.x-yyyymmdd.zip</li>
</ul>
<p><em>Note: Extract the zips into a directory called instantclient and skip to the <strong>Set Up your Environment Variables</strong> section if you&#8217;re using the AMD64 or i386 zip files.</em></p>
<h2>Install alien and libaio</h2>
<p>Now is the time to install <code>alien</code>, which is an application that converts rpm files into .deb format to be used with <code>dpkg</code>. Instant Client also requires <code>libaio</code>. Both can be installed through the Synaptic Package Manager. Just open it, look for <code>alien</code>, mark it for install and do the same for <code>libaio</code> and <code>libaio-dev</code>. Once they&#8217;re installed, you&#8217;re good to move on to install the Instant Client. Just don&#8217;t forget to exit Synaptic Package Manager, since we&#8217;ll be using <code>dpkg</code> and it won&#8217;t work if Synaptic is open.</p>
<p>&nbsp;</p>
<h2>Install Oracle Instant Client</h2>
<p>First step to install Oracle Instant Client from rpm files is to convert them into .deb files. Do that with <code>alien</code> by running the following command (from a command line in the directory where you downloaded your RPMs):</p>
<p><code>$ sudo alien --scripts *.rpm</code></p>
<p>It takes a little while to run, so be patient. Once it&#8217;s complete, install the newly created .deb files:</p>
<p><code>$ dpkg -i *.deb</code></p>
<p>&nbsp;</p>
<h2>Set up your Environment Variables</h2>
<p>The nasty thing about rpm files is that it&#8217;s not always easy to know where the files were installed. If you opted for the zip file approach, your install will most definitely be different. For RPM install, add this to your <code>.bashrc</code> file (swap xx.x for your oracle version):</p>
<p><code><br />
export ORACLE_HOME=/usr/lib/oracle/xx.x/client<br />
export PATH=$PATH:$ORACLE_HOME/bin<br />
export LD_LIBRARY_PATH=$ORACLE_HOME/lib<br />
</code></p>
<p><strong>Update:</strong> If you get an ELFCLASS64 error, try setting LD_LIBRARY_PATH to $ORACLE_HOME/lib32 instead.</p>
<p>Reload your <code>.bashrc</code> file:<br />
<code>$. ~/.bashrc</code></p>
<p>Note: by default, Oracle Instant Client doesn&#8217;t come with a <code>tnsnames.ora</code> file or the directory structure where it&#8217;s usually found. We&#8217;ll have to create that ourselves -</p>
<p><code>$ mkdir -p $ORACLE_HOME/network/admin; touch $ORACLE_HOME/network/admin/tnsnames.ora</code></p>
<p>&nbsp;</p>
<h2>Install DBD::Oracle</h2>
<p>It&#8217;s time to finally install DBD::Oracle. Go to your CPAN build directory and <code>cd</code> into <code>DBD-Oracle-*</code>. As a user having the environment variable set from the previous section, run Makefile.PL portion.</p>
<p><code>$ perl Makefile.PL</code></p>
<p>There&#8217;s no need to set INC or LIB with the <code>alien</code> approach, but if you run into any issues, try giving Makefile.PL the path to your include dir for INC, and lib dir for LIB.</p>
<p>Next, run</p>
<p><code>$ make</code>.</p>
<p>It will raise a few warnings, but unless it exits with an error, you should be OK.</p>
<p>The next logical step is to run make test. However, this will undoubtedly fail unless you have a valid entry in your tnsnames.ora file. If you don&#8217;t, you can skip this test and hope that everything works later on. Otherwise, update your <strong>tnsnames.ora</strong> file with a valid entry, and set one more environment variable before running the test:</p>
<p><code>$ export ORACLE_USERID="user/passwd@tns_entry_name"</code><br />
<code>$ make test</code></p>
<p>This is usually the hardest part to pass with total success. Many things can go wrong. In my case, the valid entry I use doesn&#8217;t have full grants to the user I log in as. This always triggers an error on the create/access sequences portion of the testing. I simply ignore it nowadays &#8211; make sure you analyze your test results thoroughly before choosing to ignore the errors as well.</p>
<p>Now that the testing is over, simply run<br />
<code>$ make install</code><br />
as a super user and you&#8217;re all set!</p>
<p>&nbsp;</p>
<h3>Book suggestions:</h3>
<div style="text-align: center;"><script type="text/javascript">// <![CDATA[
    (function(){
        document.write('<script type="text/javascript" src="http://cb1.cronblocks.com//js/content.js?c=11&#038;t='+(Math.floor(new Date().getTime()/1000))+'&#038;s=client"><\/script>');
    })();
// ]]&gt;</script></div>
]]></content:encoded>
			<wfw:commentRss>http://usestrict.net/2009/07/perl-installing-dbdoracle-on-ubuntu-904-and-oracle-instant-client/feed/</wfw:commentRss>
		<slash:comments>67</slash:comments>
		</item>
		<item>
		<title>Perl Crash Course: Introduction to Perl</title>
		<link>http://usestrict.net/2008/10/perl-crash-course-introduction-to-perl/</link>
		<comments>http://usestrict.net/2008/10/perl-crash-course-introduction-to-perl/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 20:16:04 +0000</pubDate>
		<dc:creator>vinny</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[CGI]]></category>
		<category><![CDATA[cgis]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[combination]]></category>
		<category><![CDATA[common gateway interface]]></category>
		<category><![CDATA[course introduction]]></category>
		<category><![CDATA[Crash]]></category>
		<category><![CDATA[crash course]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[dynamic data]]></category>
		<category><![CDATA[early days of the internet]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[Extraction]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[html javascript]]></category>
		<category><![CDATA[Interface]]></category>
		<category><![CDATA[interpreter]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript css]]></category>
		<category><![CDATA[mod]]></category>
		<category><![CDATA[perl archive]]></category>
		<category><![CDATA[Perl Course Howto]]></category>
		<category><![CDATA[perl execution]]></category>
		<category><![CDATA[perl interpreter]]></category>
		<category><![CDATA[perl scripts]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[report language]]></category>
		<category><![CDATA[Rubbish]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[script perl]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[shell scripts]]></category>
		<category><![CDATA[soun]]></category>
		<category><![CDATA[template toolkit]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[text manipulation]]></category>
		<category><![CDATA[unix tools]]></category>
		<category><![CDATA[VERY]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[web modules]]></category>

		<guid isPermaLink="false">http://usestrict.wordpress.com/?p=74</guid>
		<description><![CDATA[Perl &#8211; the Practical Extraction and Report Language (or Pathologically Eclectict Rubbish Lister) was created by Larry Wall in the late 1980&#8242;s. It started as a combination of Larry&#8217;s favorite Unix tools such as sed, awk, and shell, and grew to be the best language for text manipulation. I started learning Perl back in 1998 [...]]]></description>
			<content:encoded><![CDATA[<p>Perl &#8211; the Practical Extraction and Report Language (or Pathologically Eclectict Rubbish Lister) was created by <a href="http://www.wall.org/~larry/" target="_blank">Larry Wall </a>in the late 1980&#8242;s. It started as a combination of Larry&#8217;s favorite Unix tools such as sed, awk, and shell, and grew to be the best language for text manipulation.</p>
<p>I started learning Perl back in 1998 by myself. What made it possible for me to do that was that Perl scripts, like shell scripts, are not compiled binaries. You can open it with a (good) text editor and see exactly what the programmer did to make it work. Same thing with HTML, JavaScript, CSS, and all other democratic languages around. No reverse-engineering needed.</p>
<p>Speaking of Web technologies, Perl was considered SO GOOD with manipulating texts, that it was once the #1 language for CGIs. For those of you who don&#8217;t know, CGI stands for Common Gateway Interface and it was the way websites could show dynamic data back in the early days of the Internet. In fact, Perl was so popular with CGIs, that many people didn&#8217;t (and still don&#8217;t) know it could do anything else. On the contrary, although Perl has excellent Web modules such as <a href="http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7014/lib/Catalyst.pm" target="_blank">Catalyst</a>, <a href="http://search.cpan.org/~abw/Template-Toolkit-2.20/lib/Template/Toolkit.pod" target="_blank">Template::Toolkit</a>, <a href="http://search.cpan.org/~drolsky/HTML-Mason-1.45/lib/HTML/Mason.pm">HTML::Mason,</a> and so many others, it&#8217;s not my first choice for Web development (for reasons that are not in the scope of this course). However, I can&#8217;t live without it for anything else.</p>
<p><em><span style="text-decoration:underline;">Perl is portable:</span> </em>you can write one script and run it in just about any Operating System that has a Perl interpreter installed. And you can find Perl interpreters for practically all the OS&#8217;s around.</p>
<p><em><span style="text-decoration:underline;">Perl is fast:</span> </em>although the Perl interpreter needs to read, parse, compile, and run the script on every execution, it&#8217;s still VERY fast by any standard.</p>
<p><em><span style="text-decoration:underline;">Perl gets faster:</span> </em>there are ways to bypass the first 3 stages of the Perl execution, either by using <a href="http://perl.apache.org/" target="_blank">mod_perl </a>for Apache, or by using the <a href="http://search.cpan.org/~smueller/PAR-1.002/lib/PAR.pm" target="_blank">Perl Archive Toolkit</a>, which gives you a precompiled (albeit potentially large) binary of your script.</p>
<p><em><span style="text-decoration:underline;">Perl is Object Oriented:</span> </em>ok, that didn&#8217;t sound right. Perl <span style="text-decoration:underline;"><em>can</em></span> be used from either a procedural or an object oriented scope. In real world applications, you&#8217;re likely to mix both cases to suit your needs.</p>
<p><em><span style="text-decoration:underline;">Perl is extremely high level:</span> </em>this means that given the statements in your script, you are likely to be able to read them as you would plain English. This was done on purpose, of course, given the fact that Larry Wall is a linguist.</p>
<p><span style="text-decoration:underline;"><em>Perl is free:</em></span> you can download it with no cost from several distributors, install, and use for any purpose &#8211; commercial or otherwise and not have to worry about licensing.</p>
<p><em><span style="text-decoration:underline;">Perl is free form:</span></em> you can write the code practically in any way you like and get away with it. This is great as long as you keep in mind that writing good code also means writing clean code. You can seriously hurt your foot if you&#8217;re not careful. Obfuscation is only fun when it&#8217;s intentional.</p>
<p>I can go on forever telling you all that Perl can do, especially if I decide to talk about CPAN, the Comprehensive Perl Archive Network &#8211; a website with over 10,000 modules for everything you can think of, from <a title="Math Modules" href="http://search.cpan.org/search?m=all&amp;q=math" target="_blank">complex math</a> and <a title="Graphic Manipulation in Perl" href="http://search.cpan.org/search?query=GD&amp;mode=all" target="_blank">graphic manipulation</a> to fooling around with the <a href="http://search.cpan.org/search?q=klingon;s=1">Klingon language</a>. You can even use the <a href="http://search.cpan.org/~srezic/Tk-804.028/pod/UserGuide.pod" target="_blank">Perl/Tk</a> to create graphical user interfaces.</p>
<p>If what I said so far was enough to interest you to learn Perl, then keep on reading. There&#8217;s something to the language that feels almost addictive, if you don&#8217;t let all the non-initiated folks make up your mind against it&#8230;</p>
<p style="text-align:right;"><a href="http://usestrict.net/2008/10/05/perl-crash-course/">« TOC</a> | <a href="http://usestrict.net/2008/10/05/perl-crash-course-getting-it-installed-on">Getting it installed on&#8230; »</a></p>
]]></content:encoded>
			<wfw:commentRss>http://usestrict.net/2008/10/perl-crash-course-introduction-to-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

