<?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>moopoo.net &#187; Database</title>
	<atom:link href="http://moopoo.net/tag/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://moopoo.net</link>
	<description>Fishing, technology and anything else</description>
	<lastBuildDate>Fri, 09 Dec 2011 11:04:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Importing CSV data into Oracle</title>
		<link>http://moopoo.net/oracle/importing-csv-data-into-oracle/</link>
		<comments>http://moopoo.net/oracle/importing-csv-data-into-oracle/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 09:12:06 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://moopoo.net/blog/2007/10/25/importing-csv-data-into-oracle/</guid>
		<description><![CDATA[Loading data into Oracle table requires the use of the sqlldr executable. To load data I create two files, one a CSV file containing the data to import and a control (.ctl) file containing the command information to pass to sqlldr.exe. The Control File load data infile 'addresses.csv' &#160; INTO TABLE myschema.mytable fields terminated BY [...]]]></description>
			<content:encoded><![CDATA[<p>Loading data into Oracle table requires the use of the sqlldr executable.  To load data I create two files, one a CSV file containing the data to import and a control (.ctl) file containing the command information to pass to sqlldr.exe.</p>
<h3>The Control File</h3>

<div class="wp_syntax"><div class="code"><pre class="oracle8" style="font-family:monospace;">load data
infile <span style="color: #ff0000;">'addresses.csv'</span>
&nbsp;
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">INTO</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLE</span> myschema.mytable fields terminated <span style="color: #993333; font-weight: bold; text-transform: uppercase;">BY</span> <span style="color: #ff0000;">&quot;,&quot;</span> 
         optionally enclosed <span style="color: #993333; font-weight: bold; text-transform: uppercase;">BY</span> <span style="color: #ff0000;">'&quot;'</span>
<span style="color: #66cc66;">&#40;</span>
    NAME
    <span style="color: #66cc66;">,</span>TELEPHONE
    <span style="color: #66cc66;">,</span>ADDRESS
    <span style="color: #66cc66;">,</span>LAST_UPDT <span style="color: #993333; font-weight: bold; text-transform: uppercase;">DATE</span> <span style="color: #ff0000;">'dd-Mon-yyyy HH:MI:SS PM'</span>
<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Notice that I&#8217;ve put a format on the date, I&#8217;ve had problems with dates if I don&#8217;t give the format for the date when importing. Save this file locally as <strong>addresses.ctl</strong></p>
<h3>The Data File</h3>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">&quot;Matt&quot;,&quot;<span style="color: #cc66cc;">3094785</span>&quot;,&quot;<span style="color: #cc66cc;">55</span> My Street&quot;,&quot;<span style="color: #cc66cc;">25</span>-Oct-07&quot;
&quot;Ricardo&quot;,&quot;<span style="color: #cc66cc;">354102</span>&quot;,&quot;<span style="color: #cc66cc;">12</span> Easy Road&quot;,&quot;<span style="color: #cc66cc;">10</span>-Mar-06&quot;
........</pre></div></div>

<p>
Save this file as <strong>addresses.csv</strong> as declared in the control file. The file should be sve in the same directory as the control file.</p>
<p>To import the data, open a command prompt window and type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">c:\path\to\oracle\bin\sqlldr  username<span style="color: #33cc33;">@</span>oracleservername 
                        control=\path\to\addresses.ctl</pre></div></div>

<p>That should import all the data into oracle. A relevant log file will be created as well as a bad file for rows that could not be imported. I tend to create a batch file to execute so I don&#8217;t have to remember the syntax for sqlldr.</p>
<h3>If things go wrong</h3>
<p>As stated above, I&#8217;ve had problems with date formatting before when importing. I&#8217;ve also come across issues with field terminations. By default CSV exports tend to be terminated by a comma (,) but I tend to use a semi colon (;) I&#8217;ve had less problems using this method.</p>
]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/oracle/importing-csv-data-into-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exporting/Importing Oracle Schemas</title>
		<link>http://moopoo.net/oracle/exportingimporting/</link>
		<comments>http://moopoo.net/oracle/exportingimporting/#comments</comments>
		<pubDate>Thu, 02 Aug 2007 10:47:03 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://moopoo.net/blog/uncategorized/exportingimporting/</guid>
		<description><![CDATA[I originally found this information on a post at TechTarget, I wanted to reference the commands here in case the original article disappears. The original article is a lot more in depth and includes different scenarios, I recommend you read this before you start. Exporting an Oracle schema exp user@server file=user_a.dmp log=user_a.log owner=a Importing an [...]]]></description>
			<content:encoded><![CDATA[<p>I originally found this information on a post at <a href="http://searchoracle.techtarget.com/originalContent/0,289142,sid41_gci905149,00.html?Exclusive=True" title="Full article on TechTarget (Link opens in a new window)" target="_blank">TechTarget</a>, I wanted to reference the commands here in case the original article disappears. The original article is a lot more in depth and includes different scenarios, I recommend you read this before you start. <a href="http://searchoracle.techtarget.com/originalContent/0,289142,sid41_gci905149,00.html?Exclusive=True" title="Full article on TechTarget (Link opens in a new window)" target="_blank"><br />
</a></p>
<h2>Exporting an Oracle schema</h2>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">exp user<span style="color: #33cc33;">@</span>server file=user_a.dmp log=user_a.log owner=a</pre></div></div>

<h2>Importing an Oracle schema</h2>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">imp user<span style="color: #33cc33;">@</span>server file=user_a.dmp log=imp.log fromuser=a touser=b</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/oracle/exportingimporting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

