<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>I Love Tips</title>
	<atom:link href="http://ilovetips.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ilovetips.wordpress.com</link>
	<description>Nice Tips &#38; Tricks made easy</description>
	<lastBuildDate>Sun, 18 May 2008 07:35:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ilovetips.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>I Love Tips</title>
		<link>http://ilovetips.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ilovetips.wordpress.com/osd.xml" title="I Love Tips" />
	<atom:link rel='hub' href='http://ilovetips.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Testing Conditions in Shell Programming</title>
		<link>http://ilovetips.wordpress.com/2008/05/18/13/</link>
		<comments>http://ilovetips.wordpress.com/2008/05/18/13/#comments</comments>
		<pubDate>Sun, 18 May 2008 07:23:44 +0000</pubDate>
		<dc:creator>Rajkiran Ghanta</dc:creator>
				<category><![CDATA[Shell Programming]]></category>
		<category><![CDATA[UNIX/LINUX]]></category>

		<guid isPermaLink="false">http://ilovetips.wordpress.com/?p=13</guid>
		<description><![CDATA[In the shell programming, conditional expressions are used for performing tests by - evaluating and comparing integers or strings - testing file attributes Testing Conditional expressions is done by using the following three different forms of syntax. test expression [ expression ] [[ expression ]] These expressions will return an exit status of 0 for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=13&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the shell programming, <span style="font-weight:bold;">conditional expressions</span> are used for performing tests by<br />
- evaluating and comparing integers or strings<br />
- testing file attributes</p>
<p>Testing Conditional expressions is done by using the following three different forms of syntax.<br />
<span style="font-weight:bold;font-style:italic;">test expression<br />
</span><span style="font-weight:bold;font-style:italic;">[ expression ]</span><br />
<span style="font-weight:bold;font-style:italic;">[[ expression ]]</span></p>
<p>These expressions will return an exit status of 0 for true and 1 for false. It is preferrable to use<span style="font-weight:bold;"> [[ ]]</span> command, as it will result in fewer syntax errors.</p>
<p>Example :<br />
To compare two integers, by checking if one is less than the other with one of the following :<br />
<span style="font-style:italic;">[[ $a gt $b ]]</span><br />
<span style="font-style:italic;"> [ $a gt $b ]</span><br />
<span style="font-style:italic;">test $a gt $b</span></p>
<p>You can also combine two or more expressions <span style="font-weight:bold;">(aka. compound expressions)</span> using  the  following operators<br />
-  Double ampersand, &amp;&amp; ( which means &#8220;AND&#8221; )<br />
-  Double Pipe,  || (which means &#8220;OR&#8221;)</p>
<p><span style="font-weight:bold;">Example :</span><br />
the syntax for for compound expressions using || is :<br />
<span style="font-style:italic;">[[ expression1 || expression2 ]]</span></p>
<p>If you would like to test student&#8217;s subject mark with minimum required mark and print pass if either of the subject is more than the required score, the sample code would be</p>
<p><span style="font-style:italic;">$[[ $SubjectA &gt; $ReqScore || $SubjectB &gt; $ReqScore ]] &amp;&amp; print &#8220;PASS&#8221;</span></p>
<p><span style="font-size:medium;"><span style="font-weight:bold;">[[ .... ]] syntax can also be used  for the following tests :<br />
</span></span><span style="font-weight:bold;">To test variables </span><span style="font-weight:bold;">with string operators</span><span style="font-weight:bold;"> </span><br />
-z true if length is zero<br />
-n will be true if the string is not zero<br />
-o will be true if option is set</p>
<p>example:<br />
if [[ -z $StringA ]]; then<br />
print &#8220;Length is zero&#8221;<br />
fi</p>
<p><span style="font-weight:bold;">To compare one string with another string</span><br />
[[ string1 = string2 ]]</p>
<p>Example :<br />
[[ $Subject = "MATH A" ]] &amp;&amp; print &#8220;Optional Subject&#8221;</p>
<p><span style="font-weight:bold;">To compare strings with String operators</span><br />
=, !=, &lt; , &gt;</p>
<p><span style="font-weight:bold;">To test files with options</span><br />
-a (file exists)<br />
-d (file is a dir)<br />
-f  (file is regular file)<br />
-r  (file readable)<br />
-w (file writable)<br />
-x (file executable)<br />
-s (file non-empty)<br />
-u (file has userID bit set)</p>
<p><span style="font-weight:bold;"> To compare files</span><br />
[[ file1 -ef file2]]  for same files<br />
[[ file1 -nt file2]] for finding new file<br />
[[ file1 -ot file2]] for finding older file</p>
<p><span style="font-weight:bold;">To compare expressions involving integers using integer operators</span><br />
-eq, -ne, -le, -ge, -gt</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ilovetips.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ilovetips.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilovetips.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilovetips.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilovetips.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilovetips.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilovetips.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilovetips.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilovetips.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilovetips.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilovetips.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilovetips.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilovetips.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilovetips.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilovetips.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilovetips.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=13&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilovetips.wordpress.com/2008/05/18/13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc284fed9314159982a504ac27804c3f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rajkiran Ghanta</media:title>
		</media:content>
	</item>
		<item>
		<title>Temporarily Temporary Tablespace</title>
		<link>http://ilovetips.wordpress.com/2008/05/10/temporarily-temporary-tablespace/</link>
		<comments>http://ilovetips.wordpress.com/2008/05/10/temporarily-temporary-tablespace/#comments</comments>
		<pubDate>Sat, 10 May 2008 15:52:50 +0000</pubDate>
		<dc:creator>Rajkiran Ghanta</dc:creator>
				<category><![CDATA[DBA]]></category>

		<guid isPermaLink="false">http://ilovetips.wordpress.com/?p=12</guid>
		<description><![CDATA[Oracle uses temporary tablespace to perform any sorting required by the queries that have clauses mainly like order by, distinct, group by, union, interset and minus. Index creation and certain correlated subqueries will also use the temporary tablespace. By default, if the temporary tablespace is not explicitly defined, oracle will use SYSTEM tablespace as the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=12&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">Oracle uses <span style="font-weight:bold;">temporary tablespace </span>to perform any sorting required by the queries that have clauses mainly like order by, distinct, group by, union, interset and minus. Index creation and certain correlated subqueries will also use the temporary tablespace.</p>
<p>By default, if the temporary tablespace is not explicitly defined, oracle will use SYSTEM tablespace as the temporary tablespace.</p>
<p>Here is an example to<span style="font-weight:bold;"> create a temporary tablespace :</span></p>
<div style="text-align:left;"><span style="font-style:italic;">SQL&gt; create temporary tablespace TEMP tempfile &#8216;/ora0001/oradata/temp_1.dbf&#8217; size 500 M </span><span style="font-style:italic;">extent management local uniform size 256k;</span></div>
<p>A temporary tablespace can be made as default temporary tablespace for all the users in the database or can be assigned to specific users exclusively as the default one.</p>
<p>To make temp tablespace as <span style="font-weight:bold;">default temporary tablespace</span> for all the users in the database :<br />
<span style="font-style:italic;">SQL&gt; alter database default temporary tablespace temp;</span></p>
<p>To <span style="font-weight:bold;">alter a user</span> (e.g.scott) to use temp tablespace as temporary tablespace :<br />
<span style="font-style:italic;">SQL&gt; alter user scott temporary tablespace temp;</span></p>
<p>To specify temporary tablespace clause while <span style="font-weight:bold;">creating a new user </span>:<br />
<span style="font-style:italic;">SQL&gt; create user john identified by changeme</span><br />
<span style="font-style:italic;">default tablespace users temporary tablespace temp1;</span></p>
<p>If you omit the TEMPORARY TABLESPACE clause, the temporary segments  default to the SYSTEM tablespace.  DBA can <span style="font-weight:bold;">resize the temporary tablespace </span>depending on the requirement for the temp space usage.</p>
<p>To resize the temp tablespace by <span style="font-weight:bold;">adding new tempfile </span>:<br />
<span style="font-style:italic;">SQL&gt; alter tablespace temp add tempfile &#8216;/ora0001/oradata/temp_2.dbf&#8217; size 512m;</span></p>
<p>To resize an <span style="font-weight:bold;">existing tempfile</span> :<br />
<span style="font-style:italic;">SQL&gt; alter database tempfile &#8216;/ora0001/oradata/temp_1.dbf&#8217; resize 1024M;</span></p>
<p>Sometimes, <span style="font-weight:bold;">shrinking a temp tablespace </span>may error out with<br />
<span style="font-style:italic;">Error: ORA 3297 : file contains </span><span style="font-style:italic;"> blocks of data beyond requested RESIZE value</span></p>
<p>In such cases, it may be advisable to create a new temp tablespace with the required temp size and drop the old one using drop tablespace command. If the old tablespace is the default temporary, reassign the new tablespace as default one before dropping the old one.</p>
<p>The command for <span style="font-weight:bold;">drop tablespace </span>is :<br />
<span style="font-style:italic;">SQL&gt; drop tablespace temp including contents and datafiles;</span></p>
<p>Normally, sort operation will be done in memory based on the <span style="font-weight:bold;">SORT_AREA_SIZE</span> parameter size in the init.ora file. Any sorts exceeding the SORT_AREA_SIZE limit will acquire temporary segments.</p>
<p>Since temporary tablespaces do not contain any permanent objects, these tablespaces <span style="font-weight:bold;">need not be backed up</span>. Infact, tempfile information is not recorded in control file and tempfiles can be recreated any time.</p>
<p>If needed, DBA can make the<span style="font-weight:bold;"> tempfile offline</span> or even can <span style="font-weight:bold;">drop the tempfile</span> as shown below :<br />
<span style="font-style:italic;">SQL&gt; alter database tempfile &#8216;/ora0001/oradata/temp1.dbf&#8217; offline;</span></p>
<p><span style="font-style:italic;">SQL&gt; alter database tempfile &#8216;/ora0001/oradata/temp1.dbf&#8217; drop including datafiles;</span></p>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ilovetips.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ilovetips.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilovetips.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilovetips.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilovetips.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilovetips.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilovetips.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilovetips.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilovetips.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilovetips.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilovetips.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilovetips.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilovetips.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilovetips.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilovetips.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilovetips.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=12&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilovetips.wordpress.com/2008/05/10/temporarily-temporary-tablespace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc284fed9314159982a504ac27804c3f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rajkiran Ghanta</media:title>
		</media:content>
	</item>
		<item>
		<title>Configuration of Broadcom wireless cards for Ubuntu</title>
		<link>http://ilovetips.wordpress.com/2008/01/24/configuration-of-broadcom-wireless-cards-for-ubuntu/</link>
		<comments>http://ilovetips.wordpress.com/2008/01/24/configuration-of-broadcom-wireless-cards-for-ubuntu/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 03:22:01 +0000</pubDate>
		<dc:creator>Rajkiran Ghanta</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ilovetips.wordpress.com/2008/01/24/configuration-of-broadcom-wireless-cards-for-ubuntu/</guid>
		<description><![CDATA[Have you ever had trouble setting up your Broadcom wirless cards to work with Ubuntu? The following procedure worked perfect ( I have tried several times) for me to configure Broadcom wireless card on my old and heavy Dell Inspiron 9100 to work with Ubuntu Edgy. 1) Before you start,  get a copy of bcmwl5.inf [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=11&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have you ever had trouble setting up your Broadcom wirless cards to work with Ubuntu? The following procedure worked perfect ( I have tried several times) for<br />
me to configure Broadcom wireless card on my old and heavy Dell Inspiron 9100 to work with Ubuntu Edgy.</p>
<p>1) Before you start,  get a copy of bcmwl5.inf and bcmwl5.sys files and copy them to your desktop</p>
<p>2) Open a terminal session and enter the following commands</p>
<p>a) remove the broadcom module<br />
$sudo gedit /etc/modprobe.d/blacklist<br />
add: &#8220;blacklist bcm43xx&#8221; (no quotes) and save the file<br />
$sudo modprobe -r bcm43xx<br />
$sudo modprobe ndiswrapper</p>
<p>b) Install windows wireless drivers(ndiswrapper)</p>
<p>$sudo apt-get install ndiswrapper-utils<br />
$sudo ndiswrapper -i ~/Desktop/bcmwl5.inf<br />
$sudo ndiswrapper -m<br />
$sudo modprobe ndiswrapper</p>
<p>3) Reboot your PC and the wireless card should start working fine.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ilovetips.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ilovetips.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilovetips.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilovetips.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilovetips.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilovetips.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilovetips.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilovetips.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilovetips.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilovetips.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilovetips.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilovetips.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilovetips.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilovetips.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilovetips.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilovetips.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=11&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilovetips.wordpress.com/2008/01/24/configuration-of-broadcom-wireless-cards-for-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc284fed9314159982a504ac27804c3f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rajkiran Ghanta</media:title>
		</media:content>
	</item>
		<item>
		<title>Monitoring Temp Space Usage</title>
		<link>http://ilovetips.wordpress.com/2008/01/15/oracle/</link>
		<comments>http://ilovetips.wordpress.com/2008/01/15/oracle/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 04:38:58 +0000</pubDate>
		<dc:creator>Rajkiran Ghanta</dc:creator>
				<category><![CDATA[DBA]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The following is a very useful script to monitor temp space usage inside the database. #!/usr/bin/ksh #set up the Oracle environment. ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE ORACLE_HOME=/oracle/app/oracle/product/9.2.0; export ORACLE_HOME LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH tmp_output=/tmp/temp_usage.log script_name=${0##*/} echo &#8220;&#8221; echo &#8220;Script: $script_name&#8221; echo &#8221; started on: `date`&#8221; echo &#8221; by user: `id`&#8221; echo &#8221; on machine: `uname -n`&#8221; echo &#8220;&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=1&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following is a very useful script to monitor temp space usage inside the  database.</p>
<p><span style="color:#000099;">#!/usr/bin/ksh<br />
#set up the  Oracle environment.<br />
ORACLE_BASE=/oracle/app/oracle; export  ORACLE_BASE<br />
ORACLE_HOME=/oracle/app/oracle/product/9.2.0; export  ORACLE_HOME<br />
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH;  export<br />
LD_LIBRARY_PATH<br />
tmp_output=/tmp/temp_usage.log</span></p>
<p>script_name=${0##*/}<br />
echo  &#8220;&#8221;<br />
echo &#8220;Script: $script_name&#8221;<br />
echo &#8221; started on: `date`&#8221;<br />
echo &#8221; by  user: `id`&#8221;<br />
echo &#8221; on machine: `uname -n`&#8221;<br />
echo &#8220;&#8221;<br />
echo &#8220;This script is  designed to capture temp space usage information &#8220;<br />
echo  &#8220;&#8221;</p>
<p>${ORACLE_HOME}/bin/sqlplus -s &lt;$ORACLE_PASSWD<br />
whenever  sqlerror exit 3 rollback<br />
whenever oserror exit 4 rollback<br />
SET SERVEROUTPUT  ON<br />
SET FEEDBACK OFF<br />
insert into temp_usage<br />
select (select instance_name  from v\$instance) instance_name ,<br />
s.sid  ,<br />
s.username,<br />
u.tablespace,<br />
substr(a.sql_text, 1, 1000)  sql_text,<br />
round(((u.blocks*p.value)/1024/1024),2) size_mb ,sysdate<br />
from  v\$sort_usage u,<br />
v\$session s,<br />
v\$sqlarea a,<br />
v\$parameter p<br />
where  s.saddr = u.session_addr<br />
and a.address (+) = s.sql_address<br />
and  a.hash_value (+) = s.sql_hash_value<br />
and p.name =  &#8216;db_block_size&#8217;<br />
/<br />
exit;<br />
EOF_TEMP<br />
if [[ $? -ne 0 ]]; then<br />
echo  &#8220;*** ERROR: The ${script_name} did not complete successfully.&#8221;<br />
exit  1<br />
else<br />
echo &#8220;The ${script_name} script appears to have completed  successfully on `date`.&#8221;<br />
exit 0<br />
fi</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ilovetips.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ilovetips.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilovetips.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilovetips.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilovetips.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilovetips.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilovetips.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilovetips.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilovetips.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilovetips.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilovetips.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilovetips.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilovetips.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilovetips.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilovetips.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilovetips.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=1&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilovetips.wordpress.com/2008/01/15/oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc284fed9314159982a504ac27804c3f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rajkiran Ghanta</media:title>
		</media:content>
	</item>
		<item>
		<title>RESUMABLE</title>
		<link>http://ilovetips.wordpress.com/2008/01/11/resumable/</link>
		<comments>http://ilovetips.wordpress.com/2008/01/11/resumable/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 05:05:00 +0000</pubDate>
		<dc:creator>Rajkiran Ghanta</dc:creator>
				<category><![CDATA[DBA]]></category>

		<guid isPermaLink="false">http://ilovetips.wordpress.com/2008/01/11/resumable/</guid>
		<description><![CDATA[From 9i, you can run long running operations/processes that run out of space, using RESUME feature. Basically, the transaction runs in resumable mode and if there are any space issues, the transaction will not fail. It will be suspended until the problem is fixed and will resume automatically after the space is available. You will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=6&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>From 9i, you can run long running  operations/processes that run out of space, using RESUME feature. Basically, the transaction runs in resumable mode and if there are any space issues, the transaction will not fail. It will be suspended until the problem is fixed and will resume automatically after the space is available.</p>
<p>You will need to grant resumable to user, before the user can start a session in resumable mode</p>
<p><b>Examples:</b></p>
<p><b>Altering the session to resumable mode</b><br />
Grant RESUMABLE to user1;<br />
Alter session enable resumable timeout 3600 name &#8216;SPACE-ISSUE&#8217;;</p>
<p><b>Disabling resumable</b><br />
Alter session disable resumable;</p>
<p><b>Monitoring the suspended sessions :</b><br />
You can query dba_resumable view  to monitor any suspended transactions.</p>
<p>SELECT * FROM dba_resumable;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ilovetips.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ilovetips.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilovetips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilovetips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilovetips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilovetips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilovetips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilovetips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilovetips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilovetips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilovetips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilovetips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilovetips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilovetips.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilovetips.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilovetips.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=6&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilovetips.wordpress.com/2008/01/11/resumable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc284fed9314159982a504ac27804c3f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rajkiran Ghanta</media:title>
		</media:content>
	</item>
		<item>
		<title>Purging STATSPACK snapshots</title>
		<link>http://ilovetips.wordpress.com/2008/01/08/purging-statspack-snapshots/</link>
		<comments>http://ilovetips.wordpress.com/2008/01/08/purging-statspack-snapshots/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 07:22:00 +0000</pubDate>
		<dc:creator>Rajkiran Ghanta</dc:creator>
				<category><![CDATA[DBA]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://ilovetips.wordpress.com/2008/01/08/purging-statspack-snapshots/</guid>
		<description><![CDATA[STATSPACK provides a purge utility to remove the older snapshots. sppurge.sql script can be invoked to remove specific snapshots. You will need to specify begin and end snapid for the script or you can modify it to select all the snapids for a snap_time date range. You can setup a small batch job to run [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=5&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>STATSPACK provides a purge utility to remove the older snapshots. sppurge.sql script can be invoked to remove specific snapshots.<br />
You will need to specify begin and end snapid for the script or you can modify it to select all the snapids for a snap_time date range.<br />
You can setup a small batch job to run daily to purge the snapshots older than certain time period, to free up perfstat tablespace.</p>
<p>$ORACLE_HOME/bin/sqlplus -s &#8220;perfstat/perfstat&#8221; &lt;&lt; EOF<br />
TTITLE OFF<br />
SET HEADING OFF<br />
SET FEEDBACK OFF<br />
SET PAGES 0<br />
SET SERVEROUTPUT ON SIZE 1000000<br />
SET VERIFY OFF<br />
WHENEVER SQLERROR EXIT 8<br />
WHENEVER OSERROR EXIT 9<br />
spool $HOME/logs/sp_purge_db1.log<br />
@$HOME/scripts/statspack/sp_purge.sql<br />
commit;<br />
spool off<br />
exit;<br />
EOF<br />
if [ `wc -l ${HOME}/logs/sp_purge_db1.log  awk '{print $1}'` -gt 0 ]<br />
then<br />
/bin/mail -s &#8220;Error&#8221; email_dba &lt; ${HOME}/logs/sp_purge_db1.log<br />
fi</p>
<p>sp_purge.sql can modified to specify the required date range for the snapshots to be purged<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8212;&#8212;&#8212;-<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
column min_snap_id new_val LoSnapId<br />
column max_snap_id new_val HiSnapId<br />
select min(s.snap_id) min_snap_id, max(s.snap_id) max_snap_id<br />
from stats$snapshot s<br />
, stats$database_instance di<br />
where s.dbid = :dbid<br />
and di.dbid = :dbid<br />
and s.instance_number = :inst_num<br />
and di.instance_number = :inst_num<br />
and di.startup_time = s.startup_time<br />
and s.snap_time &lt; sysdate &#8211; 60;</p>
<p>&#8211;<br />
&#8211; Post warning</p>
<p>prompt<br />
prompt<br />
prompt Warning<br />
prompt ~~~~~~~<br />
prompt sppurge.sql deletes all snapshots ranging between the lower and<br />
prompt upper bound Snapshot Id&#8217;s specified, for the database instance<br />
prompt you are connected to.<br />
prompt<br />
prompt You may wish to export this data before continuing.<br />
prompt</p>
<p>&#8211;<br />
&#8211; Obtain snapshot ranges</p>
<p>prompt<br />
prompt Specify the Lo Snap Id and Hi Snap Id range to purge<br />
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
prompt Using &amp;&amp;LoSnapId for lower bound.<br />
prompt<br />
prompt Using &amp;&amp;HiSnapId for upper bound.</p>
<p>variable lo_snap number;<br />
variable hi_snap number;<br />
begin<br />
:lo_snap := &amp;losnapid;<br />
:hi_snap := &amp;hisnapid;<br />
end;<br />
/</p>
<p>set termout off<br />
&#8211;<br />
&#8211; Get begin and end snapshot times &#8211; these are used to delete undostat<br />
column btime new_value btime<br />
column etime new_value etime<br />
select to_char(snap_time, &#8216;YYYYMMDD HH24:MI:SS&#8217;) btime<br />
from stats$snapshot b<br />
where b.snap_id = :lo_snap<br />
and b.dbid = :dbid<br />
and b.instance_number = :inst_num;<br />
select to_char(snap_time, &#8216;YYYYMMDD HH24:MI:SS&#8217;) etime<br />
from stats$snapshot e<br />
where e.snap_id = :hi_snap<br />
and e.dbid = :dbid<br />
and e.instance_number = :inst_num;</p>
<p>variable btime varchar2(25);<br />
variable etime varchar2(25);<br />
begin<br />
:btime := &#8216;&amp;btime&#8217;;<br />
:etime := &#8216;&amp;etime&#8217;;<br />
end;<br />
/<br />
set termout on</p>
<p>set heading off</p>
<p>select &#8216;WARNING: LoSnapId or HiSnapId specified does not exist in STATS$SNAPSHOT&#8217;<br />
from dual<br />
where not exists<br />
(select null<br />
from stats$snapshot<br />
where instance_number = :inst_num<br />
and dbid = :dbid<br />
and snap_id = :lo_snap)<br />
or not exists<br />
(select null<br />
from stats$snapshot<br />
where instance_number = :inst_num<br />
and dbid = :dbid<br />
and snap_id = :hi_snap);</p>
<p>set heading on<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8212;&#8212;&#8212;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ilovetips.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ilovetips.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilovetips.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilovetips.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilovetips.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilovetips.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilovetips.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilovetips.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilovetips.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilovetips.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilovetips.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilovetips.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilovetips.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilovetips.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilovetips.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilovetips.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=5&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilovetips.wordpress.com/2008/01/08/purging-statspack-snapshots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc284fed9314159982a504ac27804c3f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rajkiran Ghanta</media:title>
		</media:content>
	</item>
		<item>
		<title>Crontab Usage</title>
		<link>http://ilovetips.wordpress.com/2007/12/23/crontab-usage/</link>
		<comments>http://ilovetips.wordpress.com/2007/12/23/crontab-usage/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 03:04:00 +0000</pubDate>
		<dc:creator>Rajkiran Ghanta</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ilovetips.wordpress.com/2007/12/23/crontab-usage/</guid>
		<description><![CDATA[crontab utility helps to set up tasks to run automatically in the background at regular intervals, as specified in the schedule. You can use cron.allow and cron.deny files under /usr/lib/cron directory to control access to the cron. crontab -e Edit crontab file, or create one if it doesn&#8217;t already exist. crontab -l Display crontab file. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=10&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:times new roman;"><span style="font-size:130%;">crontab utility helps to set up tasks to run automatically in the background at regular intervals, as specified in the schedule.<br />
You can use cron.allow and cron.deny files under /usr/lib/cron directory to control access to the cron.<br />
crontab -e Edit crontab file, or create one if it doesn&#8217;t already exist.<br />
crontab -l Display crontab file.<br />
crontab -r Remove your crontab file.<br />
crontab -v Display the last time the crontab file is edited</span></span></p>
<p>The following is the crontab file syntax<br />
* * * * * command<br />
- &#8211; - &#8211; -</p>
<p>+&#8212;&#8211; day of week (0 &#8211; 6) (Sunday=0)<br />
+&#8212;&#8212;- month (1 &#8211; 12)<br />
+&#8212;&#8212;&#8212; day of month (1 &#8211; 31)<br />
+&#8212;&#8212;&#8212;&#8211; hour (0 &#8211; 23)<br />
+&#8212;&#8212;&#8212;&#8212;- min (0 &#8211; 59)</p>
<p><span style="font-size:130%;"><b>Example<br />
</b><br />
Crontab entry for health check report that runs every night at 11.30pm</span></p>
<p>30 23 * * * /home/oracle/monitoring/health.sh &gt; /logs/health.log 2&gt;&amp;1</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ilovetips.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ilovetips.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilovetips.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilovetips.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilovetips.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilovetips.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilovetips.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilovetips.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilovetips.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilovetips.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilovetips.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilovetips.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilovetips.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilovetips.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilovetips.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilovetips.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=10&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilovetips.wordpress.com/2007/12/23/crontab-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc284fed9314159982a504ac27804c3f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rajkiran Ghanta</media:title>
		</media:content>
	</item>
		<item>
		<title>READ access to everyone on Trace files</title>
		<link>http://ilovetips.wordpress.com/2007/11/27/read-access-to-everyone-on-trace-files/</link>
		<comments>http://ilovetips.wordpress.com/2007/11/27/read-access-to-everyone-on-trace-files/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 02:07:00 +0000</pubDate>
		<dc:creator>Rajkiran Ghanta</dc:creator>
				<category><![CDATA[DBA]]></category>

		<guid isPermaLink="false">http://ilovetips.wordpress.com/2007/11/27/read-access-to-everyone-on-trace-files/</guid>
		<description><![CDATA[By default, non-dba users will not have access to the tracefiles generated under user_dump_dest directory. It may not be compliant with audit procedures, if we give access to these files in production. But, atleast in development, it will be very helpful for the developers, if they can see their tracefiles generated. DBA will have to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=4&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:times new roman;"><span style="font-size:130%;">By default, non-dba users will not have access to the tracefiles generated under user_dump_dest directory. It may not be compliant with audit procedures, if we give access to these files in production. But, atleast in development, it will be very helpful for the developers, if they can see their tracefiles generated.</span></span></p>
<p>DBA will have to modify permissions on these tracefiles, inorder to give the developers access to read. Or, the better approach may be by setting the following undocumented parameter in the init.ora file and restarting the database instance.</p>
<p><span style="font-weight:bold;">_trace_files_public = true</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ilovetips.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ilovetips.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilovetips.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilovetips.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilovetips.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilovetips.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilovetips.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilovetips.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilovetips.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilovetips.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilovetips.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilovetips.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilovetips.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilovetips.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilovetips.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilovetips.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=4&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilovetips.wordpress.com/2007/11/27/read-access-to-everyone-on-trace-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc284fed9314159982a504ac27804c3f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rajkiran Ghanta</media:title>
		</media:content>
	</item>
		<item>
		<title>Reading/Writing files using PL/SQL</title>
		<link>http://ilovetips.wordpress.com/2007/11/24/readingwriting-files-using-plsql/</link>
		<comments>http://ilovetips.wordpress.com/2007/11/24/readingwriting-files-using-plsql/#comments</comments>
		<pubDate>Sat, 24 Nov 2007 02:24:00 +0000</pubDate>
		<dc:creator>Rajkiran Ghanta</dc:creator>
				<category><![CDATA[PL/SQL]]></category>

		<guid isPermaLink="false">http://ilovetips.wordpress.com/2007/11/24/readingwriting-files-using-plsql/</guid>
		<description><![CDATA[Prior to Oracle 9i R2, each directory to be accessed by utl_file must be specified in the init.ora parameter and the database needs to be restarted inorder to make the directory effective. From 9i R2, instead of specifying directory in the in the init.ora file, a directory object can be used. Directory object can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=9&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:times new roman;font-size:130%;">Prior to Oracle 9i R2, each directory to be accessed by utl_file must be specified in the init.ora parameter and the database needs to be restarted inorder to make the directory effective.<br />
From 9i R2, instead of specifying directory in the in the init.ora file, a directory object can be used.<br />
Directory object can be created using the create directory command. You need to check with your admin to make sure the directory exists and has correct permissions at the os level. Also, DBA user can control the permissions on the directory object by granting read and write privileges only to the required users.</span></p>
<p><span style="font-family:times new roman;"><span style="font-size:130%;"><b>Examples:</b></span></span></p>
<p><b>1) Using directory specified in the utl_file_dir parameter in init.ora file<br />
</b>Add the directory e.g. /u01/utilout to the utl_file_dir parameter in the init.ora file and bounce the database.<br />
Then use the directory to read and write the files using UTL_FILE package.<br />
<span style="color:#000099;"></span><br />
<span style="font-family:times new roman;"><span style="font-size:130%;"><span style="color:#000099;">DECLARE<br />
v_out_file UTIL_FILE.FILE_TYPE;<br />
BEGIN<br />
v_out_file := UTL_FILE.FOPEN(&#8216;/u01/utilout&#8217;,'test.txt&#8217;, &#8216;W&#8217;);<br />
UTL_FILE.PUT_LINE (v_out_file, &#8216;Test Message1&#8242;);<br />
UTL_FILE.PUT_LINE (v_out_file, &#8216;Test Message2&#8242;);<br />
UTL_FILE.FCLOSE(v_out_file);<br />
END;<br />
/<br />
</span><br />
<b>2) Using directory object</b><br />
create directory object using create directory command and grant read, write to the user as shown below :<br />
create directory UTIL_OUT as &#8216;/u01/utilout&#8217;;<br />
grant read, write on directory UTIL_OUT to testuser;<br />
Then use the directory object name to read and write the files using UTL_FILE package.<br />
<span style="color:#000099;"></span><br />
</span></span><span style="font-family:times new roman;"><span style="font-size:130%;"><span style="color:#000099;">DECLARE<br />
v_out_file UTIL_FILE.FILE_TYPE;<br />
BEGIN<br />
v_out_file := UTL_FILE.FOPEN(&#8216;UTIL_OUT&#8217;,'test.txt&#8217;, &#8216;W&#8217;);<br />
UTL_FILE.PUT_LINE (v_out_file, &#8216;Test Message1&#8242;);<br />
UTL_FILE.PUT_LINE (v_out_file, &#8216;Test Message2&#8242;);<br />
UTL_FILE.FCLOSE(v_out_file);<br />
END;<br />
/<br />
</span><br />
The files created by UTIL_FILE package will have the permissions as per the umask settings of the oracle user.These file permissions can be changed manually after the files are created using chown and chgrp commands.<br />
Incase you need to have the files created automatically with different permissions, you can try changing the umask permissions of the oracle user.</span></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ilovetips.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ilovetips.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilovetips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilovetips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilovetips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilovetips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilovetips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilovetips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilovetips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilovetips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilovetips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilovetips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilovetips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilovetips.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilovetips.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilovetips.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=9&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilovetips.wordpress.com/2007/11/24/readingwriting-files-using-plsql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc284fed9314159982a504ac27804c3f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rajkiran Ghanta</media:title>
		</media:content>
	</item>
		<item>
		<title>Exporting/Importing Large Data</title>
		<link>http://ilovetips.wordpress.com/2007/11/21/exportingimporting-large-data/</link>
		<comments>http://ilovetips.wordpress.com/2007/11/21/exportingimporting-large-data/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 17:52:00 +0000</pubDate>
		<dc:creator>Rajkiran Ghanta</dc:creator>
				<category><![CDATA[DBA]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://ilovetips.wordpress.com/2007/11/21/exportingimporting-large-data/</guid>
		<description><![CDATA[When exporting Large data, you can specify multiple files in the export command. This can be used from Oracle 8i version. $&#62; exp testuser1/testuser1 files=/oraexport/data/tab1.dmp, /oraexport/data/tab2.dmp filesize=1024m log=large_exp.log Please note that the export files need to be specified in the same order, when you import the data. Or else, you can write the export data [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=3&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:times new roman;font-size:130%;">When exporting Large data, you can specify multiple files in the export command. This can be used from Oracle 8i version.</span></p>
<p><span style="font-family:times new roman;"><span style="font-size:130%;"><span style="color:#000099;">$&gt; exp testuser1/testuser1 files=/oraexport/data/tab1.dmp, /oraexport/data/tab2.dmp filesize=1024m log=large_exp.log<br />
</span><br />
Please note that the export files need to be specified in the same order, when you import the data.</span></span></p>
<p>Or else, you can write the export data to a pipe and compress the data before writing to a file.<br />
for export :<br />
<span style="font-family:times new roman;"><span style="font-size:130%;"><span style="color:#000099;">$PIPE=/tmp/exp_ora9i.dmp<br />
$MAXSIZE=1024m<br />
$ExportFile=employees.dmp<br />
$ExportLog=exp_employees.log<br />
$mknod $PIPE p<br />
$ORACLE_USER=testuser1/testuser1<br />
$ParamString=&#8221;compress=n feedback=10000 tables=employees log=$ExportLog statistics=none&#8221;<br />
$( gzip &lt; $PIPE ) split -b $MAXSIZE &#8211; $ExportFile. &amp; $exp $ORACLE_USER buffer=2000000 constraints=n triggers=n grants=n indexes=n file=$PIPE $ParamString </span></span></span></p>
<p>To import the data exported as above, you can uncompress the data to a pipe and use the same pipe to import.</p>
<p><span style="color:#000099;">$PIPE=/tmp/imp_ora9i.dmp </span><br />
<span style="color:#000099;">$mknod $PIPE p </span><br />
<span style="color:#000099;">$ORACLE_USER=testuser2/testuser2 </span><br />
<span style="font-family:times new roman;font-size:130%;color:#000099;">$cat `echo employees.* sort` gunzip &gt; $PIPE &amp;<br />
$imp $ORACLE_USER file=$PIPE ignore=y</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ilovetips.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ilovetips.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilovetips.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilovetips.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilovetips.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilovetips.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilovetips.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilovetips.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilovetips.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilovetips.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilovetips.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilovetips.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilovetips.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilovetips.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilovetips.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilovetips.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilovetips.wordpress.com&amp;blog=2524052&amp;post=3&amp;subd=ilovetips&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilovetips.wordpress.com/2007/11/21/exportingimporting-large-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc284fed9314159982a504ac27804c3f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rajkiran Ghanta</media:title>
		</media:content>
	</item>
	</channel>
</rss>
