<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Oracle</title><link>http://oracle-db-faq.blogspot.com/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogspot/OracleFAQ" /><description>Oracle frequently asked questions. Errors in oracle, oracle interview questions. Oracle queries questions, oracle errors questions, oracle questions.</description><language>en</language><managingEditor>noreply@blogger.com (Sachin)</managingEditor><lastBuildDate>Thu, 21 Apr 2011 22:14:31 PDT</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">12</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">25</openSearch:itemsPerPage><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="blogspot/oraclefaq" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><itunes:explicit>no</itunes:explicit><itunes:subtitle>Oracle frequently asked questions. Errors in oracle, oracle interview questions. Oracle queries questions, oracle errors questions, oracle questions.</itunes:subtitle><item><title>IMP: ORA-12560 TNS:protocol adapter error</title><link>http://oracle-db-faq.blogspot.com/2009/02/imp-ora-12560-tnsprotocol-adapter-error.html</link><category>Oracle Errors</category><author>noreply@blogger.com (Sachin)</author><pubDate>Mon, 15 Jun 2009 09:45:11 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-4831049914811709337</guid><description>&lt;br&gt;&lt;font size=2 face="sans-serif"&gt;&lt;b&gt;Problem: &lt;/b&gt;I am trying to import a schema dump on Oracle XE database on my Windows XP machine. Here is the command I am using &lt;/font&gt; &lt;br&gt; &lt;br&gt;&lt;font size=2 face="sans-serif"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;i&gt;imp myuser file=mydump.dmp fromuser=myuser touser=mynewuser&lt;/i&gt;&lt;/font&gt; &lt;br&gt; &lt;br&gt;&lt;font size=2 face="sans-serif"&gt;I didn't get any problem when I use the same command for importing another schema on local database. Not sure why I am getting this error now.&lt;/font&gt; &lt;br&gt; &lt;br&gt;&lt;font size=2 color=red face="sans-serif"&gt;&lt;b&gt;IMP: ORA-12560 TNS:protocol adapter error&lt;/b&gt;&lt;/font&gt; &lt;br&gt; &lt;br&gt;&lt;font size=2 face="sans-serif"&gt;&lt;b&gt;Solution: &lt;/b&gt;You need to specify the user and database name when you have more then one&lt;b&gt; &lt;/b&gt;databases&lt;b&gt;. &lt;/b&gt;So here is the command format you need to use for import.&lt;/font&gt; &lt;br&gt; &lt;br&gt;&lt;font size=2 face="sans-serif"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;i&gt;imp myuser/mypass@MyDB file=mydump.dmp fromuser=myuser touser=mynewuser&lt;/i&gt;&lt;/font&gt; &lt;br&gt; &lt;br&gt;&lt;font size=2 face="sans-serif"&gt;You can try below command if you dont like to specify the password on the command itself.&lt;/font&gt; &lt;br&gt; &lt;br&gt;&lt;font size=2 face="sans-serif"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;i&gt;imp myuser@MyDB file=mydump.dmp fromuser=myuser touser=mynewuser&lt;/i&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-4831049914811709337?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wUxtgl8kBgsSCEKLOkWp6wQQABE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wUxtgl8kBgsSCEKLOkWp6wQQABE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wUxtgl8kBgsSCEKLOkWp6wQQABE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wUxtgl8kBgsSCEKLOkWp6wQQABE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=XTI6K9fe"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=27IKXog1"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-15T09:45:11.925-07:00</app:edited></item><item><title>Alternative for sending Multiple values to Oracle IN Clause</title><link>http://oracle-db-faq.blogspot.com/2008/08/alternative-for-sending-multiple-values.html</link><category>Developer</category><author>noreply@blogger.com (Sachin)</author><pubDate>Fri, 13 Feb 2009 22:10:15 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-4755271009082155295</guid><description>&lt;div&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;Usually when connecting we have a query which has a&lt;br /&gt;IN clause and it requires multiple values then you may need to go for creating a&lt;br /&gt;String of all values and pass it.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;Solution 1: You can try INSTR function of ORACLE&lt;br /&gt;which can check for a value inside the comma separated String&lt;br /&gt;value.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Arial;font-size:85%;"  &gt;SELECT myid&lt;br /&gt; FROM&lt;br /&gt;mytable&lt;br /&gt; WHERE INSTR(stringOfnumbers,','|| myid ||',') !=&lt;br /&gt;0;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;/span&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;This solution may not be faster as it will not use&lt;br /&gt;index for the myid column.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;Solution 2: Create a PL/SQL function  (say&lt;br /&gt;str2table ) which converts comma separated String value to a table.&lt;br /&gt;To store&lt;br /&gt;the data in a table we need to create a data type as table type and then use the&lt;br /&gt;same type as return type for our function.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;/span&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 0, 255);"&gt;create or replace type&lt;br /&gt;myTableType as table of number;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Arial;font-size:85%;"  &gt;create or replace function str2tbl(&lt;br /&gt;p_str in varchar2 ) return myTableType&lt;br /&gt; &lt;br /&gt;as&lt;br /&gt;       l_str   long default&lt;br /&gt;p_str || ',';&lt;br /&gt;     &lt;br /&gt;l_n      &lt;br /&gt;number;&lt;br /&gt;       l_data  &lt;br /&gt;myTableType := myTabletype();&lt;br /&gt; &lt;br /&gt;begin&lt;br /&gt;     &lt;br /&gt;loop&lt;br /&gt;           l_n&lt;br /&gt;:= instr( l_str, ','&lt;br /&gt;);&lt;br /&gt;           exit&lt;br /&gt;when (nvl(l_n,0) =&lt;br /&gt;0);&lt;br /&gt;        &lt;br /&gt;l_data.extend;&lt;br /&gt;        &lt;br /&gt;l_data( l_data.count ) :=&lt;br /&gt;ltrim(rtrim(substr(l_str,1,l_n-1)));&lt;br /&gt;        &lt;br /&gt;l_str := substr( l_str, l_n+1 );&lt;br /&gt;      end&lt;br /&gt;loop;&lt;br /&gt;      return l_data;&lt;br /&gt;&lt;br /&gt;end;&lt;/span&gt;&lt;/div&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Here is how you can use above function &lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;select * from all_users&lt;br /&gt;   where&lt;br /&gt;user_id in ( select *&lt;br /&gt;     from THE ( select cast(&lt;br /&gt;str2tbl( '1, 3, 5, 7, 99' ) as mytableType ) from dual )&lt;br /&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="display: none;"&gt;&lt;br /&gt;passing values to IN clause, JDBC values to IN clause, passing number to IN clause, list of numbers in IN clause&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-4755271009082155295?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_Eh2JI-hIKN1gbMUvBS7667Fkpo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_Eh2JI-hIKN1gbMUvBS7667Fkpo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_Eh2JI-hIKN1gbMUvBS7667Fkpo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_Eh2JI-hIKN1gbMUvBS7667Fkpo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=1LFrRqdV"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=bwFM7P7u"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-13T22:10:15.958-08:00</app:edited></item><item><title>Oracle function to covert comma separated value to table</title><link>http://oracle-db-faq.blogspot.com/2008/08/oracle-function-to-covert-comma.html</link><category>Developer</category><author>noreply@blogger.com (Sachin)</author><pubDate>Mon, 01 Sep 2008 21:39:08 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-8799060888829990651</guid><description>&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;Usually when connecting we have a query which has a IN clause and it requires multiple values then you may need to go for creating a String of all values and pass it.&lt;/FONT&gt;&lt;PRE&gt;&lt;FONT face=Arial size=2&gt;Solution 1: You can try INSTR function of ORACLE which can check for a value inside the comma separated String value.&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;SELECT myid&lt;br /&gt;  FROM mytable&lt;br /&gt;  WHERE INSTR(stringOfnumbers,','|| myid ||',') != 0;&lt;br /&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial size=2&gt;This solution may not be faster as it will not use index for the myid column.&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;Solution 2: Create a PL/SQL function  (say str2table ) which converts comma separated String value to a table.&lt;/FONT&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial size=2&gt;To store the data in a table we need to create a data type as table type and then use the same type as return type for our function.&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;create or replace type myTableType as table of number;&lt;/FONT&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;create or replace function str2tbl( p_str in varchar2 ) return myTableType&lt;br /&gt;    as&lt;br /&gt;        l_str   long default p_str || ',';&lt;br /&gt;        l_n        number;&lt;br /&gt;        l_data    myTableType := myTabletype();&lt;br /&gt;    begin&lt;br /&gt;        loop&lt;br /&gt;            l_n := instr( l_str, ',' );&lt;br /&gt;            exit when (nvl(l_n,0) = 0);&lt;br /&gt;           l_data.extend;&lt;br /&gt;           l_data( l_data.count ) := ltrim(rtrim(substr(l_str,1,l_n-1)));&lt;br /&gt;           l_str := substr( l_str, l_n+1 );&lt;br /&gt;       end loop;&lt;br /&gt;       return l_data;&lt;br /&gt;   end;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial size=2&gt;Here is how you can use above function&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial color=#0000ff size=2&gt;select * from all_users&lt;br /&gt;    where user_id in ( select *&lt;br /&gt;      from THE ( select cast( str2tbl( '1, 3, 5, 7, 99' ) as mytableType ) from dual ) )&lt;/FONT&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial size=2&gt; &lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style='display:none'&gt;&lt;br /&gt;CSV to table, oracle CSV to table, oracle String to table, oracle function to convert string csv to table&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-8799060888829990651?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/N3rdK-LLSrwneiALhF8XB585kus/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N3rdK-LLSrwneiALhF8XB585kus/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/N3rdK-LLSrwneiALhF8XB585kus/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N3rdK-LLSrwneiALhF8XB585kus/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=XRU8JZwi"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=TqpPKFXI"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-01T21:39:08.916-07:00</app:edited></item><item><title>Why can't I create a PreparedStatement that does select * from tab where id in (?, ?, ?, ...)?</title><link>http://oracle-db-faq.blogspot.com/2008/08/why-cant-i-create-preparedstatement.html</link><category>JDBC</category><author>noreply@blogger.com (Sachin)</author><pubDate>Thu, 14 Aug 2008 14:18:10 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-8682296632071037594</guid><description>&lt;DIV&gt;The problem is that the RDBMS does not support bind parameters for the  elements in the &lt;TT&gt;IN&lt;/TT&gt; clause. This is a limitation of the database, not  the driver.&lt;/DIV&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-8682296632071037594?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cXTAG7hv1WtLCttk7-N8ZQi0dQM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cXTAG7hv1WtLCttk7-N8ZQi0dQM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cXTAG7hv1WtLCttk7-N8ZQi0dQM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cXTAG7hv1WtLCttk7-N8ZQi0dQM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=6n6GlBh5"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=tCSd0Jy4"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-14T14:18:10.299-07:00</app:edited></item><item><title>What is JDBC?</title><link>http://oracle-db-faq.blogspot.com/2008/08/what-is-jdbc.html</link><category>JDBC</category><author>noreply@blogger.com (Sachin)</author><pubDate>Thu, 14 Aug 2008 14:17:55 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-2298820445651172150</guid><description>&lt;DIV&gt;JDBC technology is an API that lets you access virtually any tabular data  source from the Java programming language. It provides cross-DBMS connectivity  to a wide range of SQL databases, and now, with the new JDBC API, it also  provides access to other tabular data sources, such as spreadsheets or flat  files.&lt;/DIV&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-2298820445651172150?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/l-6ARkKOMjx5IGoLbHx30mle0j4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l-6ARkKOMjx5IGoLbHx30mle0j4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/l-6ARkKOMjx5IGoLbHx30mle0j4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l-6ARkKOMjx5IGoLbHx30mle0j4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=GalspVMS"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=WM0eNvyo"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-14T14:17:55.284-07:00</app:edited></item><item><title>What is the difference between Primary key, Unique key, Sorrogate key?</title><link>http://oracle-db-faq.blogspot.com/2008/07/what-is-difference-between-primary-key.html</link><category>Basics</category><author>noreply@blogger.com (Sachin)</author><pubDate>Sun, 13 Jul 2008 08:56:49 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-360183961924200450</guid><description>&lt;span id="sort1"&gt;&lt;span class="tdvamseel"&gt;Primary Key: A column in a table whose values uniquely identify the rows in the table. A primary key value cannot be NULL. &lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;span id="sort1"&gt;&lt;span class="tdvamseel"&gt;- There is only one &lt;/span&gt;&lt;/span&gt;&lt;span id="sort1"&gt;&lt;span class="tdvamseel"&gt;Primary key for a table.&lt;br&gt; - Primary key can not contain null value.&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;span id="sort1"&gt;&lt;span class="tdvamseel"&gt;&amp;nbsp;&lt;br&gt;Unique Key: Unique Keys are used to uniquely identify each row in an Oracle table. There can be one and only one row for each unique key value. &lt;br&gt;- There may be more then 1 unique keys for a table.&lt;br&gt;-&amp;nbsp; It can contain a null value.&lt;br&gt;&lt;br&gt;Surrogate Key: A system generated key with no business value. Usually implemented with database generated sequences.&lt;br&gt; &lt;/span&gt;&lt;/span&gt;&lt;span id="sort1"&gt;&lt;span class="tdvamseel"&gt;&lt;/span&gt;&lt;/span&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-360183961924200450?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HiMbWXDd-H1I_gi9ctWIwRvpqQQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HiMbWXDd-H1I_gi9ctWIwRvpqQQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HiMbWXDd-H1I_gi9ctWIwRvpqQQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HiMbWXDd-H1I_gi9ctWIwRvpqQQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=ro6y8wRJ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=CEMfo3hm"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-13T08:56:49.485-07:00</app:edited></item><item><title>What is the difference between cold and hot backup?</title><link>http://oracle-db-faq.blogspot.com/2008/07/what-is-difference-between-cold-and-hot.html</link><category>Administration</category><author>noreply@blogger.com (Sachin)</author><pubDate>Sun, 13 Jul 2008 08:50:11 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-5154966085364499309</guid><description>&lt;span id="sort1"&gt;&lt;span class="tdvamseel"&gt;Cold Backup- We can take the Backup while DB(eg. Oracle) is down.&lt;br&gt;Hot Backup-We can&amp;nbsp;take the Backup&amp;nbsp;while DB(eg. Oracle) is running.&lt;br&gt;&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;&lt;br&gt; &lt;u&gt;Cold backup&lt;/u&gt; is a physical backup. During a cold backup the database is closed and not available to users.&amp;nbsp; All files of the database are copied (image copy).&amp;nbsp; The datafiles do not change during the copy so the database is in sync upon restore. &lt;br&gt;&lt;strong&gt;&lt;br&gt;Used when:&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;&lt;br&gt;- Service level allows for some down time for backup&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;&lt;br&gt; &lt;u&gt;&lt;br&gt;Hot backup&lt;/u&gt; is a physical backup.&amp;nbsp; In a hot backup the database remains open and available to users. All files of the database are copied (image copy).&amp;nbsp; There may be changes to the database as the copy is made and so all log files of changes being made during the backup must be saved too.&amp;nbsp; Upon a restore, the changes in the log files are reapplied to bring the database in sync. &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;&lt;br&gt;&lt;br&gt;Used when:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;&lt;br&gt;- A full backup of a database is needed &lt;br&gt;- Service level allows no down time for the backup&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-5154966085364499309?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OQtMy23mZiKKKf3A2cKp1U_FINs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OQtMy23mZiKKKf3A2cKp1U_FINs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OQtMy23mZiKKKf3A2cKp1U_FINs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OQtMy23mZiKKKf3A2cKp1U_FINs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=U6pmc937"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=HzcjZoEo"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-13T08:50:11.586-07:00</app:edited></item><item><title>What is Life of SQL Statement?</title><link>http://oracle-db-faq.blogspot.com/2008/07/what-is-life-of-sql-statement.html</link><category>Tuning</category><author>noreply@blogger.com (Sachin)</author><pubDate>Sun, 13 Jul 2008 08:49:59 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-7009902279219880986</guid><description>&lt;span id="sort1"&gt;&lt;span class="tdvamseel"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;Step 1: &lt;em&gt;Oracle Create a Cursor&lt;/em&gt;&lt;br&gt;&lt;/strong&gt;For every SQL, first a cursor is created (cursor creation can occur implicitly, or explicitly by declaring a cursor). &lt;p&gt; &lt;strong&gt;Step 2: &lt;em&gt;Oracle Parse SQL Statement&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;A SQL statement is parsed only if an identical SQL statement does not exist in the library cache (shared pool-System Global Area). In this case, a new shared SQL area is allocated and the statement is parsed (&lt;strong&gt;hard parse&lt;/strong&gt;), otherwise existing stored information in library cache is used (&lt;strong&gt;soft parse&lt;/strong&gt;).&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Hard Parsing&lt;/strong&gt; is the process of&lt;/p&gt; &lt;ul&gt;&lt;li&gt;  Translating a SQL statement and verify the syntax. &lt;/li&gt;&lt;li&gt;  Checking data dictionary to check table and column definitions &lt;/li&gt;&lt;li&gt;  Acquiring parse locks on required objects so that their definitions do not change during the statementâ€™s parsing &lt;/li&gt; &lt;li&gt;  Checking privileges to access referenced schema objects &lt;/li&gt;&lt;li&gt;  Determining the optimal execution plan for the statement &lt;/li&gt;&lt;li&gt;  Loading it into a shared SQL area &lt;/li&gt;&lt;li&gt;  For distributed statements, routing all or part of the statement to remote nodes that contain referenced data &lt;/li&gt; &lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Stage 3: &lt;em&gt;Describe Results (FOR SELECT STATEMENT ONLY) &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The describe phase is used to determine the characteristics (datatypes, lengths, and names) of a queryâ€™s result.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Stage 4:&lt;/strong&gt; &lt;em&gt;&lt;strong&gt;Defining Output (FOR SELECT STATEMENT ONLY)&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Specify the location, size, and datatype of variables defined to receive each fetched value. Oracle performs datatype conversion if necessary.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Stage 5: &lt;em&gt;Bind Any Variables&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;At this point, Oracle needs values for any variables listed in the statement;&lt;/p&gt;&lt;p&gt;for example, In SQL statement â€œSELECT * FROM EMP WHERE EMPNO = p_empnoâ€, Oracle needs a value for p_empno.&lt;/p&gt; &lt;p&gt;This process is called binding variables. A program must specify the location (memory address) where the value can be found.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Stage 6: &lt;em&gt;Execute the Statement&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;At last, Statement is executed.&lt;/p&gt; &lt;p&gt;Oracle checks if the data it needs for the query are already in the buffer cache. If not, it reads the data off the disk into the buffer cache.&lt;br&gt;The record(s) that are changed are locked i.e. in case of DELETE or UPDATE statement. Also, before and after images describing the changes are written to the redo log buffer and the rollback segments. The original block receives a pointer to the rollback segment. Then, the data is changed.&lt;/p&gt;&lt;p&gt;For some statements you can specify a number of executions to be performed. This is called array processing. Given n number of executions, the bind and define locations are assumed to be the beginning of an array of size n.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Stage 7: &lt;em&gt;Parallelize the Statement&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;When using the parallel query option, Oracle can parallelize queries and certain DDL operations. Parallelization causes multiple query servers to perform the work of the query so that the query can complete faster.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Stage 8: &lt;em&gt;Fetch Rows of a Query Result (FOR SELECT STATEMENT ONLY)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Rows are selected and ordered (if requested by the query), and each successive fetch retrieves another row of the result, until the last row has been fetched&lt;/p&gt;&lt;/span&gt;&lt;/span&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-7009902279219880986?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8FuQtAQdOUyccF_t820_10yqwIQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8FuQtAQdOUyccF_t820_10yqwIQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8FuQtAQdOUyccF_t820_10yqwIQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8FuQtAQdOUyccF_t820_10yqwIQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=C6xL6UTO"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=VJRz46m5"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-13T08:49:59.151-07:00</app:edited></item><item><title>How to compile Invalid Objects in Oracle?</title><link>http://oracle-db-faq.blogspot.com/2008/05/how-to-compile-invalid-objects-in.html</link><category>Compilation</category><author>noreply@blogger.com (Sachin)</author><pubDate>Fri, 11 Jul 2008 11:53:36 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-3246022806882448459</guid><description>There are five ways to recompile invalid objects in Oracle.&lt;br /&gt;&lt;br /&gt;1. DBMS_DDL.ALTER_COMPILE&lt;br /&gt;2. DBMS_UTILITY.COMPILE_SCHEMA &lt;br /&gt;3. UTL_RECOMP&lt;br /&gt;4. UTLRP.SQL - Located: $ORACLE_HOME/rdbms/admin&lt;br /&gt;5. Manually Recompile&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-3246022806882448459?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/K0a1pPrHV5T2wcmZYS1mKcQ3eYE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K0a1pPrHV5T2wcmZYS1mKcQ3eYE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/K0a1pPrHV5T2wcmZYS1mKcQ3eYE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K0a1pPrHV5T2wcmZYS1mKcQ3eYE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=DF4oC8SP"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=XznX8UZU"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-11T11:53:36.748-07:00</app:edited></item><item><title>Oracle Frequently Asked Questions</title><link>http://oracle-db-faq.blogspot.com/2008/05/oracle-frequently-asked-questions.html</link><author>noreply@blogger.com (Sachin)</author><pubDate>Sat, 10 May 2008 19:58:36 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-6997901740365958529</guid><description>&lt;a href="http://oracle-db-faq.blogspot.com/2008/05/how-to-compile-invalid-objects-in.html"&gt;How to compile Invalid Objects in Oracle?&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://oracle-db-faq.blogspot.com/2008/05/how-to-flush-all-data-in-temp.html"&gt;How to flush all data in temp tablespace?&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://oracle-db-faq.blogspot.com/2008/05/oracle-temporary-tablespace-is-full-how.html"&gt;Oracle temporary tablespace is full. How do we flush it and create more space?&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-6997901740365958529?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/T9cpjjl4veQ0B9awpUyrtAjQ1hk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T9cpjjl4veQ0B9awpUyrtAjQ1hk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/T9cpjjl4veQ0B9awpUyrtAjQ1hk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T9cpjjl4veQ0B9awpUyrtAjQ1hk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=lhBpL2Se"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=Q5CKgfcn"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-10T19:58:36.820-07:00</app:edited></item><item><title>How to flush all data in temp tablespace?</title><link>http://oracle-db-faq.blogspot.com/2008/05/how-to-flush-all-data-in-temp.html</link><category>Oracle Errors</category><author>noreply@blogger.com (Sachin)</author><pubDate>Fri, 11 Jul 2008 11:53:18 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-5518336110511483889</guid><description>Following steps will flush all the data .&lt;br /&gt;&lt;br /&gt;1. Create a new temporary tablespace (with the different name e.g. tmp_temp) in the database &lt;br /&gt;&lt;br /&gt;2. Now alter all users to use that temporary tablespace (tmp_temp). Use ALTER USER statement.&lt;br /&gt;&lt;br /&gt;3. Now drop the earlier temporary tablesapace. &lt;br /&gt;&lt;br /&gt;4. Now recreate the temporary tablespace with same name as step 3.&lt;br /&gt;5. Now alter all users to use temporary tablespace. Use ALTER USER statement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-5518336110511483889?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Q9cNHncasWXmOYrvK7HQWSQ8eFg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q9cNHncasWXmOYrvK7HQWSQ8eFg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Q9cNHncasWXmOYrvK7HQWSQ8eFg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q9cNHncasWXmOYrvK7HQWSQ8eFg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=fAovnNpw"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=Ht9u9HB5"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-11T11:53:18.400-07:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Oracle temporary tablespace is full. How do we flush it and create more space?</title><link>http://oracle-db-faq.blogspot.com/2008/05/oracle-temporary-tablespace-is-full-how.html</link><category>Oracle Errors</category><author>noreply@blogger.com (Sachin)</author><pubDate>Fri, 11 Jul 2008 11:52:46 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-274864275272094249.post-6879851655172502923</guid><description>A "Temporary" Tablespace will likely always appear FULL. This is because in a temporary tablespace segments are not allocated, dropped, and re-allocated as they used to be. The segments are merely reused so we do not have the overhead of constant allocation/deallocation. Most of the time they will actually appear full.&lt;br /&gt;&lt;br /&gt;If you are getting failed to extend error. Then they are actually in use and can not be reused. Then we should be concerned with either of two things:&lt;br /&gt;&lt;br /&gt;1. Do we need more space on temporary tablespace?&lt;br /&gt;2. Why we are using so much space?&lt;br /&gt;&lt;br /&gt;You can use the script to find out detail on temp tablespace allocation:&lt;br /&gt;&lt;br /&gt;SELECT b.tablespace, b.segfile#, b.segblk#, b.blocks, a.sid, a.serial#,&lt;br /&gt;a.username, a.osuser, a.status&lt;br /&gt;FROM v$session a,v$sort_usage b&lt;br /&gt;WHERE a.saddr = b.session_addr&lt;br /&gt;ORDER BY b.tablespace, b.segfile#, b.segblk#, b.blocks;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/274864275272094249-6879851655172502923?l=oracle-db-faq.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/edK47EuWCxxQlUrNobEJS87rseg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/edK47EuWCxxQlUrNobEJS87rseg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/edK47EuWCxxQlUrNobEJS87rseg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/edK47EuWCxxQlUrNobEJS87rseg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=dyLmKUXB"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?a=fdGAjl7N"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/OracleFAQ?d=42" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-11T11:52:46.961-07:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><media:rating>nonadult</media:rating></channel></rss>

