<?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>MinhTech.com &#187; Oracle</title> <atom:link href="http://minhtech.com/category/oracle/feed/" rel="self" type="application/rss+xml" /><link>http://minhtech.com</link> <description>Yet another technology tutorial blog.</description> <lastBuildDate>Fri, 16 Dec 2011 13:45:47 +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>Oracle 11g Memory Max Target ORA-27103</title><link>http://minhtech.com/oracle/oracle-11g-memory-max-target-ora-27103/</link> <comments>http://minhtech.com/oracle/oracle-11g-memory-max-target-ora-27103/#comments</comments> <pubDate>Sat, 19 Sep 2009 17:46:06 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Oracle]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=680</guid> <description><![CDATA[Here is how to increase the Oracle 11g memory target parameters to more than 3 GB on 64-bit Linux.]]></description> <content:encoded><![CDATA[<p>Here is how to increase the Oracle 11g memory target parameters to more than 3 GB on 64-bit Linux.</p><h3>Ever Helpful: ORA-03113: end-of-file on communication channel:</h3><p>When attempting to increase the memory_max_target and memory_target parameters to a value over 3 GB, an ORA-03113 is triggered.</p><p
class="code">SQL> <span
class="input">startup</span><br
/> ORA-03113: end-of-file on communication channel<br
/> Process ID: <span
class="codered">####</span><br
/> Session ID: 170 Serial number: 3</p><h3>Check the Alert Log:</h3><p
class="code">> <span
class="input">vi $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace/alert_$ORACLE_SID.log</span><br
/> ALTER DATABASE   MOUNT<br
/> Errors in file $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace/$ORACLE_SID_mman_<span
class="codered">####</span>.trc:<br
/> ORA-27103: internal error<br
/> Linux-x86_64 Error: 11: Resource temporarily unavailable<br
/> Additional information: -1<br
/> Additional information: 1<br
/> MMAN (ospid: 8169): terminating the instance due to error 27103<br
/> Instance terminated by MMAN, pid = <span
class="codered">####</span></p><h3>Download and Install the Patch:</h3><p>This is an error specific to Oracle 11g version 11.1.0.7.0 (the patched version) on 64-bit Linux. Log into Metalink, and then download and install patch number 7272646, ORA-27103 WHEN MEMORY_TARGET > 3G, with the file name p7272646_11107_Linux-x86-64.zip.</p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/oracle/oracle-11g-memory-max-target-ora-27103/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Oracle Soundex Incorrect</title><link>http://minhtech.com/oracle/oracle-soundex-incorrect-implementation/</link> <comments>http://minhtech.com/oracle/oracle-soundex-incorrect-implementation/#comments</comments> <pubDate>Sun, 05 Jul 2009 18:53:30 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Oracle]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=522</guid> <description><![CDATA[Oracle's implementation of Soundex is incorrect. Here is a correct one.]]></description> <content:encoded><![CDATA[<p>Oracle&#8217;s implementation of Soundex is incorrect.</p><h3>Test the Function:</h3><p
class="code">SQL> <span
class="input">select soundex(&#39;Ashcraft&#39;)<br
/> from dual;</span><br/><br
/> A226</p><p>Ashcraft should return A261 and not A226.</p><h3>Create the Function:</h3><p
class="code">SQL> <span
class="input">create or replace function soundexxcode (character varchar2) return number is<br
/> &#160;&#160;&#160;v_digit number(1,0);<br
/> begin<br
/> &#160;&#160;&#160;case<br
/> &#160;&#160;&#160;&#160;&#160;&#160;when character in (&#39;B&#39;, &#39;F&#39;, &#39;P&#39;, &#39;V&#39;) then v_digit := 1;<br
/> &#160;&#160;&#160;&#160;&#160;&#160;when character in (&#39;C&#39;, &#39;G&#39;, &#39;J&#39;, &#39;K&#39;, &#39;Q&#39;, &#39;S&#39;, &#39;X&#39;, &#39;Z&#39;) then v_digit := 2;<br
/> &#160;&#160;&#160;&#160;&#160;&#160;when character in (&#39;D&#39;, &#39;T&#39;) then v_digit := 3;<br
/> &#160;&#160;&#160;&#160;&#160;&#160;when character in (&#39;L&#39;) then v_digit := 4;<br
/> &#160;&#160;&#160;&#160;&#160;&#160;when character in (&#39;M&#39;, &#39;N&#39;) then v_digit := 5;<br
/> &#160;&#160;&#160;&#160;&#160;&#160;when character in (&#39;R&#39;) then v_digit := 6;<br
/> &#160;&#160;&#160;&#160;&#160;&#160;when character in (&#39;H&#39;, &#39;W&#39;) then v_digit := 0;<br
/> &#160;&#160;&#160;&#160;&#160;&#160;else v_digit := NULL;<br
/> &#160;&#160;&#160;end case;<br/><br
/> &#160;&#160;&#160;return v_digit;<br
/> end soundexxcode;<br
/> /</span><br/><br
/> Function created.<br/><br
/> SQL> <span
class="input">create or replace function soundexx (string varchar2) return varchar2 is<br
/> &#160;&#160;&#160;v_digit number(1, 0);<br
/> &#160;&#160;&#160;v_digit_last number(1, 0);<br
/> &#160;&#160;&#160;v_soundex varchar2(64);<br
/> &#160;&#160;&#160;v_string varchar2(64);<br
/> begin<br
/> &#160;&#160;&#160;v_string := upper(string);<br
/> &#160;&#160;&#160;v_soundex := substr(v_string, 1, 1);<br
/> &#160;&#160;&#160;v_digit_last := soundexxcode(v_soundex);<br/><br
/> &#160;&#160;&#160;for i in 1 .. length(v_string) loop<br
/> &#160;&#160;&#160;&#160;&#160;&#160;v_digit := soundexxcode(substr(v_string, i, 1));<br/><br
/> &#160;&#160;&#160;&#160;&#160;&#160;if v_digit > 0 And v_digit <> nvl(v_digit_last, 0) then<br
/> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;v_soundex := v_soundex || v_digit;<br
/> &#160;&#160;&#160;&#160;&#160;&#160;end if;<br/><br
/> &#160;&#160;&#160;&#160;&#160;&#160;if nvl(v_digit, 0) <> 0 then<br
/> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;v_digit_last := v_digit;<br
/> &#160;&#160;&#160;&#160;&#160;&#160;end if;<br
/> &#160;&#160;&#160;end loop;<br/><br
/> &#160;&#160;&#160;return rpad(v_soundex, 4, &#39;0&#39;);<br
/> end soundexx;<br
/> /</span><br/><br
/> Function created.</p><h3>Test the New Function:</h3><p
class="code">SQL> <span
class="input">select soundexx(&#39;Ashcraft&#39;)<br
/> from dual;</span><br/><br
/> A261</p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/oracle/oracle-soundex-incorrect-implementation/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Oracle PL/SQL is_numeric Function</title><link>http://minhtech.com/oracle/oracle-is_numeric-function/</link> <comments>http://minhtech.com/oracle/oracle-is_numeric-function/#comments</comments> <pubDate>Wed, 29 Apr 2009 18:00:08 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Oracle]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=496</guid> <description><![CDATA[Here is an is_numeric function for Oracle PL/SQL.]]></description> <content:encoded><![CDATA[<p>Here is an is_numeric function for Oracle PL/SQL.</p><h3>Create the Function:</h3><p
class="code">SQL> <span
class="input">create or replace function is_numeric (v_value varchar2) return boolean is<br
/> &#160;&#160;&#160;v_data number;<br
/> begin<br
/> &#160;&#160;&#160;v_data := to_number(v_value);<br
/> &#160;&#160;&#160;return true;<br/><br
/> exception<br
/> &#160;&#160;&#160;when others then<br
/> &#160;&#160;&#160;&#160;&#160;&#160;return false;<br
/> end is_numeric;<br
/> /</span><br/><br
/> Function created.</p><h3>Test the New Function:</h3><p
class="code">SQL> <span
class="input">set serveroutput on<br/><br
/> begin<br
/> &#160;&#160;&#160;if is_numeric(&#39;123&#39;) = true then<br
/> &#160;&#160;&#160;&#160;&#160;&#160;dbms_output.put_line (&#39;True&#39;);<br
/> &#160;&#160;&#160;else<br
/> &#160;&#160;&#160;&#160;&#160;&#160;dbms_output.put_line (&#39;False&#39;);<br
/> &#160;&#160;&#160;end if;<br/><br
/> &#160;&#160;&#160;if is_numeric(123) = true then<br
/> &#160;&#160;&#160;&#160;&#160;&#160;dbms_output.put_line (&#39;True&#39;);<br
/> &#160;&#160;&#160;else<br
/> &#160;&#160;&#160;&#160;&#160;&#160;dbms_output.put_line (&#39;False&#39;);<br
/> &#160;&#160;&#160;end if;<br/><br
/> &#160;&#160;&#160;if is_numeric(&#39;AAA&#39;) = true then<br
/> &#160;&#160;&#160;&#160;&#160;&#160;dbms_output.put_line (&#39;True&#39;);<br
/> &#160;&#160;&#160;else<br
/> &#160;&#160;&#160;&#160;&#160;&#160;dbms_output.put_line (&#39;False&#39;);<br
/> &#160;&#160;&#160;end if;<br
/> end;<br
/> /</span><br/><br
/> True<br
/> True<br
/> False<br/><br
/> PL/SQL procedure successfully completed.</p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/oracle/oracle-is_numeric-function/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Load EBCDIC in Oracle SQLLDR</title><link>http://minhtech.com/featuredtutorial/convertupload-ebcdic-with-oracle-sql-loader/</link> <comments>http://minhtech.com/featuredtutorial/convertupload-ebcdic-with-oracle-sql-loader/#comments</comments> <pubDate>Thu, 15 Jan 2009 19:07:31 +0000</pubDate> <dc:creator>Minh</dc:creator> <category><![CDATA[Featured Tutorial]]></category> <category><![CDATA[Oracle]]></category> <guid
isPermaLink="false">http://minhtech.com/?p=307</guid> <description><![CDATA[Here is a simple way to convert data from IBM Extended Binary Coded Decimal Interchange Code, EBCDIC, format and upload into Oracle.]]></description> <content:encoded><![CDATA[<p>Here is a simple way to convert data from IBM Extended Binary Coded Decimal Interchange Code, EBCDIC, format and upload into Oracle.</p><h3>Analyze EBCDIC File:</h3><p>Suppose we have a file in EBCDIC format with the following field name, offset, size, and type elements:</p><p
class="code">field1 0 10 ebcdic string(10)<br
/> field2 10 5 packed decimal(5)<br
/> field3 15 1 ebcdic string(1)</p><h3>Next, Create an Oracle Table:</h3><p
class="code">SQL> <span
class="input">create table <span
class="codered">ebcdic_table</span><br
/> (<br
/> &#160;&#160;&#160;field1 varchar2(10)<br
/> &#160;&#160;&#160;field2 number(9)<br
/> &#160;&#160;&#160;field3 varchar2(1)<br
/> );</span></p><p>Note the numeric field length.  Each byte of a packed decimal contains two digits. So &#8220;field2&#8243; is 5 * 2 = 10 = 9 digits plus the symbol. Use 5 if the numeric field is not a packed decimal.</p><h3>Create SQL Loader Control File:</h3><p
class="code">> <span
class="input">vi sqlldr.ctl</span><br
/> LOAD DATA CHARACTERSET WE8EBCDIC500<br
/> INFILE &#39;<span
class="codered">/home/mnguyen/filename</span>&#39; &#34;fix <span
class="codered">16</span>&#34;<br
/> APPEND INTO TABLE <span
class="codered">MNGUYEN.EBCDIC_TABLE</span><br
/> (<br
/> &#160;&#160;&#160;FIELD1 position(1:10) char,<br
/> &#160;&#160;&#160;FIELD2 position(11:15) decimal,<br
/> &#160;&#160;&#160;FIELD3 position(16:16) char<br
/> )<br/><br
/> > <span
class="input">sqlldr <span
class="codered">mnguyen</span> control=sqlldr.ctl log=sqlldr.log</span></p><p>It is super easy because Oracle handles the conversion via its built-in SQL Loader tool. Use the WE8EBCDIC500 character set and specify the correct record length (i.e. &#8220;fix #&#8221;) if an ASCII newline character is not used in the EBCDIC data. Use the &#8220;decimal external&#8221; data type if the numeric field is not a packed decimal.</p> ]]></content:encoded> <wfw:commentRss>http://minhtech.com/featuredtutorial/convertupload-ebcdic-with-oracle-sql-loader/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
