<?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>mobile and gis dev notes &#187; oracle</title>
	<atom:link href="http:///wordpress/category/oracle/feed/" rel="self" type="application/rss+xml" />
	<link>/wordpress</link>
	<description>by rupert</description>
	<lastBuildDate>Sun, 22 Jan 2012 04:34:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>iPhone Note #8: Exporting Oracle to SQLite3</title>
		<link>/wordpress/2009/08/iphone-note-7-exporting-oracle-to-sqlite3/</link>
		<comments>/wordpress/2009/08/iphone-note-7-exporting-oracle-to-sqlite3/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 12:31:09 +0000</pubDate>
		<dc:creator>Rupert</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sqlite3]]></category>

		<guid isPermaLink="false">http://gismobiledev.wordpress.com/?p=92</guid>
		<description><![CDATA[Since I&#8217;ve been working most of my time with iPhone Dev for the last couple of months, I thought it will be worthwile to post how to import files to SQLite3. In a nutshell, use MesaSQLite&#8217;s IMPORT function. It will save you a lot of time. Now it is up to you how to export [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;ve been working most of my time with iPhone Dev for the last couple of months, I thought it will be worthwile to post how to import files to SQLite3. In a nutshell, use  <a href="http://www.mesamysql.com/?realmesa_home">MesaSQLite&#8217;s</a> IMPORT function. It will save you a lot of time. Now it is up to you how to export into a CSV or TAB delimited file. For Oracle, I used <a href="http://www.oracle.com/technology/products/database/sql_developer/index.html">SQLDeveloper</a>. For other databases, such as MySQL or Postgres, I&#8217;ve used <a href="http://www.navicat.com">Navicat.</a><span id="more-369"></span></p>
<p>1. Using <a href="http://www.oracle.com/technology/products/database/sql_developer/index.html">SQLDeveloper</a> -&gt; Right Click on the Table from the left pane -&gt; Export</p>
<p><img src="/wordpress/wp-content/uploads/2009/08/oracle-sqldeveloper-left.gif" alt="oracle-sqldeveloper-left.gif" border="0" width="278" height="377" /></p>
<p><img src="/wordpress/wp-content/uploads/2009/08/oracle-sqldeveloper.gif" alt="oracle-sqldeveloper.gif" border="0" width="467" height="409" /></p>
<p>2. Choose TEXT since we are going to use that when importing using <a href="http://www.mesamysql.com/?realmesa_home">MesaSQLite.</a> Note, SQLDeveloper does not export CLOB columns. You need to change your column from CLOB to VARCHAR. A workaround is to add a column and then update that column aferwards.</p>
<pre>
ALTER TABLE poi ADD en_desc VARCHAR(2000);
UPDATE poi SET en_desc = en_short_desc;
</pre>
<p>3. In <a href="http://www.mesamysql.com/?realmesa_home">MesaSQLite,</a> FILE -&gt; IMPORT -&gt; CSV/TAB</p>
<p><img src="/wordpress/wp-content/uploads/2009/08/mesa-1.gif" alt="mesa-1.gif" border="0" width="274" height="127" /></p>
<p>4. Choose the table which you want to import.</p>
<p>5. Choose your exported TAB delimited file from SQLDeveloper.</p>
<p>6. Afterwards, map the corresponding fields to your database. Note, that I added an extra column &#8220;dummy&#8221; in the file because it seems I can only match n-1 columns, thus the extra column.</p>
<p><img src="/wordpress/wp-content/uploads/2009/08/mesa-2.gif" alt="mesa-2.gif" border="0" width="344" height="349" /></p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2009/08/iphone-note-7-exporting-oracle-to-sqlite3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two Oracle Homes in one Machine</title>
		<link>/wordpress/2009/06/two-oracle-homes-in-one-machine/</link>
		<comments>/wordpress/2009/06/two-oracle-homes-in-one-machine/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 01:29:12 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">/wordpress/?p=342</guid>
		<description><![CDATA[I&#8217;ve been toggling back and forth two different oracle homes by editing the environment variables from the Control Panel in Windows which is a pain in the ***. What I did was, to create two different command prompt shells with different oracle home environments. I got this idea after a glimpse from FWTools. 1. Create [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been toggling back and forth two different oracle homes by editing the environment variables from the Control Panel in Windows which is a pain in the ***.  What I did was, to create two different command prompt shells with different oracle home environments. I got this idea after a glimpse from FWTools.</p>
<p>1. Create a Command Prompt Shortcut and drag it to your oracle directory, i.e, E:\oracle\Oracle Shell Local</p>
<p>2. Edit the target as:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">C:\WINDOWS\system32\cmd.exe /K &quot;E:\oracle\setlocal.bat&quot;</pre></div></div>

<p>3. Create &#8220;setlocal.bat&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="bat" style="font-family:monospace;">@echo off
SET ORACLE_HOME=E:\oracle\product\10.2.0\db_2
set PATH=E:\oracle\product\10.2.0\db_2\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem</pre></div></div>

<p>Do the same for your remote oracle but with a different bat file.<br />
1. Repeat steps 1 and 2 but name it &#8220;Oracle Shell Remote&#8221; and &#8220;E:\oracle\setremote.bat&#8221;</p>
<p>2. Create &#8220;setremote.bat&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="bat" style="font-family:monospace;">@echo off
SET ORACLE_HOME=E:\oracle\product\10.2.0\client_1
set PATH=E:\oracle\product\10.2.0\client_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem</pre></div></div>

<p>Note: This assumes that you have installed an Oracle Client on E:\oracle\product\10.2.0\client_1</p>
<p>Ok, now let&#8217;s test. I know that I have different record count for a table in my local and remote<br />
1. Fire up &#8220;Oracle Shell Local&#8221;. Run sqlplus<br />
>sqlplus username/password@instance_name_defined_in_local_tnsnames.ora</p>
<p>Note: E:\oracle\product\10.2.0\db_2\NETWORK\ADMIN\tnsnames.ora</p>
<p>2. Fire u p &#8220;Oracle Shell Remote&#8221;. Run sqlplus<br />
>sqlplus username/password@instance_name_defined_in_remote_tnsnames.ora</p>
<p>Note: E:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora</p>
<p>So what? Well its very useful when doing export and imports. Say I want to export a table from my local and import it to my remote oracle. I&#8217;ll just fire up two shells, issue an export in my &#8220;Oracle Shell Local&#8221; and run an import command in my &#8220;Oracle Shell Remote&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2009/06/two-oracle-homes-in-one-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Note #13: RubyonRails + Oracle on Linux (i386 / x64)</title>
		<link>/wordpress/2008/12/rubyonrails-oracle-on-linux-i386-x64/</link>
		<comments>/wordpress/2008/12/rubyonrails-oracle-on-linux-i386-x64/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 00:53:48 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">/wordpress/?p=310</guid>
		<description><![CDATA[In summary, install Oracle Instant Client and try to run sqlplus. If sqlplus connects to the oracle sid then go ahead and install the rails adapters for oracle. What is important to note here, is to install the oracle-instantclient for the architecture of your machine.. I have tested this on Debian Lenny (i386) and CentOS5 [...]]]></description>
			<content:encoded><![CDATA[<p>In summary, install Oracle Instant Client and try to run sqlplus. If sqlplus connects to the oracle sid then go ahead and install the rails adapters for oracle. <strong>What is important to note here, is to install the oracle-instantclient for the architecture of your machine.</strong>. I have tested this on Debian Lenny (i386) and CentOS5 (x64)</p>
<p>1. Download from <a href="http://www.oracle.com/technology/software/tech/oci/instantclient/">http://www.oracle.com/technology/software/tech/oci/instantclient/</a></p>
<p>a. oracle-instantclient-basic-10.2.0.4-1.i386<br />
b. oracle-instantclient-devel-10.2.0.4-1.i386<br />
c. oracle-instantclient-sqlplus-10.2.0.4-1.i386</p>
<p>2. Unzip everything to /opt/oracle/instantclient . You should have something like the ff:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>csapp1 instantclient<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ls -la</span>
total <span style="color: #000000;">102704</span>
drwxr-xr-x <span style="color: #000000;">3</span> root root     <span style="color: #000000;">4096</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">54</span> .
drwxr-xr-x <span style="color: #000000;">3</span> root root     <span style="color: #000000;">4096</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">22</span>:03 ..
<span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> root root      <span style="color: #000000;">228</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> BASIC_README
<span style="color: #660033;">-r--r--r--</span> <span style="color: #000000;">1</span> root root  <span style="color: #000000;">1609607</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> classes12.jar
<span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> root root    <span style="color: #000000;">67542</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> genezi
<span style="color: #660033;">-r--r--r--</span> <span style="color: #000000;">1</span> root root     <span style="color: #000000;">1525</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> glogin.sql
lrwxrwxrwx <span style="color: #000000;">1</span> root root       <span style="color: #000000;">17</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">54</span> libclntsh.so -<span style="color: #000000; font-weight: bold;">&gt;</span> libclntsh.so.10.1
<span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> root root <span style="color: #000000;">21038613</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> libclntsh.so.10.1
<span style="color: #660033;">-r-xr-xr-x</span> <span style="color: #000000;">1</span> root root  <span style="color: #000000;">3796601</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> libnnz10.so
<span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> root root  <span style="color: #000000;">1664116</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> libocci.so.10.1
<span style="color: #660033;">-rwxr-xr-x</span> <span style="color: #000000;">1</span> root root <span style="color: #000000;">72674185</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> libociei.so
<span style="color: #660033;">-r-xr-xr-x</span> <span style="color: #000000;">1</span> root root   <span style="color: #000000;">138033</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> libocijdbc10.so
<span style="color: #660033;">-r-xr-xr-x</span> <span style="color: #000000;">1</span> root root  <span style="color: #000000;">1435561</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> libsqlplusic.so
<span style="color: #660033;">-r-xr-xr-x</span> <span style="color: #000000;">1</span> root root   <span style="color: #000000;">997409</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> libsqlplus.so
<span style="color: #660033;">-r--r--r--</span> <span style="color: #000000;">1</span> root root  <span style="color: #000000;">1555682</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> ojdbc14.jar
drwxr-xr-x <span style="color: #000000;">4</span> root root     <span style="color: #000000;">4096</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> sdk
<span style="color: #660033;">-r-xr-xr-x</span> <span style="color: #000000;">1</span> root root     <span style="color: #000000;">7773</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> sqlplus
<span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> root root      <span style="color: #000000;">232</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">52</span> SQLPLUS_README
<span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> root root      <span style="color: #000000;">516</span> Dec <span style="color: #000000;">10</span> <span style="color: #000000;">21</span>:<span style="color: #000000;">53</span> tnsnames.ora
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>csapp1 instantclient<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>3. Make a symbolic link for libclntsh.so.10.1 as shown above.</p>
<p>4. Create the Oracle Environment variables</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ORACLE_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>instantclient
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">TNS_ADMIN</span>=<span style="color: #007800;">$ORACLE_HOME</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #007800;">$ORACLE_HOME</span>:<span style="color: #007800;">$LD_LIBRARY_PATH</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">DYLD_LIBRARY_PATH</span>=<span style="color: #007800;">$ORACLE_HOME</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #007800;">$ORACLE_HOME</span></pre></div></div>

<p>5. At this point, you should have oracle-instantclient properly installed. You can test by running <strong>sqlplus</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>csapp1 instantclient<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># sqlplus</span>
&nbsp;
SQL<span style="color: #000000; font-weight: bold;">*</span>Plus: Release 10.2.0.4.0 - Production on Thu Dec <span style="color: #000000;">11</span> <span style="color: #000000;">11</span>:<span style="color: #000000;">47</span>:<span style="color: #000000;">40</span> <span style="color: #000000;">2008</span>
&nbsp;
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1982</span>, <span style="color: #000000;">2007</span>, Oracle.  All Rights Reserved.</pre></div></div>

<p>NOTE: Sometimes you will get a SEGMENTATION FAULT. If so, try to open a new shell with the environment variables loaded and do an <strong>sqlplus</strong> in a directory which is not <em>/opt/oracle/instantclient</em>.</p>
<p>6. Install the oracle adapter for rails</p>
<p>7. gem install ruby-oci8</p>
<p>8. gem install oracle_enhanced-adapter &#8211;source=&#8221;http://gems.rubyonrails.org/&#8221;</p>
<p>activerecord-oracle-adapter (1.0.0.9250)<br />
activerecord-oracle_enhanced-adapter (1.1.8)</p>
<p>NOTE: Try to look for the latest gems, the source above is at the time of this writing so it might change.</p>
<p>9. Test using <strong>irb</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>csapp1 instantclient<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># irb</span>
irb<span style="color: #7a0874; font-weight: bold;">&#40;</span>main<span style="color: #7a0874; font-weight: bold;">&#41;</span>:001:<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&gt;</span> require <span style="color: #ff0000;">'rubygems'</span>
=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">true</span>
irb<span style="color: #7a0874; font-weight: bold;">&#40;</span>main<span style="color: #7a0874; font-weight: bold;">&#41;</span>:002:<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&gt;</span> require <span style="color: #ff0000;">'oci8'</span>
=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">true</span>
irb<span style="color: #7a0874; font-weight: bold;">&#40;</span>main<span style="color: #7a0874; font-weight: bold;">&#41;</span>:003:<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/12/rubyonrails-oracle-on-linux-i386-x64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Note #12: Oracle on Intel Mac</title>
		<link>/wordpress/2008/12/ruby-and-rails-oracle-on-intel-mac/</link>
		<comments>/wordpress/2008/12/ruby-and-rails-oracle-on-intel-mac/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 07:52:28 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">/wordpress/?p=307</guid>
		<description><![CDATA[1. Read http://www.foliosus.com/2008/05/05/connecting-ruby-on-rails-to-oracle-on-an-intel-mac-in-leopard-take-2/ 2. Install Oracle Instant Client on Mac. a. Instant Client Package &#8211; Basic: All files required to run OCI, OCCI, and JDBC-OCI applications - instantclient-basic-macosx-10.2.0.4.0.zip (34,020,719 bytes) b. *Instant Client Package &#8211; SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client instantclient-sdk-macosx-10.2.0.4.0.zip (603,493 bytes) OR download [...]]]></description>
			<content:encoded><![CDATA[<p>1.  Read <a href="http://www.foliosus.com/2008/05/05/connecting-ruby-on-rails-to-oracle-on-an-intel-mac-in-leopard-take-2/">http://www.foliosus.com/2008/05/05/connecting-ruby-on-rails-to-oracle-on-an-intel-mac-in-leopard-take-2/</a></p>
<p>2. Install <a href="http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html">Oracle Instant Client on Mac</a>. </p>
<p>a. Instant Client Package &#8211; Basic: All files required to run OCI, OCCI, and JDBC-OCI applications<br />
- instantclient-basic-macosx-10.2.0.4.0.zip (34,020,719 bytes)</p>
<p>b. *Instant Client Package &#8211; SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client<br />
instantclient-sdk-macosx-10.2.0.4.0.zip (603,493 bytes) </p>
<p>OR download the <a href="/installers/oracle/10.2.0.4.zip">whole bundle (10.2.0.4.zip)</a> with sqlplus installed from my installers.</p>
<p>3. Put this on your sudo vim ~/.bash_profile.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ORACLE_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Oracle<span style="color: #000000; font-weight: bold;">/</span>instantclient<span style="color: #000000; font-weight: bold;">/</span>10.2.0.4
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">TNS_ADMIN</span>=<span style="color: #007800;">$ORACLE_HOME</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #007800;">$ORACLE_HOME</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">DYLD_LIBRARY_PATH</span>=<span style="color: #007800;">$ORACLE_HOME</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #007800;">$ORACLE_HOME</span></pre></div></div>

<p>4. Make a symbolic link</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Oracle<span style="color: #000000; font-weight: bold;">/</span>instantclient<span style="color: #000000; font-weight: bold;">/</span>10.2.0.4
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> libclntsh.dylib.10.1 libclntsh.dylib</pre></div></div>

<p>5. Go to /Library/Oracle/instantclient/10.2.0.4 and edit tnsnames.ora. Point the Oracle SID to the IP where you installed Oracle.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.155)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )   
  )
&nbsp;
&nbsp;
ORCL_2_11 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.11)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )   
  )</pre></div></div>

<p>6. Install the oracle-adapter for rails</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> activerecord-oracle-adapter <span style="color: #660033;">--source</span> http:<span style="color: #000000; font-weight: bold;">//</span>gems.rubyonrails.org</pre></div></div>

<p>7. In your database.yml file</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">development:
  adapter: oracle
  database: orcl
  username: youzhu_mobile_dev
  password: your_password</pre></div></div>

<p>or browse the contents of a sample rails project <a href="/wordpress/wp-content/uploads/2008/12/youzhumobiletar.gz" title="youzhumobile.tar.gz">youzhumobile.tar.gz</a> </p>
<p>8. If you ever encounter an <strong>encoding problem</strong>, then we need to set the NLS_LANG environment variable before running <em>script/server</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># export NLS_LANG=American_America.UTF8</span>
<span style="color: #666666; font-style: italic;"># script/server</span></pre></div></div>

<p>or I prefer setting it in the environment.rb</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">Rails::Initializer</span>.<span style="color:#9900CC;">run</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>config<span style="color:#006600; font-weight:bold;">|</span>
  ENV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'NLS_LANG'</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#996600;">'American_America.UTF8'</span>
  <span style="color:#008000; font-style:italic;"># Settings in config/environments/* take precedence over those specified here.</span></pre></div></div>

<p>Note: <a href="/wordpress/?p=228">If you don&#8217;t know your database encoding, then read this post.</a></p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/12/ruby-and-rails-oracle-on-intel-mac/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle Spatial Tutorial Screencasts</title>
		<link>/wordpress/2008/11/oracle-spatial-tutorial-screencasts/</link>
		<comments>/wordpress/2008/11/oracle-spatial-tutorial-screencasts/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 11:01:53 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">/wordpress/?p=288</guid>
		<description><![CDATA[This is the first time I ever did a screencast and it was a lot of fun! Please do forgive me as my voice was horrible. I used iShowU and keyCaster. Google it! I hope you guys enjoyed it..as much as I did.. oracle_spatial_1.mov oracle_spatial_2.mov]]></description>
			<content:encoded><![CDATA[<p>This is the first time I ever did a screencast and it was a lot of fun! Please do forgive me as my voice was horrible. I used iShowU and keyCaster. Google it! </p>
<p>I hope you guys enjoyed it..as much as I did..</p>
<p><a href="/oracledocs/oracle_spatial_1.mov">oracle_spatial_1.mov</a><br />
<a href="/oracledocs/oracle_spatial_2.mov">oracle_spatial_2.mov</a></p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/11/oracle-spatial-tutorial-screencasts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make Oracle start on boot</title>
		<link>/wordpress/2008/09/how-to-make-oracle-start-on-boot/</link>
		<comments>/wordpress/2008/09/how-to-make-oracle-start-on-boot/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 12:57:45 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>
		<category><![CDATA[centos]]></category>

		<guid isPermaLink="false">/wordpress/?p=266</guid>
		<description><![CDATA[1. Login as root and edit /etc/oratab to reflect &#8220;Y&#8221; orcl:/opt/oracle/product/11.1.0/db_1:Y 2. oracle startup script: #!/bin/bash # # oracle Init file for starting and stopping # Oracle Database. Script is valid for 10g and 11g versions. # # chkconfig: 35 80 30 # description: Oracle Database startup script &#160; # Source function library. &#160; . [...]]]></description>
			<content:encoded><![CDATA[<p>1. Login as root and edit /etc/oratab to reflect &#8220;Y&#8221;</p>
<pre>
orcl:/opt/oracle/product/11.1.0/db_1:Y
</pre>
<p>2. oracle startup script:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># oracle Init file for starting and stopping</span>
<span style="color: #666666; font-style: italic;"># Oracle Database. Script is valid for 10g and 11g versions.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># chkconfig: 35 80 30</span>
<span style="color: #666666; font-style: italic;"># description: Oracle Database startup script</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Source function library.</span>
&nbsp;
. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>functions
&nbsp;
<span style="color: #007800;">ORACLE_OWNER</span>=<span style="color: #ff0000;">&quot;oracle&quot;</span>
<span style="color: #007800;">ORACLE_HOME</span>=<span style="color: #ff0000;">&quot;/opt/oracle/product/11.1.0/db_1&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> $<span style="color: #ff0000;">&quot;Starting Oracle DB:&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$ORACLE_OWNER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ORACLE_HOME</span>/bin/dbstart <span style="color: #007800;">$ORACLE_HOME</span>&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$ORACLE_OWNER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ORACLE_HOME</span>/bin/lsnrctl start&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> $<span style="color: #ff0000;">&quot;Stopping Oracle DB:&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$ORACLE_OWNER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ORACLE_HOME</span>/bin/dbshut <span style="color: #007800;">$ORACLE_HOME</span>&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$ORACLE_OWNER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ORACLE_HOME</span>/bin/lsnrctl stop&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> $<span style="color: #ff0000;">&quot;Usage: $0 {start|stop}&quot;</span>
<span style="color: #000000; font-weight: bold;">esac</span></pre></div></div>

<p>3. Oracle EMCTL</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># oraemctl Starting and stopping Oracle Enterprise Manager Database Control.</span>
<span style="color: #666666; font-style: italic;"># Script is valid for 10g and 11g versions.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># chkconfig: 35 80 30</span>
<span style="color: #666666; font-style: italic;"># description: Enterprise Manager DB Control startup script</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Source function library.</span>
&nbsp;
. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>functions
&nbsp;
<span style="color: #007800;">ORACLE_OWNER</span>=<span style="color: #ff0000;">&quot;oracle&quot;</span>
<span style="color: #007800;">ORACLE_HOME</span>=<span style="color: #ff0000;">&quot;/opt/oracle/product/11.1.0/db_1&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> $<span style="color: #ff0000;">&quot;Starting Oracle EM DB Console:&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$ORACLE_OWNER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ORACLE_HOME</span>/bin/emctl start dbconsole&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> $<span style="color: #ff0000;">&quot;Stopping Oracle EM DB Console:&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #007800;">$ORACLE_OWNER</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ORACLE_HOME</span>/bin/emctl stop dbconsole&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> $<span style="color: #ff0000;">&quot;Usage: $0 {start|stop}&quot;</span>
<span style="color: #000000; font-weight: bold;">esac</span></pre></div></div>

<p>4. chkconfig &#8211;add /etc/init.d/oracle<br />
5. chkconfig &#8211;add /etc/init.d/oraemctl</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/09/how-to-make-oracle-start-on-boot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Tuning Tools</title>
		<link>/wordpress/2008/09/oracle-tuning-tools/</link>
		<comments>/wordpress/2008/09/oracle-tuning-tools/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 03:11:36 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">/wordpress/?p=260</guid>
		<description><![CDATA[EXPLAIN PLAN 1. Create the PLAN_TABLE SQL> $ORACLE_HOME/rdbms/admin/utlxplan.sql 2. Run EXPLAIN PLAN for an SQL SQL> EXPLAIN PLAN 2 SET STATEMENT_ID = &#8216;example&#8217; FOR 3 SELECT ename,dname 4 FROM emp inner join dept 5 ON ( emp.deptno = dept.deptno ) 6 / Explained. 3. DISPLAY Results SQL> $ORACLE_HOME/rdbms/admin/utlxpls.sql AUTOTRACE is a SQL*Plus facility that may [...]]]></description>
			<content:encoded><![CDATA[<p><strong>EXPLAIN PLAN</strong></p>
<p>1. Create the PLAN_TABLE<br />
SQL> $ORACLE_HOME/rdbms/admin/utlxplan.sql</p>
<p>2. Run EXPLAIN PLAN for an SQL<br />
SQL> EXPLAIN PLAN<br />
  2      SET STATEMENT_ID = &#8216;example&#8217; FOR<br />
  3  SELECT ename,dname<br />
  4    FROM emp  inner join dept<br />
  5      ON ( emp.deptno = dept.deptno )<br />
  6  /<br />
Explained.</p>
<p>3. DISPLAY Results<br />
SQL>  $ORACLE_HOME/rdbms/admin/utlxpls.sql</p>
<p><strong>AUTOTRACE</strong> is a SQL*Plus facility that may be enabled in your database. To get this up and running you need to have administration rights to the system and perform the following steps:</p>
<p>* Log into SQL*Plus as SYSDBA</p>
<p>* Run the script $ORACLE_HOME/sqlplus/admin/plustrce</p>
<p>* Grant PLUSTRACE to SPATIAL (or to specific users/roles)</p>
<p>To Use:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> autotrace <span style="color: #993333; font-weight: bold;">ON</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> ename<span style="color: #66cc66;">,</span>dname
  <span style="color: #cc66cc;">2</span>    <span style="color: #993333; font-weight: bold;">FROM</span> emp  <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> dept
  <span style="color: #cc66cc;">3</span>      <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">&#40;</span> emp<span style="color: #66cc66;">.</span>deptno <span style="color: #66cc66;">=</span> dept<span style="color: #66cc66;">.</span>deptno <span style="color: #66cc66;">&#41;</span>
  <span style="color: #cc66cc;">4</span>  <span style="color: #66cc66;">/</span>
&nbsp;
ENAME      DNAME
<span style="color: #808080; font-style: italic;">---------- --------------</span>
SMITH      RESEARCH
ALLEN      SALES
WARD       SALES
JONES      RESEARCH
MARTIN     SALES
BLAKE      SALES
CLARK      ACCOUNTING
SCOTT      RESEARCH
KING       ACCOUNTING
TURNER     SALES
ADAMS      RESEARCH
JAMES      SALES
FORD       RESEARCH
MILLER     ACCOUNTING
&nbsp;
<span style="color: #cc66cc;">14</span> rows selected<span style="color: #66cc66;">.</span>
&nbsp;
Execution Plan
<span style="color: #808080; font-style: italic;">----------------------------------------------------------</span>
   <span style="color: #cc66cc;">0</span>      <span style="color: #993333; font-weight: bold;">SELECT</span> STATEMENT Optimizer<span style="color: #66cc66;">=</span>CHOOSE <span style="color: #66cc66;">&#40;</span>Cost<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">3</span> Card<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">14</span> Bytes<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">252</span><span style="color: #66cc66;">&#41;</span>
   <span style="color: #cc66cc;">1</span>    <span style="color: #cc66cc;">0</span>   HASH <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #66cc66;">&#40;</span>Cost<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">3</span> Card<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">14</span> Bytes<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">252</span><span style="color: #66cc66;">&#41;</span>
   <span style="color: #cc66cc;">2</span>    <span style="color: #cc66cc;">1</span>     <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">FULL</span><span style="color: #66cc66;">&#41;</span> OF <span style="color: #ff0000;">'DEPT'</span> <span style="color: #66cc66;">&#40;</span>Cost<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span> Card<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">4</span> Bytes<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">44</span><span style="color: #66cc66;">&#41;</span>
   <span style="color: #cc66cc;">3</span>    <span style="color: #cc66cc;">1</span>     <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">FULL</span><span style="color: #66cc66;">&#41;</span> OF <span style="color: #ff0000;">'EMP'</span> <span style="color: #66cc66;">&#40;</span>Cost<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span> Card<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">14</span> Bytes<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">98</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
Statistics
<span style="color: #808080; font-style: italic;">----------------------------------------------------------</span>
          <span style="color: #cc66cc;">0</span>  recursive calls
          <span style="color: #cc66cc;">4</span>  db block gets
          <span style="color: #cc66cc;">3</span>  consistent gets
          <span style="color: #cc66cc;">0</span>  physical reads
          <span style="color: #cc66cc;">0</span>  redo size
       <span style="color: #cc66cc;">1132</span>  bytes sent via SQL<span style="color: #66cc66;">*</span>Net <span style="color: #993333; font-weight: bold;">TO</span> client
        <span style="color: #cc66cc;">503</span>  bytes received via SQL<span style="color: #66cc66;">*</span>Net <span style="color: #993333; font-weight: bold;">FROM</span> client
          <span style="color: #cc66cc;">2</span>  SQL<span style="color: #66cc66;">*</span>Net roundtrips <span style="color: #993333; font-weight: bold;">TO</span><span style="color: #66cc66;">/</span><span style="color: #993333; font-weight: bold;">FROM</span> client
          <span style="color: #cc66cc;">0</span>  sorts <span style="color: #66cc66;">&#40;</span>memory<span style="color: #66cc66;">&#41;</span>
          <span style="color: #cc66cc;">0</span>  sorts <span style="color: #66cc66;">&#40;</span>disk<span style="color: #66cc66;">&#41;</span>
         <span style="color: #cc66cc;">14</span>  rows processed</pre></div></div>

<p>Courtesy of Beginning Oracle Programming by Sean Dillon et al</p>
<p><span id="more-260"></span><br />
<img src="/wordpress/wp-content/uploads/2008/09/picture-14.png" alt="Picture 1.png" border="0" width="595" height="748" /><br />
<img src="/wordpress/wp-content/uploads/2008/09/picture-21.png" alt="Picture 2.png" border="0" width="593" height="666" /></p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/09/oracle-tuning-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorials Updated for Oracle</title>
		<link>/wordpress/2008/09/tutorials-updated-for-oracle/</link>
		<comments>/wordpress/2008/09/tutorials-updated-for-oracle/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 10:57:29 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">/wordpress/?p=257</guid>
		<description><![CDATA[It was a gruesome day.. I have an oracle10g on my MacBookPro running on VMWare (WindowsXPSP3, let&#8217;s call this orawin). I have another setup box (CentOS5 + oracle11g = oralin) just this morning. I imported the tables from my orawin10g to my oralin11g, created the indexes for the tables in oralin11g. I ran my spatial [...]]]></description>
			<content:encoded><![CDATA[<p>It was a gruesome day.. I have an oracle10g on my MacBookPro running on VMWare (WindowsXPSP3, let&#8217;s call this orawin).  I have another setup box (CentOS5 + oracle11g = oralin) just this morning.  I imported the tables from my orawin10g to my oralin11g, created the indexes for the tables in oralin11g. I ran my spatial test query on orawin10(0.692192571 secs); I ran the same query on oralin11g (14.89 secs).  I viewed the execution plans and both are the same!</p>
<p>Eventually, whatever works.. I have to drop the oracle11g and install Oracle10g instead.  I have updated the <a href="/wordpress/?page_id=187">Tutorials Page</a> to include this, as well as the <a href="/wordpress/?p=228">Oracle CheatSheet</a>.</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/09/tutorials-updated-for-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle SQL CheatSheet</title>
		<link>/wordpress/2008/08/oracle-sql-cheatsheet/</link>
		<comments>/wordpress/2008/08/oracle-sql-cheatsheet/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 12:15:18 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracle spatial]]></category>

		<guid isPermaLink="false">/wordpress/?p=228</guid>
		<description><![CDATA[References: Comparison of different SQL implementations Oracle DataTypes Part 1: Oracle Misc Information *Oracle Services Running on Windows? * How to create a user? CREATE USER &#34;APPDEV&#34; PROFILE &#34;DEFAULT&#34; IDENTIFIED BY &#34;*******&#34; DEFAULT TABLESPACE &#34;USERS&#34; TEMPORARY TABLESPACE &#34;TEMP&#34; ACCOUNT UNLOCK GRANT UNLIMITED TABLESPACE TO &#34;APPDEV&#34;; GRANT &#34;CONNECT&#34; TO &#34;APPDEV&#34;; GRANT &#34;RESOURCE&#34; TO &#34;APPDEV&#34;; * How [...]]]></description>
			<content:encoded><![CDATA[<p>References:<br />
<a href="http://troels.arvin.dk/db/rdbms/">Comparison of different SQL implementations</a></p>
<p><a href="http://ss64.com/ora/syntax-datatypes.html">Oracle DataTypes</a></p>
<h3>Part 1: Oracle Misc Information</h3>
<p><strong>*Oracle Services Running on Windows?</strong><br />
<img src="http://www.gisnotes.com/wordpress/wp-content/uploads/2009/03/oracle-services-running-on-windows.png" border="0" alt="Oracle Services Running on Windows.png" width="733" height="91" /></p>
<p><strong>* How to create a user?</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> USER <span style="color: #ff0000;">&quot;APPDEV&quot;</span> PROFILE <span style="color: #ff0000;">&quot;DEFAULT&quot;</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">&quot;*******&quot;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> TABLESPACE <span style="color: #ff0000;">&quot;USERS&quot;</span> <span style="color: #993333; font-weight: bold;">TEMPORARY</span> TABLESPACE <span style="color: #ff0000;">&quot;TEMP&quot;</span> ACCOUNT <span style="color: #993333; font-weight: bold;">UNLOCK</span>
<span style="color: #993333; font-weight: bold;">GRANT</span> UNLIMITED TABLESPACE <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">&quot;APPDEV&quot;</span>;
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #ff0000;">&quot;CONNECT&quot;</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">&quot;APPDEV&quot;</span>;
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #ff0000;">&quot;RESOURCE&quot;</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">&quot;APPDEV&quot;</span>;</pre></div></div>

<p><strong>* How to load data in bulk?</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">SQLLDR username/password CONTROL=filename DATA=filename</pre></div></div>

<p>Note:<br />
1. You can specify the CHARACTERSET UTF8 in your control file for multilingual databases.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">LOAD</span> <span style="color: #993333; font-weight: bold;">DATA</span>
CHARACTERSET UTF8
<span style="color: #993333; font-weight: bold;">INFILE</span> <span style="color: #66cc66;">*</span>
<span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #993333; font-weight: bold;">TABLE</span> LOADER_TEST
<span style="color: #993333; font-weight: bold;">FIELDS</span> TERMINATED <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">';'</span>
<span style="color: #993333; font-weight: bold;">TRAILING</span> NULLCOLS <span style="color: #66cc66;">&#40;</span>
USR_ID         INTEGER EXTERNAL<span style="color: #66cc66;">,</span>
USR_NAME       CHAR<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
USR_LNK_NAME   CHAR<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
USR_LNK_ORDER  INTEGER EXTERNAL
<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>2. Sometimes SQLLDR does not display anything when loading. Be sure to issue a &#8220;commit&#8221; command before doing anything.</p>
<p><strong>* How to use EXPORT / IMPORT?</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">EXP scott<span style="color: #66cc66;">/</span>tiger@instance FILE<span style="color: #66cc66;">=</span>geo_entities<span style="color: #66cc66;">.</span>dmp <span style="color: #993333; font-weight: bold;">TABLES</span><span style="color: #66cc66;">=</span>geo_entities
&nbsp;
IMP sysman<span style="color: #66cc66;">/</span>password FILE<span style="color: #66cc66;">=/</span>path<span style="color: #66cc66;">/</span><span style="color: #993333; font-weight: bold;">TO</span><span style="color: #66cc66;">/</span>geo_entities<span style="color: #66cc66;">.</span>dmp FROMUSE<span style="color: #66cc66;">=</span>scott TOUSER<span style="color: #66cc66;">=</span>appdev <span style="color: #993333; font-weight: bold;">IGNORE</span><span style="color: #66cc66;">=</span>Y INDEXES<span style="color: #66cc66;">=</span>N <span style="color: #993333; font-weight: bold;">TABLES</span><span style="color: #66cc66;">=</span>geo_entities</pre></div></div>

<p>Note: Delete records first before importing</p>
<p><strong>* What is the database encoding of my database?</strong></p>
<pre>SELECT * FROM V$NLS_PARAMETERS</pre>
<p><img src="http://www.gisnotes.com/wordpress/wp-content/uploads/2008/12/picture-11.png" border="0" alt="Picture 1.png" width="367" height="409" /></p>
<h3>Part 2: Oracle SQL</h3>
<p><strong>* ADD COLUMN in a TABLE</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> table_name <span style="color: #993333; font-weight: bold;">ADD</span> <span style="color: #66cc66;">&#40;</span>column_name  NUMBER<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong>* CHANGE COLUMN NAME in a TABLE</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> geo_entities <span style="color: #993333; font-weight: bold;">MODIFY</span> meta_name varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p><strong>* DROP COLUMN NAME in a TABLE</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> table_name <span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">COLUMN</span> column_name;</pre></div></div>

<p><strong>* ADD PRIMARY KEY CONSTRAINT on a COLUMN</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> table_name <span style="color: #993333; font-weight: bold;">ADD</span> CONSTRAINT table_name_col_pk <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span><span style="color: #66cc66;">&#40;</span>column_name<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong>* Select Top N rows</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> TABLE_NAME <span style="color: #993333; font-weight: bold;">WHERE</span> ROWNUM <span style="color: #66cc66;">&lt;=</span> <span style="color: #cc66cc;">100</span></pre></div></div>

<p><strong>* CREATING AN AUTO INCREMENT COLUMN</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> SEQUENCE seq_table_name_pk INCREMENT <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #cc66cc;">1</span> START <span style="color: #993333; font-weight: bold;">WITH</span> <span style="color: #cc66cc;">10000</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> table_name <span style="color: #66cc66;">&#40;</span>pid<span style="color: #66cc66;">,</span> en_name<span style="color: #66cc66;">&#41;</span> 
<span style="color: #993333; font-weight: bold;">SELECT</span> seq_table_name_pk<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">,</span> en_name <span style="color: #993333; font-weight: bold;">FROM</span> other_table</pre></div></div>

<p><strong>* Concatenating Strings</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> concat<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'hello'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'rupert'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> DUAL;
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">'hello'</span> <span style="color: #66cc66;">||</span> <span style="color: #ff0000;">'rupert'</span> <span style="color: #993333; font-weight: bold;">FROM</span> DUAL;</pre></div></div>

<p><strong>* UPDATE TABLE</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> poi_temp pt
<span style="color: #993333; font-weight: bold;">SET</span> geom <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> geom <span style="color: #993333; font-weight: bold;">FROM</span> poi_app <span style="color: #993333; font-weight: bold;">WHERE</span> poi_id <span style="color: #66cc66;">=</span> pt<span style="color: #66cc66;">.</span>poi_id<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #cc66cc;">1</span> <span style="color: #993333; font-weight: bold;">FROM</span> poi_app <span style="color: #993333; font-weight: bold;">WHERE</span> poi_id <span style="color: #66cc66;">=</span> pt<span style="color: #66cc66;">.</span>poi_id<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">UPDATE</span> poi_app pa
<span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #66cc66;">&#40;</span>long_900913<span style="color: #66cc66;">,</span> lat_900913<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> pg<span style="color: #66cc66;">.</span>long_900913<span style="color: #66cc66;">,</span> pg<span style="color: #66cc66;">.</span>lat_900913 <span style="color: #993333; font-weight: bold;">FROM</span> poi_app_900913 pg <span style="color: #993333; font-weight: bold;">WHERE</span> pa<span style="color: #66cc66;">.</span>poi_id <span style="color: #66cc66;">=</span> pg<span style="color: #66cc66;">.</span>poi_id<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #cc66cc;">1</span> <span style="color: #993333; font-weight: bold;">FROM</span> poi_app_900913 pg <span style="color: #993333; font-weight: bold;">WHERE</span> pa<span style="color: #66cc66;">.</span>poi_id <span style="color: #66cc66;">=</span> pg<span style="color: #66cc66;">.</span>poi_id<span style="color: #66cc66;">&#41;</span></pre></div></div>

<h3>Part 3: Oracle Spatial</h3>
<p><strong>* What is SDO_GEOMETRY?</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">SDO_GEOMETRY{
    SDO_GTYPE, - GeometryType: D00T
    D: Dimension (2: 2d, 3: 3d, 4:4d)
        T:GeometryType(
        0 - unknown
        1 - point
        2 - line
        3 - polygon
        4 - collection
        5 - multipoint
        6 - multiline
        7 - multipolygon
    )
    SDO_SRID,
    SDO_POINT, - NULL for line, polygon, etc.
    SDO_ELEM_INFO,
    SDO_ORDINATES
}</pre></div></div>

<p><strong>* How to know the geometry type?</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">THE_GEOM<span style="color: #66cc66;">&#40;</span>SDO_GTYPE<span style="color: #66cc66;">,</span> SDO_SRID<span style="color: #66cc66;">,</span> SDO_POINT<span style="color: #66cc66;">&#40;</span>X<span style="color: #66cc66;">,</span> Y<span style="color: #66cc66;">,</span> Z<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> SDO_ELEM_INFO<span style="color: #66cc66;">,</span> SDO_ORDINATES<span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">--------------------------------------------------------------------------------</span>
SDO_GEOMETRY<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">4326</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> SDO_ELEM_INFO_ARRAY<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> SDO_ORDINATE_ARRAY<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">116</span>
<span style="color: #66cc66;">.</span>281578<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">39.854501</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">116.281491</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">39.853828</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">116.281236</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">39.853181</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">116.280821</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">....</span>39
<span style="color: #66cc66;">.</span>855174<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">116.281578</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">39.854501</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
THE_GEOM<span style="color: #66cc66;">&#40;</span>SDO_GTYPE<span style="color: #66cc66;">,</span> SDO_SRID<span style="color: #66cc66;">,</span> SDO_POINT<span style="color: #66cc66;">&#40;</span>X<span style="color: #66cc66;">,</span> Y<span style="color: #66cc66;">,</span> Z<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> SDO_ELEM_INFO<span style="color: #66cc66;">,</span> SDO_ORDINATES<span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">--------------------------------------------------------------------------------</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> g<span style="color: #66cc66;">.</span>the_geom<span style="color: #66cc66;">.</span>sdo_gtype <span style="color: #993333; font-weight: bold;">FROM</span> geo_entities g <span style="color: #993333; font-weight: bold;">WHERE</span> rownum <span style="color: #66cc66;">&lt;=</span> <span style="color: #cc66cc;">1</span>;
&nbsp;
THE_GEOM<span style="color: #66cc66;">.</span>SDO_GTYPE
<span style="color: #808080; font-style: italic;">------------------</span>
<span style="color: #cc66cc;">3</span></pre></div></div>

<p><strong>* How to create a spatial index?</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> USER_SDO_GEOM_METADATA <span style="color: #993333; font-weight: bold;">VALUES</span>
<span style="color: #66cc66;">&#40;</span>
    <span style="color: #ff0000;">'table_name'</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- TABLE_NAME</span>
    <span style="color: #ff0000;">'geom'</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- COLUMN_NAME</span>
    SDO_DIM_ARRAY <span style="color: #808080; font-style: italic;">-- DIMINFO attribute for storing dimension bounds, tolerance</span>
    <span style="color: #66cc66;">&#40;</span>
        SDO_DIM_ELEMENT
        <span style="color: #66cc66;">&#40;</span>
            <span style="color: #ff0000;">'LONGITUDE'</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- DIMENSION NAME for first dimension</span>
            <span style="color: #66cc66;">-</span><span style="color: #cc66cc;">180</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- SDO_LB for the dimension</span>
            <span style="color: #cc66cc;">180</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- SDO_UB for the dimension</span>
            <span style="color: #cc66cc;">0.5</span> <span style="color: #808080; font-style: italic;">-- Tolerance of 0.5 meters</span>
        <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
        SDO_DIM_ELEMENT
        <span style="color: #66cc66;">&#40;</span>
            <span style="color: #ff0000;">'LATITUDE'</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- DIMENSION NAME for second dimension</span>
            <span style="color: #66cc66;">-</span><span style="color: #cc66cc;">90</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- SDO_LB for the dimension</span>
            <span style="color: #cc66cc;">90</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- SDO_UB for the dimension</span>
            <span style="color: #cc66cc;">0.5</span> <span style="color: #808080; font-style: italic;">-- Tolerance of 0.5 meters</span>
        <span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
    <span style="color: #cc66cc;">4326</span> <span style="color: #808080; font-style: italic;">-- SRID value for specifying a geodetic coordinate system</span>
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">INDEX</span> idx_poi_app_geom <span style="color: #993333; font-weight: bold;">ON</span> poi_app<span style="color: #66cc66;">&#40;</span>geom<span style="color: #66cc66;">&#41;</span> INDEXTYPE <span style="color: #993333; font-weight: bold;">IS</span> MDSYS<span style="color: #66cc66;">.</span>SPATIAL_INDEX;
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">INDEX</span> idx_poi_app_geom <span style="color: #993333; font-weight: bold;">ON</span> poi_app<span style="color: #66cc66;">&#40;</span>geom<span style="color: #66cc66;">&#41;</span>
INDEXTYPE <span style="color: #993333; font-weight: bold;">IS</span> MDSYS<span style="color: #66cc66;">.</span>SPATIAL_INDEX PARAMETERS<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'LAYER_GTYPE=POINT'</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p><strong>* How to VALIDATE a geometry?</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> SDO_GEOM<span style="color: #66cc66;">.</span>VALIDATE_GEOMETRY_WITH_CONTEXT<span style="color: #66cc66;">&#40;</span>GEOM<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0.000000005</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> table_name</pre></div></div>

<p><strong>* SPATIAL INTERSECTION</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> pc<span style="color: #66cc66;">.</span>postcode<span style="color: #66cc66;">,</span> au<span style="color: #66cc66;">.</span>authority_name<span style="color: #66cc66;">,</span> au<span style="color: #66cc66;">.</span>state<span style="color: #66cc66;">,</span> au<span style="color: #66cc66;">.</span>authority_type
<span style="color: #993333; font-weight: bold;">FROM</span> econ_authorities_valid_temp au<span style="color: #66cc66;">,</span> econ_postcodes pc
<span style="color: #993333; font-weight: bold;">WHERE</span> pc<span style="color: #66cc66;">.</span>POSTCODE <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">3128</span>
	  <span style="color: #993333; font-weight: bold;">AND</span> SDO_ANYINTERACT<span style="color: #66cc66;">&#40;</span>
	  				  pc<span style="color: #66cc66;">.</span>GEOM<span style="color: #66cc66;">,</span>
	  				  au<span style="color: #66cc66;">.</span>GEOM
	  <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'TRUE</span></pre></div></div>

<p><em><br />
Note: </p>
<p>1. Both geometries should be in the same projection.<br />
</em></p>
<p><strong>* Get POINTS in a POLYGON using VERTICES</strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> SDO_UTIL<span style="color: #66cc66;">.</span>GETVERTICES<span style="color: #66cc66;">&#40;</span> GEOM <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> ECON_AUTHORITIES <span style="color: #993333; font-weight: bold;">WHERE</span> AUTHORITYID <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">90009</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/08/oracle-sql-cheatsheet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using SDO_WITHIN_GEOM</title>
		<link>/wordpress/2008/08/using-sdo_within_geom/</link>
		<comments>/wordpress/2008/08/using-sdo_within_geom/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 11:00:21 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">/wordpress/?p=227</guid>
		<description><![CDATA[Experiment 1: Two POIs SELECT p1.poi_id, p1.en_name, p1.py_fullpoiadd, p1.py_rdname, p2.poi_id, p2.en_name, p2.py_fullpoiadd, p2.py_rdname, SDO_GEOM.SDO_DISTANCE&#40;p1.geom, p2.geom, 0.5&#41; AS dist FROM poi_test p1, poi_test p2 WHERE Upper&#40;p1.en_name&#41; LIKE '%PARKSON%' AND Upper&#40;p2.en_name&#41; LIKE '%KFC%' AND SDO_WITHIN_DISTANCE&#40;p1.geom, p2.geom, 'DISTANCE=500 UNIT=METER' &#41;='TRUE' ORDER BY dist Experiment 2: Road + Two POIs SELECT p1.poi_id, p1.en_name, p1.py_fullpoiadd, p1.py_rdname, p2.poi_id, p2.en_name, p2.py_fullpoiadd, p2.py_rdname, [...]]]></description>
			<content:encoded><![CDATA[<p>Experiment 1: Two POIs</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> 
  p1<span style="color: #66cc66;">.</span>poi_id<span style="color: #66cc66;">,</span> 
  p1<span style="color: #66cc66;">.</span>en_name<span style="color: #66cc66;">,</span> 
  p1<span style="color: #66cc66;">.</span>py_fullpoiadd<span style="color: #66cc66;">,</span> 
  p1<span style="color: #66cc66;">.</span>py_rdname<span style="color: #66cc66;">,</span> 
  p2<span style="color: #66cc66;">.</span>poi_id<span style="color: #66cc66;">,</span> 
  p2<span style="color: #66cc66;">.</span>en_name<span style="color: #66cc66;">,</span> 
  p2<span style="color: #66cc66;">.</span>py_fullpoiadd<span style="color: #66cc66;">,</span> 
  p2<span style="color: #66cc66;">.</span>py_rdname<span style="color: #66cc66;">,</span>
  SDO_GEOM<span style="color: #66cc66;">.</span>SDO_DISTANCE<span style="color: #66cc66;">&#40;</span>p1<span style="color: #66cc66;">.</span>geom<span style="color: #66cc66;">,</span> p2<span style="color: #66cc66;">.</span>geom<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> dist
<span style="color: #993333; font-weight: bold;">FROM</span> poi_test p1<span style="color: #66cc66;">,</span> poi_test p2
<span style="color: #993333; font-weight: bold;">WHERE</span> 
	Upper<span style="color: #66cc66;">&#40;</span>p1<span style="color: #66cc66;">.</span>en_name<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%PARKSON%'</span>
<span style="color: #993333; font-weight: bold;">AND</span>	Upper<span style="color: #66cc66;">&#40;</span>p2<span style="color: #66cc66;">.</span>en_name<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%KFC%'</span>
<span style="color: #993333; font-weight: bold;">AND</span> SDO_WITHIN_DISTANCE<span style="color: #66cc66;">&#40;</span>p1<span style="color: #66cc66;">.</span>geom<span style="color: #66cc66;">,</span> p2<span style="color: #66cc66;">.</span>geom<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'DISTANCE=500 UNIT=METER'</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'TRUE'</span>
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> dist</pre></div></div>

<p>Experiment 2: Road + Two POIs</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span>
  p1<span style="color: #66cc66;">.</span>poi_id<span style="color: #66cc66;">,</span> 
  p1<span style="color: #66cc66;">.</span>en_name<span style="color: #66cc66;">,</span> 
  p1<span style="color: #66cc66;">.</span>py_fullpoiadd<span style="color: #66cc66;">,</span> 
  p1<span style="color: #66cc66;">.</span>py_rdname<span style="color: #66cc66;">,</span> 
  p2<span style="color: #66cc66;">.</span>poi_id<span style="color: #66cc66;">,</span> 
  p2<span style="color: #66cc66;">.</span>en_name<span style="color: #66cc66;">,</span> 
  p2<span style="color: #66cc66;">.</span>py_fullpoiadd<span style="color: #66cc66;">,</span> 
  p2<span style="color: #66cc66;">.</span>py_rdname<span style="color: #66cc66;">,</span>
  SDO_GEOM<span style="color: #66cc66;">.</span>SDO_DISTANCE<span style="color: #66cc66;">&#40;</span>p1<span style="color: #66cc66;">.</span>geom<span style="color: #66cc66;">,</span> p2<span style="color: #66cc66;">.</span>geom<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> dist
<span style="color: #993333; font-weight: bold;">FROM</span> poi_app p1<span style="color: #66cc66;">,</span> poi_app p2<span style="color: #66cc66;">,</span> geo_entities g
<span style="color: #993333; font-weight: bold;">WHERE</span> 
	Upper<span style="color: #66cc66;">&#40;</span>p1<span style="color: #66cc66;">.</span>en_name<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%BAR BLU%'</span>
<span style="color: #993333; font-weight: bold;">AND</span>	Upper<span style="color: #66cc66;">&#40;</span>p2<span style="color: #66cc66;">.</span>en_name<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%KOKOMO%'</span>
<span style="color: #993333; font-weight: bold;">AND</span>     Upper<span style="color: #66cc66;">&#40;</span>g<span style="color: #66cc66;">.</span>meta_name<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%SANLITUN%'</span>
<span style="color: #993333; font-weight: bold;">AND</span> SDO_WITHIN_DISTANCE<span style="color: #66cc66;">&#40;</span>p1<span style="color: #66cc66;">.</span>geom<span style="color: #66cc66;">,</span> p2<span style="color: #66cc66;">.</span>geom<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'DISTANCE=500 UNIT=METER'</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'TRUE'</span>
<span style="color: #993333; font-weight: bold;">AND</span> SDO_WITHIN_DISTANCE<span style="color: #66cc66;">&#40;</span>p1<span style="color: #66cc66;">.</span>geom<span style="color: #66cc66;">,</span> g<span style="color: #66cc66;">.</span>the_geom<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'DISTANCE=500 UNIT=METER'</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'TRUE'</span>
<span style="color: #993333; font-weight: bold;">AND</span> SDO_WITHIN_DISTANCE<span style="color: #66cc66;">&#40;</span>p2<span style="color: #66cc66;">.</span>geom<span style="color: #66cc66;">,</span> g<span style="color: #66cc66;">.</span>the_geom<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'DISTANCE=500 UNIT=METER'</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'TRUE'</span></pre></div></div>

<p>Notes:<br />
1. Significant improvement when Sorting is removed.<br />
2. SDO_WITHIN_DISTANCE vs NN? The first finds the nearest geometry within a given distance while NN finds the nearest geometry regardless of the distance. NN could be costly when unused properly.</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/08/using-sdo_within_geom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Text Notes</title>
		<link>/wordpress/2008/08/oracle-text-notes/</link>
		<comments>/wordpress/2008/08/oracle-text-notes/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 14:33:34 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">/wordpress/?p=226</guid>
		<description><![CDATA[Just a couple of notes from studying Oracle Text&#8230; 1. What is the default index? Its CONTEXT. The text column can be of type CLOB, BLOB, BFILE, VARCHAR2, or CHAR. CREATE INDEX idx_ft_meta_en_name ON poi_app(ft_meta_en_name) INDEXTYPE IS CTXSYS.CONTEXT; 2. When you perform inserts or updates on the base table, you must explicitly synchronize the index [...]]]></description>
			<content:encoded><![CDATA[<p>Just a couple of notes from studying Oracle Text&#8230; </p>
<p>1. What is the default index?<br />
Its CONTEXT.  The text column can be of type CLOB, BLOB, BFILE, VARCHAR2, or CHAR.</p>
<p>CREATE INDEX idx_ft_meta_en_name ON poi_app(ft_meta_en_name) INDEXTYPE IS CTXSYS.CONTEXT;</p>
<p>2. When you perform inserts or updates on the base table, you must explicitly synchronize the index with CTX_DDL.SYNC_INDEX.</p>
<p>SQL> EXEC CTX_DDL.SYNC_INDEX(&#8216;idx_docs&#8217;, &#8217;2M&#8217;);</p>
<p>3. CONTAINS Phrase Queries</p>
<p>If multiple words are contained in a query expression, separated only by blank spaces (no operators), the string of words is considered a phrase and Oracle Text searches for the entire string during a query.</p>
<p>4. Logical Operators<br />
<img src="/wordpress/wp-content/uploads/2008/08/picture-13.png" alt="Picture 1.png" border="0" width="518" height="512" /></p>
<p>5. Some sample SQL queries:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- Simple Query</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> SCORE<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> myscore<span style="color: #66cc66;">,</span> en_name<span style="color: #66cc66;">,</span> en_visname<span style="color: #66cc66;">,</span> py_name <span style="color: #993333; font-weight: bold;">FROM</span> poi_app <span style="color: #993333; font-weight: bold;">WHERE</span> CONTAINS<span style="color: #66cc66;">&#40;</span>ft_meta_en_name<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'grammy center'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> myscore <span style="color: #993333; font-weight: bold;">DESC</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">SELECT</span> SCORE<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> myscore<span style="color: #66cc66;">,</span> en_name<span style="color: #66cc66;">,</span> en_visname<span style="color: #66cc66;">,</span> py_name <span style="color: #993333; font-weight: bold;">FROM</span> poi_app <span style="color: #993333; font-weight: bold;">WHERE</span> CONTAINS<span style="color: #66cc66;">&#40;</span>ft_meta_en_name<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'cybersoft'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">-- Query Rewrite</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> en_name<span style="color: #66cc66;">,</span> en_visname<span style="color: #66cc66;">,</span> py_name
<span style="color: #993333; font-weight: bold;">FROM</span> poi_app
<span style="color: #993333; font-weight: bold;">WHERE</span> CONTAINS <span style="color: #66cc66;">&#40;</span>ft_meta_en_name<span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">'&lt;query&gt;
&lt;textquery lang=&quot;ENGLISH&quot; grammar=&quot;CONTEXT&quot;&gt; international hotel boya
&lt;progression&gt;
&lt;seq&gt;&lt;rewrite&gt;transform((TOKENS, &quot;{&quot;, &quot;}&quot;, &quot;AND&quot;))&lt;/rewrite&gt;&lt;/seq&gt;
&lt;seq&gt;&lt;rewrite&gt;transform((TOKENS, &quot;{&quot;, &quot;}&quot;, &quot;ACCUM&quot;))&lt;/rewrite&gt;&lt;/seq&gt;
&lt;/progression&gt;
&lt;/textquery&gt;
&lt;score datatype=&quot;INTEGER&quot; algorithm=&quot;COUNT&quot;/&gt;
&lt;/query&gt;'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">0</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">-- Query 'About'</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> en_name<span style="color: #66cc66;">,</span> en_visname<span style="color: #66cc66;">,</span> py_name<span style="color: #66cc66;">,</span> score<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">FROM</span> poi_app
<span style="color: #993333; font-weight: bold;">WHERE</span> CONTAINS<span style="color: #66cc66;">&#40;</span>ft_meta_en_name<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'about(italian restaurants)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span>
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> SCORE<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DESC</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">-- Query logical</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> en_name<span style="color: #66cc66;">,</span> en_visname<span style="color: #66cc66;">,</span> py_name<span style="color: #66cc66;">,</span> score<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">FROM</span> poi_app
<span style="color: #993333; font-weight: bold;">WHERE</span> CONTAINS<span style="color: #66cc66;">&#40;</span>ft_meta_en_name<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'beijing, international, hotel'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span>
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> SCORE<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DESC</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/08/oracle-text-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating Postgres / Postgis Tables to Oracle Spatial</title>
		<link>/wordpress/2008/08/oracle-spatial-tutorial/</link>
		<comments>/wordpress/2008/08/oracle-spatial-tutorial/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 07:26:10 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">/wordpress/?p=223</guid>
		<description><![CDATA[Step 1: Installing and configuring 1. On Windows, make sure that Windows > Settings > Control Panel > Regional Settings - Chinese (PRC) 2. Install Oracle10g - make sure you have spatial installed SQL&#62; SELECT COMP_NAME, STATUS FROM DBA_REGISTRY WHERE COMP_NAME = 'Spatial'; 3. Create a multilingual database using dbca. Make sure setting is set [...]]]></description>
			<content:encoded><![CDATA[<p><strong><br />
<h4>Step 1: Installing and configuring</h4>
<p></strong> </p>
<p>1. On Windows, make sure that Windows > Settings > Control Panel > Regional Settings<br />
- Chinese (PRC)</p>
<p><img src="/wordpress/wp-content/uploads/2008/08/picture-11.png" alt="Picture 1.png" border="0" width="406" height="478" /></p>
<p>2. Install Oracle10g<br />
- make sure you have spatial installed</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> COMP_NAME<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">STATUS</span>
<span style="color: #993333; font-weight: bold;">FROM</span> DBA_REGISTRY
<span style="color: #993333; font-weight: bold;">WHERE</span> COMP_NAME <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'Spatial'</span>;</pre></div></div>

<p>3. Create a multilingual database using dbca. Make sure setting is set to UTF8. I installed the sample schema for learning purposes. Read this <a href="/wordpress/?p=220">previous post</a> for more information.</p>
<p>4. We can add a user for our spatial database or just enable scott/tiger from the Enterprise Manager.</p>
<p><img src="/wordpress/wp-content/uploads/2008/08/picture-15.png" alt="Picture 15.png" border="0" width="432" height="384" /></p>
<p>On Administration > Users > &#8220;Search for SCOTT&#8221; > Hit EDIT > UNLOCK the status.</p>
<p><img src="/wordpress/wp-content/uploads/2008/08/picture-16.png" alt="Picture 16.png" border="0" width="620" height="487" /> </p>
<p><strong><br />
<h4>Step 2: Get Oracle Client Tools</h4>
<p></strong><br />
1. On the same WindowsXPSP3 machine that I installed Oracle. There is already SQL*Plus. However I always go for the native which is CLI based. So on a command prompt, sqlplus still works. Also note that I can toggle to my previous commands using <em>&#8220;Arrow Up&#8221;</em>. If we have the Oracle Database installed on a different machine, we need to download the ff:</p>
<p>* Oracle SQL Developer (Java GUI-Based)</p>
<p>http://www.oracle.com/technology/software/products/sql/index.html</p>
<p>* Oracle 10g Client for Windows (10201_client_win32 1.zip 453MB)</p>
<p>* Oracle 10g Client for MacOS (Oracle_10204Client_MAC_X86.zip 189MB) &#8211; rarely used.</p>
<p>* Oracle Instant Client for MacOS (instantclient-basic-macosx-10.2.0.4.0.zip 32MB) &#8211; need to try this.</p>
<p><strong><br />
<h4>Step 3: Creating the Table</h4>
<p></strong><br />
1. POI Table</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> poi
<span style="color: #66cc66;">&#40;</span>
  poi_id number<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  cn_name varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  py_name varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  en_name varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  en_visname varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  cn_fullpoiadd varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  en_fullpoiadd varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  py_fullpoiadd varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  cn_rdname varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  py_rdname varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  cn_address_no varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  py_address_no varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  cn_address_other varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  py_address_other varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  postal varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  tel_no varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  fax_no varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  email varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  web_url varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  operating_hours  varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  cards_accepted  varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  cust_capacity  varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  park_space  varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  longitude number<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  latitude number<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  CONSTRAINT <span style="color: #ff0000;">&quot;poi_pkey&quot;</span> <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span>poi_id<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong><br />
<h4>Step 4: Exporting to TextFile with &#8220;|&#8221;</h4>
<p></strong><br />
Export the table into a textfile. Run the SQL statement below on Navicat. Afterwards, run the &#8220;Export Wizard&#8221; and specify &#8220;|&#8221; as the <em>delimiter</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span>
  poi_id<span style="color: #66cc66;">,</span>
  cn_name<span style="color: #66cc66;">,</span>
  py_name<span style="color: #66cc66;">,</span>
  en_name<span style="color: #66cc66;">,</span>
  en_visname<span style="color: #66cc66;">,</span>
  cn_fullpoiadd<span style="color: #66cc66;">,</span>
  en_fullpoiadd<span style="color: #66cc66;">,</span>
  py_fullpoiadd<span style="color: #66cc66;">,</span>
  cn_rdname<span style="color: #66cc66;">,</span>
  py_rdname<span style="color: #66cc66;">,</span>
  cn_address_no<span style="color: #66cc66;">,</span>
  py_address_no<span style="color: #66cc66;">,</span>
  cn_address_other<span style="color: #66cc66;">,</span>
  py_address_other<span style="color: #66cc66;">,</span>
  postal<span style="color: #66cc66;">,</span>
  tel_no<span style="color: #66cc66;">,</span>
  fax_no<span style="color: #66cc66;">,</span>
  email<span style="color: #66cc66;">,</span>
  web_url<span style="color: #66cc66;">,</span>
  operating_hours<span style="color: #66cc66;">,</span>
  cards_accepted<span style="color: #66cc66;">,</span>
  cust_capacity<span style="color: #66cc66;">,</span>
  park_space<span style="color: #66cc66;">,</span>
  longitude<span style="color: #66cc66;">,</span>
  latitude
<span style="color: #993333; font-weight: bold;">FROM</span> poi</pre></div></div>

<p>Find out how many lines were exported using &#8220;wc -l file-name&#8221;. If there are more lines than actual records then most likely there are &#8216;\n&#8217; (newlines / carriage returns) on the exported file.</p>
<p><strong><br />
<h4>Step 5: Use SQLLOADER to bulkload the data</h4>
<p></strong></p>
<p>SQLLDR scott/tiger CONTROL=poi_full.ctl DATA=data_navicat_cn_all2.dat</p>
<p>Since we have point data in longitude, latitude columns. It is very easy to populate the SDO_GEOMETRY with these columns.</p>
<p><strong><br />
<h4>Step 6: Creating Point Geometries from Long/Lat Columns</h4>
<p></strong></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> poi_app <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> poi <span style="color: #993333; font-weight: bold;">WHERE</span> latitude <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333; font-weight: bold;">AND</span> longitude <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span> poi_app <span style="color: #993333; font-weight: bold;">ADD</span> the_geom SDO_GEOMETRY;
&nbsp;
<span style="color: #993333; font-weight: bold;">UPDATE</span> poi_app 
<span style="color: #993333; font-weight: bold;">SET</span> the_geom <span style="color: #66cc66;">=</span> SDO_GEOMETRY<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">2001</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> SDO_POINT_TYPE<span style="color: #66cc66;">&#40;</span>longitude<span style="color: #66cc66;">,</span> latitude<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> USER_SDO_GEOM_METADATA <span style="color: #993333; font-weight: bold;">VALUES</span>
<span style="color: #66cc66;">&#40;</span>
	<span style="color: #ff0000;">'poi_app'</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- TABLE_NAME</span>
	<span style="color: #ff0000;">'the_geom'</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- COLUMN_NAME</span>
	SDO_DIM_ARRAY <span style="color: #808080; font-style: italic;">-- DIMINFO attribute for storing dimension bounds, tolerance</span>
	<span style="color: #66cc66;">&#40;</span>
		SDO_DIM_ELEMENT
		<span style="color: #66cc66;">&#40;</span>
			<span style="color: #ff0000;">'LONGITUDE'</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- DIMENSION NAME for first dimension</span>
			<span style="color: #66cc66;">-</span><span style="color: #cc66cc;">180</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- SDO_LB for the dimension</span>
			<span style="color: #cc66cc;">180</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- SDO_UB for the dimension</span>
			<span style="color: #cc66cc;">0.5</span> <span style="color: #808080; font-style: italic;">-- Tolerance of 0.5 meters</span>
		<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
		SDO_DIM_ELEMENT
		<span style="color: #66cc66;">&#40;</span>
			<span style="color: #ff0000;">'LATITUDE'</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- DIMENSION NAME for second dimension</span>
			<span style="color: #66cc66;">-</span><span style="color: #cc66cc;">90</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- SDO_LB for the dimension</span>
			<span style="color: #cc66cc;">90</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">-- SDO_UB for the dimension</span>
			<span style="color: #cc66cc;">0.5</span> <span style="color: #808080; font-style: italic;">-- Tolerance of 0.5 meters</span>
		<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
	<span style="color: #cc66cc;">4326</span> <span style="color: #808080; font-style: italic;">-- SRID value for specifying a geodetic coordinate system</span>
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">INDEX</span> idx_poi_app_the_geom <span style="color: #993333; font-weight: bold;">ON</span> poi_app<span style="color: #66cc66;">&#40;</span>the_geom<span style="color: #66cc66;">&#41;</span> INDEXTYPE <span style="color: #993333; font-weight: bold;">IS</span> MDSYS<span style="color: #66cc66;">.</span>SPATIAL_INDEX;</pre></div></div>

<p>Once the index is created, <em>Oracle creates a SEQUENCE(MDRS_C796$) and a TABLE(MDRT_C796$)</em>. Please do not delete this table. I accidentally deleted this table and I have to recreate the indexes&#8211;well it was not that easy. I have to DROP INDEX, insert it into USER_SDO_GEOM_METADATA, then CREATE INDEX.</p>
<p>Note that it is important to include the geometry to be indexed in the USER_SDO_GEOM_METADATA table. This should happen before creating the index or receive an error like&#8230;</p>
<p><img src="/wordpress/wp-content/uploads/2008/08/picture-21.png" alt="Picture 2.png" border="0" width="492" height="237" /></p>
<p><strong><br />
<h4>Step 7: Creating Geometries from ESRI Shapefiles</h4>
<p></strong><br />
* PGSQL2SHP &#8211; Use this to convert from a postgres table to an ESRI Shapefile. Note that if you have mixed geometries in a single column, then you need output different shapefiles for each geometry. For example, I have a &#8220;geo_entities&#8221; table which contains polygons, multipolygons, and multilinestrings. I was able to come up with three (3) different shapefiles for each geometry. Then afterwards load the individual shapefiles using SDO2SHP below.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pgsql2shp <span style="color: #660033;">-f</span> geo_entities_2006 <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-u</span> lbs <span style="color: #660033;">-P</span> <span style="color: #000000; font-weight: bold;">*******</span> <span style="color: #660033;">-g</span> the_geom beijing_app <span style="color: #ff0000;">&quot;SELECT gid,cn_name,py_name,en_name,entity_type,geom_type,meta_name,cn_district,the_geom FROM geo_entities WHERE GeometryType(the_geom) = 'MULTILINESTRING'&quot;</span></pre></div></div>

<p>* Ensure that you download <a href="http://www.oracle.com/technology/software/products/spatial/index.html">SDO2SHP</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">shp2sdo shp\geo_entities_2007 geo_entities_2007 <span style="color: #660033;">-g</span> the_geom <span style="color: #660033;">-x</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>-<span style="color: #000000;">180</span>,<span style="color: #000000;">180</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-y</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>-<span style="color: #000000;">90</span>,<span style="color: #000000;">90</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-s</span> <span style="color: #000000;">4326</span> 
<span style="color: #660033;">-t</span> <span style="color: #000000;">0.5</span> <span style="color: #660033;">-v</span></pre></div></div>

<p>The output of SHP2SDO are three (3) files:</p>
<p>a. CTL &#8211; control file containing &#8220;LOAD DATA&#8230;&#8221;<br />
b. SQL &#8211; contains &#8220;CREATE TABLE&#8230;&#8221;<br />
c. DAT &#8211; Data with &#8220;#&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/08/oracle-spatial-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle: Creating a MultiLingual Database</title>
		<link>/wordpress/2008/08/oracle-creating-a-multilingual-database/</link>
		<comments>/wordpress/2008/08/oracle-creating-a-multilingual-database/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 06:47:29 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">/wordpress/?p=220</guid>
		<description><![CDATA[Notes on to create a multilingual database in UTF8 in Oracle10g. 1. Run the Oracle Database Configuration Assistant (DBCA) 2. Choose Create Database 3. Choose &#8220;General Purpose&#8221;. 4. Then specify the GLOBAL DATABASE NAME or ORACLE SID (orcl4) 5. Click Next on Management Options. 6. On &#8220;Database Credentials&#8221;, use the same passwords so we would [...]]]></description>
			<content:encoded><![CDATA[<p>Notes on to create a multilingual database in UTF8 in Oracle10g.</p>
<p>1. Run the Oracle Database Configuration Assistant (DBCA)</p>
<p><img src="/wordpress/wp-content/uploads/2008/08/picture-2.png" alt="Picture 2.png" border="0" width="600" height="335" /></p>
<p>2. Choose Create Database</p>
<p><img src="/wordpress/wp-content/uploads/2008/08/picture-3.png" alt="Picture 3.png" border="0" width="656" height="434" /></p>
<p>3. Choose &#8220;General Purpose&#8221;. </p>
<p>4. Then specify the <strong>GLOBAL DATABASE NAME</strong> or <strong>ORACLE SID</strong> (orcl4)</p>
<p><img src="/wordpress/wp-content/uploads/2008/08/picture-5.png" alt="Picture 5.png" border="0" width="652" height="434" /></p>
<p>5. Click Next on Management Options.</p>
<p>6. On &#8220;Database Credentials&#8221;, use the same passwords so we would not forget them for now&#8230;</p>
<p><img src="/wordpress/wp-content/uploads/2008/08/picture-7.png" alt="Picture 7.png" border="0" width="655" height="432" /></p>
<p>7. On &#8220;Storage Options&#8221;. Default options is FILE STORAGE. Next.</p>
<p>8. On &#8220;Database File Locations&#8221;, hit Next as well.</p>
<p>9. On &#8220;Recover Options&#8221;, same goes here.. Next.</p>
<p>10. On &#8220;Database Content&#8221;, install the sample schemas for practice.<br />
<img src="/wordpress/wp-content/uploads/2008/08/picture-111.png" alt="Picture 11.png" border="0" width="653" height="431" /></p>
<p>11. On &#8220;Initialization Parameters&#8221;, click on the &#8220;Character Sets&#8221; tab. Note that we chose the 2nd option which is &#8220;Use Unicode&#8221; (ALT32UTF8) in order to support chinese. On the National Character Set, please choose &#8220;UTF8&#8243; (the 2nd option in the drop-down list&#8221;) also.</p>
<p><img src="/wordpress/wp-content/uploads/2008/08/picture-12.png" alt="Picture 12.png" border="0" width="652" height="432" />  </p>
<p>12. Hit Next until we create the database.</p>
<p>13. To check you should have the Oracle Services installed in your Services.</p>
<p><img src="/wordpress/wp-content/uploads/2008/08/picture-14.png" alt="Picture 14.png" border="0" width="367" height="85" /></p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/08/oracle-creating-a-multilingual-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Oracle11g x64 on CentOS5</title>
		<link>/wordpress/2008/07/installing-oracle-x64-on-centos5/</link>
		<comments>/wordpress/2008/07/installing-oracle-x64-on-centos5/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 04:36:25 +0000</pubDate>
		<dc:creator>rupert</dc:creator>
				<category><![CDATA[oracle]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">/wordpress/?p=198</guid>
		<description><![CDATA[FOR EDITING.. This is just a couple of notes from my Oracle testing a few weeks back that I forgot to post.. A. Installing 1. Check for rpm packages: rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21 elfutils-libelf libaio-devel libgcc NOTE: For 10g, you need [...]]]></description>
			<content:encoded><![CDATA[<p>FOR EDITING.. This is just a couple of notes from my Oracle testing a few weeks back that I forgot to post..</p>
<p><strong>A. Installing </strong></p>
<p>1. Check for rpm packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rpm <span style="color: #660033;">-q</span> binutils compat-db control-center <span style="color: #c20cb9; font-weight: bold;">gcc</span> gcc-c++ glibc glibc-common gnome-libs libstdc++ libstdc++-devel <span style="color: #c20cb9; font-weight: bold;">make</span> pdksh sysstat xscreensaver libaio openmotif21 elfutils-libelf libaio-devel libgcc</pre></div></div>

<p><em>NOTE: For 10g, you need libXp.so.6 installed. It seems the oracle installer is messed up with some i386 modules pointing to x86? Anyway, I was able to resolve the problem by installing the libXp.i386.rpm version.</em></p>
<p>2. install the necessary rpm packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rpm <span style="color: #660033;">-ivh</span> compat-db-4.2.52-5.1.x86_64.rpm 
rpm <span style="color: #660033;">-ivh</span> libgnome-2.16.0-6.el5.x86_64.rpm 
rpm <span style="color: #660033;">-ivh</span> sysstat-7.0.0-3.el5.x86_64.rpm 
rpm <span style="color: #660033;">-ivh</span> libaio-devel-0.3.106-3.2.x86_64.rpm 
rpm <span style="color: #660033;">-ivh</span> lm_sensors-2.10.0-3.1.x86_64.rpm
rpm <span style="color: #660033;">-ivh</span> beecrypt-devel-4.1.2-10.1.1.x86_64.rpm elfutils-devel-<span style="color: #000000;">0.125</span>-3.el5.x86_64.rpm net-snmp-devel-5.3.1-19.el5.x86_64.rpm elfutils-devel-static-<span style="color: #000000;">0.125</span>-3.el5.x86_64.rpm net-snmp-5.3.1-19.el5.x86_64.rpm net-snmp-libs-5.3.1-19.el5.x86_64.rpm</pre></div></div>

<p>3. vim /etc/profile</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">ORACLE_BASE</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product
<span style="color: #007800;">ORACLE_SID</span>=csdbora
<span style="color: #007800;">ORACLE_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db_1
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> ORACLE_BASE ORACLE_SID ORACLE_HOME
&nbsp;
<span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #007800;">$ORACLE_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #007800;">$LD_LIBRARY_PATH</span>:<span style="color: #007800;">$ORACLE_HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib</pre></div></div>

<p>4. Create oracle Account</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">groupadd oinstall
groupadd dba
useradd <span style="color: #660033;">-m</span> <span style="color: #660033;">-g</span> oinstall <span style="color: #660033;">-G</span> dba oracle
<span style="color: #c20cb9; font-weight: bold;">id</span> oracle</pre></div></div>

<p>uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)</p>
<p>5. Run modify_kernel.sh</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysctl.conf <span style="color: #cc0000; font-style: italic;">&lt;&lt; EOF
kernel.shmall = 2097152
kernel.shmmax = 1073741824 
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1025 65000
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_max = 262144
EOF</span></pre></div></div>

<p>6. vim /etc/sysctl.conf and comment kernel.shmall and kernel.shmmax because if<br />
you don&#8217;t then we will have double results</p>
<p>7. /sbin/sysctl -p</p>
<p>8. Create Directories:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>u01
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> oracle:oinstall <span style="color: #000000; font-weight: bold;">/</span>u01
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> oracle:oinstall <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>u01
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product</pre></div></div>

<p>9. Run sh -v modify_shelllimits.sh</p>
<p>10. Add the ff lines in /etc/pam.d/login<br />
session required /lib/security/pam_limits.so<br />
session required pam_limits.so</p>
<p>11. cp -rf /home/installers/linux.x64_11gR1_database.zip /opt/oracle</p>
<p>12. chown oracle:oinstall /opt/oracle/linux.x64_11gR1_database.zip</p>
<p>13. Clost all terminals and logout as root from desktop.</p>
<p>14. Login as oracle</p>
<p>15. Follow tutorial until installing oracle<br />
<a href="/wordpress/wp-content/uploads/2008/08/installing-oracle-11g-on-centos-under-vmware-on-a-macbook.doc" title="Installing Oracle 11g on CentOS under VMWare on a Macbook.doc">Installing Oracle 11g on CentOS under VMWare on a Macbook.doc</a></p>
<p>To extract:  cpio -idmv < 10201_database_linux_x86_64.cpio</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>redhat-release
Redhat <span style="color: #000000;">4</span></pre></div></div>

<p>16. Run the 2 scripts after the dialog:</p>
<p>[root@cs5ora11g db1]# sh root.sh<br />
Running Oracle 11g root.sh script&#8230;</p>
<p>The following environment variables are set as:<br />
    ORACLE_OWNER= oracle<br />
    ORACLE_HOME=  /opt/oracle/product/11.1.0/db1</p>
<p>Enter the full pathname of the local bin directory: [/usr/local/bin]:<br />
   Copying dbhome to /usr/local/bin &#8230;<br />
   Copying oraenv to /usr/local/bin &#8230;<br />
   Copying coraenv to /usr/local/bin &#8230;</p>
<p>Creating /etc/oratab file&#8230;<br />
Entries will be added to the /etc/oratab file as needed by<br />
Database Configuration Assistant when a database is created<br />
Finished running generic part of root.sh script.<br />
Now product-specific root actions will be performed.<br />
Finished product-specific root actions.</p>
<p>17. Open your firewall to 1158</p>
<p>18. Go to https://192.168.1.155:1158/em </p>
<p>- Login as SYSMAN:[password] (nickname+wife)</p>
<p>19. Install Oracle Instant Client for your distro [MacOS]</p>
<p>http://www.oracle.com/technology/software/tech/oci/instantclient/index.html</p>
<p>a. Add exports to runsqlplus.sh<br />
b. copy tnsnames.ora from centos to mac<br />
c. add in firewall: 1521<br />
d. sh runsqlplus.sh</p>
<p>20. do sqlplus<br />
Enter user-name: SYSMAN@cybersof<br />
Enter password: </p>
<p>Connected to:<br />
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 &#8211; 64bit Production<br />
With the Partitioning, OLAP, Data Mining and Real Application Testing options<br />
SQL> </p>
<p>You are now connected successfully.</p>
<p>21. Check for oracle processes: ps -ef | grep ora</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">SQLPLUS DBINSTANCE:
oraclecybersof <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">LOCAL</span>=NO<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
&nbsp;
ORACLE LISTENER:
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>tnslsnr LISTENER <span style="color: #660033;">-inherit</span>
&nbsp;
ORACLE ENTERPRISE MANAGER:
oracle   <span style="color: #000000;">14487</span>     <span style="color: #000000;">1</span>  <span style="color: #000000;">0</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">37</span> ?        00:00:00
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>perl<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">perl</span>
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>emwd.pl dbconsole
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>cs5ora11g_csmlcc<span style="color: #000000; font-weight: bold;">/</span>sysman<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>emdb.nohup
oracle   <span style="color: #000000;">14511</span> <span style="color: #000000;">14487</span>  <span style="color: #000000;">2</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">37</span> ?        00:00:<span style="color: #000000;">36</span>
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>jdk<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>java <span style="color: #660033;">-server</span> <span style="color: #660033;">-Xmx512M</span>
-XX:<span style="color: #007800;">MaxPermSize</span>=1024M -XX:<span style="color: #007800;">MinHeapFreeRatio</span>=<span style="color: #000000;">20</span> -XX:<span style="color: #007800;">MaxHeapFreeRatio</span>=<span style="color: #000000;">40</span>
-DORACLE_HOME=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1
-Doracle.home=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>oc4j
-Doracle.oc4j.localhome=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>cs5ora11g_csmlcc<span style="color: #000000; font-weight: bold;">/</span>sysman
<span style="color: #660033;">-DEMSTATE</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>cs5ora11g_csmlcc
-Doracle.j2ee.dont.use.memory.archive=<span style="color: #c20cb9; font-weight: bold;">true</span>
-Djava.protocol.handler.pkgs=HTTPClient
-Doracle.security.jazn.config=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>oc4j<span style="color: #000000; font-weight: bold;">/</span>j2ee<span style="color: #000000; font-weight: bold;">/</span>OC4J_DBConsole_cs5ora11g_csmlcc<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>jazn.xml
-Djava.security.policy=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>oc4j<span style="color: #000000; font-weight: bold;">/</span>j2ee<span style="color: #000000; font-weight: bold;">/</span>OC4J_DBConsole_cs5ora11g_csmlcc<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>java2.policy
-Djavax.net.ssl.KeyStore=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>sysman<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>OCMTrustedCerts.txt-Djava.security.properties=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>oc4j<span style="color: #000000; font-weight: bold;">/</span>j2ee<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>jazn.security.props
<span style="color: #660033;">-DEMDROOT</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>cs5ora11g_csmlcc
-Dsysman.md5<span style="color: #007800;">password</span>=<span style="color: #c20cb9; font-weight: bold;">true</span> -Drepapi.oracle.home=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1
-Ddisable.checkForUpdate=<span style="color: #c20cb9; font-weight: bold;">true</span>
-Doracle.sysman.ccr.ocmSDK.websvc.keystore=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>jlib<span style="color: #000000; font-weight: bold;">/</span>emocmclnt.ks
-Dice.pilots.html4.ignoreNonGenericFonts=<span style="color: #c20cb9; font-weight: bold;">true</span> -Djava.awt.headless=<span style="color: #c20cb9; font-weight: bold;">true</span> <span style="color: #660033;">-jar</span>
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>oc4j<span style="color: #000000; font-weight: bold;">/</span>j2ee<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>oc4j.jar <span style="color: #660033;">-config</span>
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1<span style="color: #000000; font-weight: bold;">/</span>oc4j<span style="color: #000000; font-weight: bold;">/</span>j2ee<span style="color: #000000; font-weight: bold;">/</span>OC4J_DBConsole_cs5ora11g_csmlcc<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>server.xml</pre></div></div>

<p>22. Set Oracle Environment</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># su - oracle</span>
<span style="color: #666666; font-style: italic;"># vim ~/.bash_profile</span>
<span style="color: #007800;">ORACLE_BASE</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product
<span style="color: #007800;">ORACLE_SID</span>=cybersof
<span style="color: #007800;">ORACLE_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>11.1.0<span style="color: #000000; font-weight: bold;">/</span>db1
<span style="color: #7a0874; font-weight: bold;">export</span> ORACLE_BASE ORACLE_SID ORACLE_HOME
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #007800;">$LD_LIBRARY_PATH</span>:<span style="color: #007800;">$ORACLE_HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib</pre></div></div>

<p>23. Shutdown and Startup of Oracle</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ . oraenv
<span style="color: #000000; font-weight: bold;">&lt;</span>enter your SID<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
$ sqlplus <span style="color: #ff0000;">&quot;/ as sysdba&quot;</span>
SQL<span style="color: #000000; font-weight: bold;">&gt;</span> startup
SQL<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">exit</span>
&nbsp;
$ lsnrctl
LSNRCTL<span style="color: #000000; font-weight: bold;">&gt;</span> start
LSNRCTL<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">exit</span>
&nbsp;
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$ORACLE_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin
.<span style="color: #000000; font-weight: bold;">/</span>emctl start dbconsole</pre></div></div>

<p><strong>B. Creating Users</strong></p>
<p>Login to https://192.168.1.155:1158/em<br />
username:sysman<br />
password: [nickname+wifey]<br />
connect as &#8220;sysdba&#8221;</p>
<p>1. Creating admin user: </p>
<p><a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28301/admqs_administer_users.htm#CHDBDBGI">http://download.oracle.com/docs/cd/B28359_01/server.111/b28301/admqs_administer_users.htm#CHDBDBGI</a></p>
<p>em > Setup > Administrators > Create</p>
<p>2. Create appdev user:<br />
em > Server > Roles</p>
<p><a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28301/admqs_administer_users.htm">http://download.oracle.com/docs/cd/B28359_01/server.111/b28301/admqs_administer_users.htm</a></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> USER <span style="color: #ff0000;">&quot;APPDEV&quot;</span> PROFILE <span style="color: #ff0000;">&quot;DEFAULT&quot;</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">&quot;*******&quot;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> TABLESPACE <span style="color: #ff0000;">&quot;USERS&quot;</span> <span style="color: #993333; font-weight: bold;">TEMPORARY</span> TABLESPACE <span style="color: #ff0000;">&quot;TEMP&quot;</span> ACCOUNT <span style="color: #993333; font-weight: bold;">UNLOCK</span>
<span style="color: #993333; font-weight: bold;">GRANT</span> UNLIMITED TABLESPACE <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">&quot;APPDEV&quot;</span>;
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #ff0000;">&quot;CONNECT&quot;</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">&quot;APPDEV&quot;</span>;
<span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #ff0000;">&quot;RESOURCE&quot;</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">&quot;APPDEV&quot;</span>;</pre></div></div>

<p><img src="/wordpress/wp-content/uploads/2008/09/picture-13.png" alt="Picture 1.png" border="0" width="360" height="833" /></p>
<p><strong>Part II. Installing Oracle10g on CentOS5</strong></p>
<p>1. Choose Advanced Installation&#8221;</p>
<p><img src="/wordpress/wp-content/uploads/2008/09/picture-1.png" alt="Picture 1.png" border="0" width="600" height="507" /></p>
<p>2. If its just network prerequisite.. ignore it. It&#8217;s not a big deal.</p>
<p><img src="/wordpress/wp-content/uploads/2008/09/picture-2.png" alt="Picture 2.png" border="0" width="600" height="510" /></p>
<p>3. ORACLE_HOME: /opt/oracle/product/10.2.0/db_1</p>
<p><img src="/wordpress/wp-content/uploads/2008/09/picture-3.png" alt="Picture 3.png" border="0" width="600" height="509" /></p>
<p>4. ORACLE_SID: orcl, CHARSET: utf8</p>
<p><img src="/wordpress/wp-content/uploads/2008/09/picture-4.png" alt="Picture 4.png" border="0" width="600" height="511" /></p>
<p>5. EM Installed&#8230;</p>
<p><img src="/wordpress/wp-content/uploads/2008/09/picture-6.png" alt="Picture 6.png" border="0" width="551" height="374" /></p>
<p>6. ISQLPLUS</p>
<p><img src="/wordpress/wp-content/uploads/2008/09/picture-7.png" alt="Picture 7.png" border="0" width="655" height="511" /></p>
<p>7. Run root.sh</p>
<p><img src="/wordpress/wp-content/uploads/2008/09/picture-9.png" alt="Picture 9.png" border="0" width="553" height="390" /></p>
<p>output&#8230;</p>
<p><img src="/wordpress/wp-content/uploads/2008/09/picture-8.png" alt="Picture 8.png" border="0" width="668" height="461" /></p>
<p>8. Other settings</p>
<p><img src="/wordpress/wp-content/uploads/2008/09/picture-10.png" alt="Picture 10.png" border="0" width="649" height="507" /></p>
<p>9. Oracle Environment Variables</p>
<p><img src="/wordpress/wp-content/uploads/2008/09/picture-12.png" alt="Picture 12.png" border="0" width="669" height="466" /></p>
]]></content:encoded>
			<wfw:commentRss>/wordpress/2008/07/installing-oracle-x64-on-centos5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

