<?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>Amardeep Sidhu&#039;s Oracle blog &#187; Oracle Tips</title>
	<atom:link href="http://amardeepsidhu.com/blog/category/oracle-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://amardeepsidhu.com/blog</link>
	<description>Little bit of fun with Oracle</description>
	<lastBuildDate>Thu, 22 Dec 2011 05:59:25 +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>DBA_MVIEW_COMMENTS view in 10g</title>
		<link>http://amardeepsidhu.com/blog/2008/07/21/dba_mview_comments-view-in-10g/</link>
		<comments>http://amardeepsidhu.com/blog/2008/07/21/dba_mview_comments-view-in-10g/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 01:58:32 +0000</pubDate>
		<dc:creator>Sidhu</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>
		<category><![CDATA[dba_mview_comments]]></category>
		<category><![CDATA[mviews comments]]></category>

		<guid isPermaLink="false">http://amardeepsidhu.com/blog/?p=92</guid>
		<description><![CDATA[Our application (3 tier, Front end Forms10g and back end 10gR2) provides user with a front end to refresh the mviews. That form has 2 columns showing mview name and the comment against it. Recently i saw that while opening this front end ORA-01403 NO DATA FOUND was being raised. I opened the fmb and [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2008/07/21/dba_mview_comments-view-in-10g/' addthis:title='DBA_MVIEW_COMMENTS view in 10g '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Our application (3 tier, Front end Forms10g and back end 10gR2) provides user with a front end to refresh the mviews. That form has 2 columns showing mview name and the comment against it. Recently i saw that while opening this front end ORA-01403 NO DATA FOUND was being raised.</p>
<p>I opened the fmb and found that it was populating comments from DBA_TAB_COMMENTS. In 10g the comments against mviews are stored in DBA_MVIEW_COMMENTS unlike till 9i where it was in ALL_TAB_COMMENTS. So there was a little modification required.</p>
<p>BTW if you try to comment on the table (which is created with MVIEW) it won&#8217;t allow you to do so and instead raise ORA-12098: cannot comment on the materialized view.</p>
<p>So may be that little change needs to be done !</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2008/07/21/dba_mview_comments-view-in-10g/' addthis:title='DBA_MVIEW_COMMENTS view in 10g '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://amardeepsidhu.com/blog/2008/07/21/dba_mview_comments-view-in-10g/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import and default values for columns</title>
		<link>http://amardeepsidhu.com/blog/2008/05/10/import-and-default-values-for-columns/</link>
		<comments>http://amardeepsidhu.com/blog/2008/05/10/import-and-default-values-for-columns/#comments</comments>
		<pubDate>Sat, 10 May 2008 09:17:59 +0000</pubDate>
		<dc:creator>Sidhu</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>
		<category><![CDATA[columns]]></category>
		<category><![CDATA[default values]]></category>
		<category><![CDATA[import]]></category>

		<guid isPermaLink="false">http://amardeepsidhu.com/blog/?p=78</guid>
		<description><![CDATA[I had got an export of a database and had to import it to a new database. The only difference was that in new database few of the large tables were partitioned. So instead of partitioning it after the import, i thought about pre-creating the tables (with partitioning) and then run import with ignore=Y . [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2008/05/10/import-and-default-values-for-columns/' addthis:title='Import and default values for columns '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>I had got an export of a database and had to import it to a new database. The only difference was that in new database few of the large tables were partitioned. So instead of partitioning it after the import, i thought about pre-creating the tables (with partitioning) and then run import with ignore=Y . Everything went fine. But later on the front end application gave some error and we came to know that default values for columns in some tables were not set.  I did some googling and didn&#8217;t find much. Then i <a href="http://forums.oracle.com/forums/message.jspa?messageID=25113" target="_blank">posted</a> the same to OTN forums and came to know that if the table pre-exists, import doesn&#8217;t take care of default values of columns. Metalink note <a href="https://metalink.oracle.com/metalink/plsql/f?p=130:14:4379750739032245945::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,224727.1,1,1,1,helvetica" target="_blank">224727.1</a> discusses this. So if you are pre-creating the tables and there are some default values for any columns, set it manually, don&#8217;t rely on import for this. Same is true for impdp as well.</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2008/05/10/import-and-default-values-for-columns/' addthis:title='Import and default values for columns '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://amardeepsidhu.com/blog/2008/05/10/import-and-default-values-for-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unxutils for Windows</title>
		<link>http://amardeepsidhu.com/blog/2008/04/10/unxutils-for-windows/</link>
		<comments>http://amardeepsidhu.com/blog/2008/04/10/unxutils-for-windows/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 16:27:25 +0000</pubDate>
		<dc:creator>Sidhu</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>
		<category><![CDATA[Unix/Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Unxutils]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://amardeepsidhu.com/blog/?p=73</guid>
		<description><![CDATA[If you are used to work in Unix enviroment and then sometime, in between have to sit on Windows and tail -f alert_DB.log, its a real pain. There is a small bundle of utilities, called Unxutils which can make you feel at home in Windows too. These are the exe&#8217;s of all major commands in [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2008/04/10/unxutils-for-windows/' addthis:title='Unxutils for Windows '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<div id="1el8" class="ArwC7c ckChnd">
<div>If you are used to work in Unix enviroment and then sometime, in between have to sit on Windows and tail -f alert_DB.log, its a real pain. There is a small bundle of utilities, called <a href="http://unxutils.sourceforge.net/" target="_blank">Unxutils</a> which can make you feel at home in Windows too. These are the exe&#8217;s of all major commands in Unix like more, less, ls, grep etc&#8230;</div>
<div>
</div>
<div></div>
<div>To use it just download the zip file from the link above, extract it to some folder and add the path of exe&#8217;s to your Windows PATH. Restart your machine and you are done.</div>
<div>Happy more&#8217;ing&#8230;less&#8217;ing&#8230;</div>
</div>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2008/04/10/unxutils-for-windows/' addthis:title='Unxutils for Windows '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://amardeepsidhu.com/blog/2008/04/10/unxutils-for-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORA-03113 Refresh of a mview in Oracle 10g</title>
		<link>http://amardeepsidhu.com/blog/2008/01/03/ora-03113-refresh-of-a-mview-in-oracle-10g/</link>
		<comments>http://amardeepsidhu.com/blog/2008/01/03/ora-03113-refresh-of-a-mview-in-oracle-10g/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 02:03:00 +0000</pubDate>
		<dc:creator>Sidhu</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[mview refresh]]></category>
		<category><![CDATA[ora-03113]]></category>

		<guid isPermaLink="false">http://amardeepsidhu.com/blog/?p=46</guid>
		<description><![CDATA[At my workplace we were facing a problem with refresh of a mview. Say it was created in schema of user1 but when I tried to refresh it from user2 it would give ORA-03113: end-of-file on communication channel. Then we raised a SR and have been following up with Oracle support for long but it [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2008/01/03/ora-03113-refresh-of-a-mview-in-oracle-10g/' addthis:title='ORA-03113 Refresh of a mview in Oracle 10g '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>At my workplace we were facing a problem with refresh of a mview. Say it was created in schema of user1 but when I tried to refresh it from user2 it would give <span style="font-style: italic">ORA-03113: end-of-file on communication channel. </span>Then we raised a SR and have been following up with Oracle support for long but it was not getting anywhere. Yesterday that guy seemed to have reached some point. The mviews that we have created and are having problem with refresh are created on top of both local &amp; remote objects and he said that up to 11gr2 there is no possibility of creating mviews on both local and remote objects. I did validate this thing. All the mviews failing to refresh are created on top of both local &amp; remote objects. But again from the owner the refresh is fine but from another user it gives problem. By the way that guy hinted at <a href="https://metalink.oracle.com/metalink/plsql/f?p=130:15:3284197721413823598::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,4084125,1,1,1,helvetica">bug 4084125</a> and also suggested a work around. I haven&#8217;t tried that yet. Will try and update about the results.</p>
<p>Sidhu</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2008/01/03/ora-03113-refresh-of-a-mview-in-oracle-10g/' addthis:title='ORA-03113 Refresh of a mview in Oracle 10g '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://amardeepsidhu.com/blog/2008/01/03/ora-03113-refresh-of-a-mview-in-oracle-10g/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing a full database&#8230;</title>
		<link>http://amardeepsidhu.com/blog/2007/08/18/importing-a-full-database/</link>
		<comments>http://amardeepsidhu.com/blog/2007/08/18/importing-a-full-database/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 13:21:00 +0000</pubDate>
		<dc:creator>Sidhu</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>
		<category><![CDATA[import/export]]></category>
		<category><![CDATA[ora-01435]]></category>

		<guid isPermaLink="false">http://amardeepsidhu.com/blog/?p=35</guid>
		<description><![CDATA[Many times, we are required to restore a database from an export dmp file. Its a simple task but sometimes there are some issues left like invalid objects or some objects missing, in the newly created database. Following steps, followed in order can help in creating an error free database: Create a blank database: The [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/08/18/importing-a-full-database/' addthis:title='Importing a full database&#8230; '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Many times, we are required to restore a database from an export dmp file. Its a simple task but sometimes there are some issues left like invalid objects or some objects missing, in the newly created database. Following steps, followed in order can help in creating an error free database:</p>
<ol>
<li><span style="font-weight: bold;">Create a blank database:</span><span style="font-weight: bold;"> </span>The very first step is to create a blank database which is to be used as the target database. That can be done using <span style="font-style: italic;">Database Configuration Assistant. </span><span>(In last step of the DBCA, change redo log file sizes to 500 MB each (or some appropriate values depdening upon the size of the databaes), as during import, lot of redo will be generated, so large redo size helps in that scenario)<br />
</span><span style="font-style: italic;"><br />
</span></li>
<li><span style="font-weight: bold;">Extract DDLs and create tablespaces: </span><span>Now run the import with <span style="font-style: italic;">show=Y </span>option and create a log of all DDL statements. The main things to be looked for in the log are DDLs to create tablespaces and DB links. You may need to change the create tablespace statements according to the version of the Oracle you are using. If you have the export taken in an older version, where dictionary tablespaces were being used, you will need to change the statements accordingly, to create locally managed tablespaces.<br />
(If you have the dmp file in compressed (.Z) format check <a href="http://amardeepsidhu.com/blog/2007/06/06/import-export-fromto-compressed-files-directly">here</a>, to run the import directly from compressed file)</p>
<p></span></li>
<li><span><span style="font-weight: bold;">Adjust the size of SYSTEM, TEMP, USERS and UNDO: </span>As SYSTEM, TEMP,  USERS and UNDO tablespaces will get created with the database itself, so you can alter the sizes as per the sizes in the old database.
<p></span></li>
<li><span><span style="font-weight: bold;">Edit tnsnames.ora and create dblinks: </span><span>Now edit tnsnames.ora to include all the databases used in the db links and create db links using the statements from DDL log.
<p></span></span></li>
<li><span><span><span style="font-weight: bold;">Run the import: </span><span>Finally, run the import with <span style="font-style: italic;">FULL=Y</span> and <em>IGNORE=Y</em> options and after the import finishes, look for any errors in the log. At last, compile all the invalid objects in the database (<a href="http://philly.astroboy.fr/index.php?page=oracle/misc" target="_blank">Here</a> is the link to a script to compile all the invalid objects). (If the import terminates with ORA-01435, then have a look at <a href="http://amardeepsidhu.com/blog/2007/07/14/import-ora-01435-user-does-not-exist">this post</a>.)</span></span></span></li>
</ol>
<p>To read about all the options with <span style="font-style: italic;">imp</span> have a look at <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/exp_imp.htm#i1023560">Original Import &amp; Export</a><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/exp_imp.htm#i1023560"> Utilities</a> chapter  of <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/toc.htm">Oracle Utilities guide</a>.</p>
<p>Sidhu</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/08/18/importing-a-full-database/' addthis:title='Importing a full database&#8230; '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://amardeepsidhu.com/blog/2007/08/18/importing-a-full-database/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Moving datafiles,control files and log files &#8211; Part 1</title>
		<link>http://amardeepsidhu.com/blog/2007/07/21/moving-datafilescontrol-files-and-log-files-1/</link>
		<comments>http://amardeepsidhu.com/blog/2007/07/21/moving-datafilescontrol-files-and-log-files-1/#comments</comments>
		<pubDate>Sat, 21 Jul 2007 08:14:00 +0000</pubDate>
		<dc:creator>Sidhu</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>
		<category><![CDATA[datafiles]]></category>
		<category><![CDATA[tablespaces]]></category>

		<guid isPermaLink="false">http://amardeepsidhu.com/blog/?p=29</guid>
		<description><![CDATA[Many times you need to move datafiles from one location to another. The simplest approach for this is to take the tablespace offline, copy the datafiles to new location, rename the files with alter database rename file (Except that you dont have to move the SYSTEM and UNDO tablespace, as you can&#8217;t take SYSTEM tablespace [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/07/21/moving-datafilescontrol-files-and-log-files-1/' addthis:title='Moving datafiles,control files and log files &#8211; Part 1 '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Many times you need to move datafiles from one location to another. The simplest approach for this is to take the tablespace offline, copy the datafiles to new location, rename the files with <em>alter database rename file</em> (Except that you dont have to move the SYSTEM and UNDO tablespace, as you can&#8217;t take SYSTEM tablespace offline)</p>
<pre class="brush: css; title: ; notranslate">

SYS@orcl AS SYSDBA&gt; alter tablespace system offline;
alter tablespace system offline
*
ERROR at line 1:
ORA-01541: system tablespace cannot be brought offline; shut down if necessary

SYS@orcl AS SYSDBA&gt;
</pre>
<p>Well lets try moving USERS tablespace.</p>
<pre class="brush: css; title: ; notranslate">

SYS@orcl AS SYSDBA&gt; column file_name format a50

SYS@orcl AS SYSDBA&gt; set lines 100
SYS@orcl AS SYSDBA&gt; select file_name,tablespace_name from dba_data_files where tablespace_name='USERS';

FILE_NAME                                          TABLESPACE_NAME
-------------------------------------------------- ------------------------------
C:\ORACLE\ORCL\USERS01.DBF                         USERS

SYS@orcl AS SYSDBA&gt;</pre>
<p>The current location of the datafile is  C:\ORACLE\ORCL\. Suppose I have to move it to c:\oracle\oradata. So first lets take the tablespace offline</p>
<pre class="brush: css; title: ; notranslate">

SYS@orcl AS SYSDBA&gt; alter tablespace users offline;

Tablespace altered.

SYS@orcl AS SYSDBA&gt;</pre>
<p>Now copy the datafile to new location [Note the new directory should be already created]</p>
<pre class="brush: css; title: ; notranslate">

C:\oracle\ORCL&gt;copy USERS01.DBF c:\oracle\oradata
1 file(s) copied.

C:\oracle\ORCL&gt;</pre>
<p>Now make database aware of the new location of the datafile using <span style="font-style: italic">alter database rename file</span>:</p>
<pre class="brush: css; title: ; notranslate">

SYS@orcl AS SYSDBA&gt; alter database rename file 'c:\oracle\orcl\users01.dbf' to 'c:\oracle\oradata\users01.dbf';

Database altered.

SYS@orcl AS SYSDBA&gt;</pre>
<p>The last thing is to bring the tablespace online. If everything has gone rightly the message like this will appear and you can view the new location of the datafile.</p>
<pre class="brush: css; title: ; notranslate">

SYS@orcl AS SYSDBA&gt; alter tablespace users online;

Tablespace altered.

SYS@orcl AS SYSDBA&gt; select file_name,tablespace_name from dba_data_files where tablespace_name='USERS';

FILE_NAME                                          TABLESPACE_NAME
-------------------------------------------------- ------------------------------
C:\ORACLE\ORADATA\USERS01.DBF                      USERS

SYS@orcl AS SYSDBA&gt;</pre>
<p>In next post we will discuss moving datafiles, controlfiles and logfiles.</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/07/21/moving-datafilescontrol-files-and-log-files-1/' addthis:title='Moving datafiles,control files and log files &#8211; Part 1 '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://amardeepsidhu.com/blog/2007/07/21/moving-datafilescontrol-files-and-log-files-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import ORA-01435: user does not exist&#8230;</title>
		<link>http://amardeepsidhu.com/blog/2007/07/14/import-ora-01435-user-does-not-exist/</link>
		<comments>http://amardeepsidhu.com/blog/2007/07/14/import-ora-01435-user-does-not-exist/#comments</comments>
		<pubDate>Sat, 14 Jul 2007 03:59:00 +0000</pubDate>
		<dc:creator>Sidhu</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>

		<guid isPermaLink="false">http://amardeepsidhu.com/blog/?p=27</guid>
		<description><![CDATA[One may encounter this error while importing from a dmp file from older versions of Oracle. Genereally this error is caused by some statement like alter session set current_schema=scott; And the simple reason is that the user scott doesn&#8217;t exist. Yesterday I came across this error. And the reason was that user was not created. [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/07/14/import-ora-01435-user-does-not-exist/' addthis:title='Import ORA-01435: user does not exist&#8230; '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>One may encounter this error while importing from a dmp file from older versions of Oracle. Genereally this error is caused by some statement like <span style="font-style: italic;">alter session set current_schema=scott; </span>And the simple reason is that the user <span style="font-style: italic;">scott</span> doesn&#8217;t exist. Yesterday I came across this error. And the reason was that user was not created. As in case of import we generally create tablespaces first (by creating the DDL using option show=Y) but creation of users is done by import itself. In older versions of Oracle, the temp tablespaces were no different from other tablespaces. But in newer versions temp tablespaces are different. So in dmp files from thoese older versions <span style="font-style: italic;">create user </span>statements are written like <span style="font-style: italic;">create user t1 identified by t1 default tablespace temp temporary tablespace temp. </span>This thing worked fine in older versions but in newer versions we cannot specify the TEMP tablespace as the default tablespace for a user. So the statement create <span style="font-style: italic;">user t2 identified by t2 default tablespace temp temporary tablespace temp</span> throws <span style="font-style: italic;">ORA-12910: cannot specify temporary tablespace as default tablespace. </span>In such cases the users (for which default statement is specified as TEMP) have to be created manually by specifying the appropriate tablespace as default tablespace and then the import should be run with ignore=Y.</p>
<p>Sidhu</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/07/14/import-ora-01435-user-does-not-exist/' addthis:title='Import ORA-01435: user does not exist&#8230; '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://amardeepsidhu.com/blog/2007/07/14/import-ora-01435-user-does-not-exist/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shell script to spool a no of tables into .xls files&#8230;</title>
		<link>http://amardeepsidhu.com/blog/2007/06/26/shell-script-to-spool-a-no-of-tables-into-xls-files/</link>
		<comments>http://amardeepsidhu.com/blog/2007/06/26/shell-script-to-spool-a-no-of-tables-into-xls-files/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 17:08:00 +0000</pubDate>
		<dc:creator>Sidhu</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://amardeepsidhu.com/blog/?p=25</guid>
		<description><![CDATA[On OTN someone asked a question that how to spool data from a table into a xls file. Spooling a single table I discussed in one of the previous posts. We can use the same approach to spool data from more than 1 table also. Well here I will do it through a shell script [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/06/26/shell-script-to-spool-a-no-of-tables-into-xls-files/' addthis:title='Shell script to spool a no of tables into .xls files&#8230; '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>On OTN someone asked <a href="http://forums.oracle.com/forums/thread.jspa?threadID=523835&amp;tstart=50">a question</a> that how to spool data from a table into a xls file. Spooling a single table I discussed in one of the <a href="http://amardeepsidhu.com/blog/2007/06/16/spool-to-a-xls-excel-file">previous posts</a>. We can use the same approach to spool data from more than 1 table also. Well here I will do it through a shell script and assume that you have a text file having list of tables to be spooled (Even if you don&#8217;t have one, it can be easily made by spooling the names of tables into a simple text file) Here is the shell script that you can use to spool data to various xls files, table wise.</p>
<pre class="brush: css; title: ; notranslate">cat list.txt | while read a
do
echo &quot;spooling $a&quot;
sqlplus username/password@string &amp;lt;&amp;lt;EOF
set feed off markup html on spool on
spool /home/oracle/$a.xls
select * from $a;
spool off
set markup html off spool off
EOF
done
</pre>
<p>I didn&#8217;t see any work around for Windoze as SQLPLUS &lt;&lt; EOF thing doesn&#8217;t seem to work in Windows. Will try to find some alternative. If you come across something, do let me know.</p>
<p>Sidhu</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/06/26/shell-script-to-spool-a-no-of-tables-into-xls-files/' addthis:title='Shell script to spool a no of tables into .xls files&#8230; '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://amardeepsidhu.com/blog/2007/06/26/shell-script-to-spool-a-no-of-tables-into-xls-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Is multiplication faster than division ?</title>
		<link>http://amardeepsidhu.com/blog/2007/06/18/is-multiplication-faster-than-division/</link>
		<comments>http://amardeepsidhu.com/blog/2007/06/18/is-multiplication-faster-than-division/#comments</comments>
		<pubDate>Mon, 18 Jun 2007 17:32:00 +0000</pubDate>
		<dc:creator>Sidhu</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>

		<guid isPermaLink="false">http://amardeepsidhu.com/blog/?p=23</guid>
		<description><![CDATA[An interesing post by Laurent. Check out http://laurentschneider.com/wordpress/2007/06/to-divide-or-to-multiply.html My findings on 10gR2 on Windoze XP SQL> var z numberSQL> var y numberSQL> exec :z := power(2,102)*2e-31; PL/SQL procedure successfully completed. SQL> exec :y := 1e125; PL/SQL procedure successfully completed. SQL> set timi onSQL> exec while (:y>1e-125) loop :y:=:y/:z; end loop PL/SQL procedure successfully completed. Elapsed: [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/06/18/is-multiplication-faster-than-division/' addthis:title='Is multiplication faster than division ? '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>An interesing post by Laurent. Check out <a href="http://laurentschneider.com/wordpress/2007/06/to-divide-or-to-multiply.html">http://laurentschneider.com/wordpress/2007/06/to-divide-or-to-multiply.html</a></p>
<p>My findings on 10gR2 on Windoze XP
<pre>SQL> var z numberSQL> var y numberSQL> exec :z := power(2,102)*2e-31;

PL/SQL procedure successfully completed.

SQL> exec :y := 1e125;

PL/SQL procedure successfully completed.

SQL> set timi onSQL> exec while (:y>1e-125) loop :y:=:y/:z; end loop

PL/SQL procedure successfully completed.

<b style="color: rgb(255, 0, 0);">Elapsed: 00:00:00.10</b>SQL> set timi offSQL> print y

      Y----------9.988E-126

SQL> exec :z := power(2,-104)*2e31;

PL/SQL procedure successfully completed.

SQL> exec :y := 1e125;

PL/SQL procedure successfully completed.

SQL> set timi onSQL> exec while (:y>1e-125) loop :y:=:y*:z; end loop

PL/SQL procedure successfully completed.

<b style="color: rgb(255, 0, 0);">Elapsed: 00:00:00.04</b>SQL> set timi offSQL> print y

      Y----------9.988E-126

SQL></pre>
<p>Sidhu</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/06/18/is-multiplication-faster-than-division/' addthis:title='Is multiplication faster than division ? '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://amardeepsidhu.com/blog/2007/06/18/is-multiplication-faster-than-division/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spool to a .xls (excel) file&#8230;</title>
		<link>http://amardeepsidhu.com/blog/2007/06/16/spool-to-a-xls-excel-file/</link>
		<comments>http://amardeepsidhu.com/blog/2007/06/16/spool-to-a-xls-excel-file/#comments</comments>
		<pubDate>Fri, 15 Jun 2007 18:44:00 +0000</pubDate>
		<dc:creator>Sidhu</dc:creator>
				<category><![CDATA[Oracle Tips]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[spool to excel]]></category>

		<guid isPermaLink="false">http://amardeepsidhu.com/blog/?p=22</guid>
		<description><![CDATA[A small tip, I read on OTN about spooling to a .xls (excel) file: It goes like this And the xls it makes shows up like: Sidhu<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/06/16/spool-to-a-xls-excel-file/' addthis:title='Spool to a .xls (excel) file&#8230; '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>A small tip, I read on <a href="http://forums.oracle.com/forums/thread.jspa?messageID=1849526">OTN</a> about spooling to a .xls (excel) file:</p>
<p>It goes like this</p>
<pre class="brush: css; title: ; notranslate">set feed off markup html on
spool onspool c:\salgrade.xls
select * from salgrade;
spool offset markup html off
spool off</pre>
<p>And the xls it makes shows up like:</p>
<pre><a href="http://bp2.blogger.com/_cX21i_8-MT4/RnLaSNXaVrI/AAAAAAAAACM/nxm6jQbYTak/s1600-h/xls.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5076359736360326834" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer" src="http://bp2.blogger.com/_cX21i_8-MT4/RnLaSNXaVrI/AAAAAAAAACM/nxm6jQbYTak/s320/xls.JPG" border="0" alt="" /></a></pre>
<p><img src="file:///C:/DOCUME%7E1/Amardeep/LOCALS%7E1/Temp/moz-screenshot.jpg" alt="" />Sidhu</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://amardeepsidhu.com/blog/2007/06/16/spool-to-a-xls-excel-file/' addthis:title='Spool to a .xls (excel) file&#8230; '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://amardeepsidhu.com/blog/2007/06/16/spool-to-a-xls-excel-file/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

