<?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>Arejae.Com &#187; Database</title>
	<atom:link href="http://www.arejae.com/blogv2/category/database/feed" rel="self" type="application/rss+xml" />
	<link>http://www.arejae.com/blogv2</link>
	<description>me,myself,english and programming..</description>
	<lastBuildDate>Thu, 22 Jul 2010 07:19:27 +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>Oracle High Availability JDBC Connection String</title>
		<link>http://www.arejae.com/blogv2/oracle-high-availability-jdbc-connection-string.html</link>
		<comments>http://www.arejae.com/blogv2/oracle-high-availability-jdbc-connection-string.html#comments</comments>
		<pubDate>Sat, 10 Apr 2010 04:38:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://www.arejae.com/blogv2/oracle-high-availability-jdbc-connection-string.html</guid>
		<description><![CDATA[I&#8217;m finally successfully configure my apps to connect to Oracle RAC. As for my reference later, here is the connection string. (DESCRIPTION_LIST= (FAILOVER=true) (LOAD_BALANCE=true) (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=server1) (PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=orcl)) ) (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=server2) (PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=orcl)) ) ) JDBC URL will be something like this jdbc:oracle:thin:@(DESCRIPTION_LIST&#8230;)]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m finally successfully configure my apps to connect to Oracle RAC.</p>
<p>As for my reference later, here is the connection string.</p>
<p>(DESCRIPTION_LIST=<br />
 (FAILOVER=true)<br />
 (LOAD_BALANCE=true)<br />
 (DESCRIPTION=<br />
 (ADDRESS= (PROTOCOL=TCP) (HOST=server1) (PORT=1521))<br />
 (CONNECT_DATA=<br />
 (SERVICE_NAME=orcl))<br />
 )<br />
 (DESCRIPTION=<br />
 (ADDRESS= (PROTOCOL=TCP) (HOST=server2) (PORT=1521))<br />
 (CONNECT_DATA=<br />
 (SERVICE_NAME=orcl))<br />
 )<br />
)</p>
<p>JDBC URL will be something like this</p>
<p>jdbc:oracle:thin:@(DESCRIPTION_LIST&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arejae.com/blogv2/oracle-high-availability-jdbc-connection-string.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error: ORA-01033 ORACLE initialization or shutdown in progress</title>
		<link>http://www.arejae.com/blogv2/error-ora-01033-oracle-initialization-or-shutdown-in-progress.html</link>
		<comments>http://www.arejae.com/blogv2/error-ora-01033-oracle-initialization-or-shutdown-in-progress.html#comments</comments>
		<pubDate>Thu, 11 Mar 2010 04:07:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL/ETL]]></category>

		<guid isPermaLink="false">http://www.arejae.com/blogv2/error-ora-01033-oracle-initialization-or-shutdown-in-progress.html</guid>
		<description><![CDATA[For some reason which I don&#8217;t know why, my oracle give me that kind of error. Googling give me for below solution. And here I post for my future reference, and also for you if you got this same problem . Run this command first in console. sqlplus /nolog And after that, use these commands [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason which I don&#8217;t know why, my oracle give me that kind of error.</p>
<p>Googling give me for below solution. And here I post for my future reference, and also for you if you got this same problem . <img src='http://www.arejae.com/blogv2/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Run this command first in console.</p>
<p><strong>sqlplus /nolog</strong></p>
<p>And after that, use these commands :</p>
<p>SQL&gt; connect / as sysdba<br />
Connected.<br />
SQL&gt; shutdown abort<br />
ORACLE instance shut down<br />
SQL&gt; startup nomount<br />
ORACLE instance started.<br />
SQL&gt; alter database mount;<br />
SQL&gt; alter database open;</p>
<p><span id="more-681"></span>
<p>If you got below error</p>
<p>ERROR at line 1:<br />
ORA-01113: file 14 needs media recovery<br />
ORA-01110: data file 14:<br />
&#8216;C:\APP\ADMINISTRATOR\ORADATA\EKPTGHQ1\DATAFILE\IDX02.DBF&#8217;</p>
<p>SQL&gt; alter database recover datafile <strong>14</strong> ;</p>
<p>repeat recover datafile step if you have a few corrupted data file.</p>
<p>SQL&gt; shutdown</p>
<p>SQL&gt; startup</p>
<p>That is. Till then&#8230;</p>
<p>Happy SQL-ing&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arejae.com/blogv2/error-ora-01033-oracle-initialization-or-shutdown-in-progress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drop table if Exists in Oracle</title>
		<link>http://www.arejae.com/blogv2/drop-table-if-exists-in-oracle.html</link>
		<comments>http://www.arejae.com/blogv2/drop-table-if-exists-in-oracle.html#comments</comments>
		<pubDate>Tue, 02 Mar 2010 10:47:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.arejae.com/blogv2/drop-table-if-exists-in-oracle.html</guid>
		<description><![CDATA[In MySQL, we can easily drop table and check whether it is exist or not using this statement. DROP TABLE IF EXISTS MyTable In Oracle, you can&#8217;t do that. Solution that I found is to create a procedure and execute it. As for my reference and others (if any) here is the script to create [...]]]></description>
			<content:encoded><![CDATA[<p>In MySQL, we can easily drop table and check whether it is exist or not using this statement.</p>
<pre class="sql" name="code">
DROP TABLE IF EXISTS MyTable
</pre>
<p></p>
<p>In Oracle, you can&#8217;t do that.</p>
<p>Solution that I found is to create a procedure and execute it.</p>
<p>As for my reference and others (if any) here is the script to create that procedure.</p>
<p><span id="more-680"></span>
<pre class="sql" name="code">
create or replace procedure drop_table (tab_name in varchar2)
is
qry_string varchar2(4000);
cnt number;
begin
select count(1) into cnt from user_tables where lower(table_name) = lower(tab_name);

if cnt &gt; 0 then
qry_string := 'DROP TABLE ' || tab_name;
begin
EXECUTE IMMEDIATE qry_string;
exception
when others then
dbms_output.put_line('Error occured while dropping ' || sqlerrm);
end;
else
dbms_output.put_line('TABLE ' || tab_name ||' does not exist');
end if;
end;
</pre>
<p></p>
<p>to drop your table, just execute this statement.<br />
exec drop_table(&#8216;MyTable&#8217;);</p>
<p>So, you can safely execute below statement without error if the table is not exist.<br />
exec drop_table(&#8216;MyTable&#8217;);<br />
create table MyTable as select * from MyOtherTable;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arejae.com/blogv2/drop-table-if-exists-in-oracle.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My solution for ORA-12560: TNS:protocol adapter error</title>
		<link>http://www.arejae.com/blogv2/my-solution-for-ora-12560-tnsprotocol-adapter-error.html</link>
		<comments>http://www.arejae.com/blogv2/my-solution-for-ora-12560-tnsprotocol-adapter-error.html#comments</comments>
		<pubDate>Sat, 19 Sep 2009 05:13:08 +0000</pubDate>
		<dc:creator>arejae</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.arejae.com/blog/my-solution-for-ora-12560-tnsprotocol-adapter-error.html</guid>
		<description><![CDATA[Everything goes fine with my Oracle 11G but out of the sudden it give me this error. ORA-12560: TNS:protocol adapter error. I then look at the Event Viewer logs and give me another error message. ACTION : &#8216;CONNECT&#8217; DATABASE USER: &#8216;/&#8217; PRIVILEGE : SYSDBA CLIENT USER: NT AUTHORITY\SYSTEM CLIENT TERMINAL: MYAREJAE STATUS: 0 . Googling [...]]]></description>
			<content:encoded><![CDATA[<p>Everything goes fine with my Oracle 11G but out of the sudden it give me this error. <strong>ORA-12560: TNS:protocol adapter error.</strong></p>
<p>I then look at the Event Viewer logs and give me another error message.</p>
<p>ACTION : &#8216;CONNECT&#8217; DATABASE USER: &#8216;/&#8217; PRIVILEGE : SYSDBA CLIENT USER: NT AUTHORITY\SYSTEM CLIENT TERMINAL: MYAREJAE STATUS: 0 .</p>
<p>Googling around give me below solution. Just run the command and everything goes back to normal.</p>
<p><strong>oradim -edit -sid orcl -startmode auto</strong></p>
<p>Depending on the situation, I think maybe this solution is not necessary true for everyone but at least it works for me. <img src='http://www.arejae.com/blogv2/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Till then&#8230;</p>
<p>Happy Coding&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arejae.com/blogv2/my-solution-for-ora-12560-tnsprotocol-adapter-error.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check for NULL Value in Oracle and MySQL</title>
		<link>http://www.arejae.com/blogv2/check-for-null-value-in-oracle-and-mysql.html</link>
		<comments>http://www.arejae.com/blogv2/check-for-null-value-in-oracle-and-mysql.html#comments</comments>
		<pubDate>Thu, 05 Mar 2009 03:24:13 +0000</pubDate>
		<dc:creator>arejae</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL/ETL]]></category>

		<guid isPermaLink="false">http://www.arejae.com/blog/check-for-null-value-in-oracle-and-mysql.html</guid>
		<description><![CDATA[If you are familiar with MS-SQL, you will know that you can use ISNULL function to convert NULL value to something else. In below case, it is an example how to convert NULL value to zero. ISNULL(myField,0) In Oracle, you can use NVL to get the same result. NVL(myField,0) Same thing for MySQL, you can [...]]]></description>
			<content:encoded><![CDATA[<p>If you are familiar with MS-SQL, you will know that you can use ISNULL function to convert NULL value to something else. In below case, it is an example how to convert NULL value to zero.</p>
<p><strong>ISNULL(myField,0)</strong></p>
<p>In Oracle, you can use NVL to get the same result.</p>
<p><strong>NVL(myField,0)</strong></p>
<p>Same thing for MySQL, you can use IFNULL to get the same result.</p>
<p><strong>IFNULL(myField,0)</strong></p>
<p>&nbsp;</p>
<p>Don&#8217;t under estimate with this function. I&#8217;m debugging my program for almost 1 hours just to notice that some values in my Oracle tables having NULL values and causing errors while inserting to MySQL tables.</p>
<p>That&#8217;s my quick update for today. Till then&#8230;Happy Coding. <img src='http://www.arejae.com/blogv2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.arejae.com/blogv2/check-for-null-value-in-oracle-and-mysql.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
