<?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>Oracle Database Tips blog &#187; Oracle Scripts</title>
	<atom:link href="http://oracle-database-tips.com/wp/category/oracle-scripts/feed" rel="self" type="application/rss+xml" />
	<link>http://oracle-database-tips.com/wp</link>
	<description>News for Oracle professionals</description>
	<lastBuildDate>Fri, 11 May 2012 12:12:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How long will a rollback take ?</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/how-long-will-a-rollback-take</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/how-long-will-a-rollback-take#comments</comments>
		<pubDate>Thu, 29 Mar 2012 11:17:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[amount of time]]></category>
		<category><![CDATA[nbsp]]></category>
		<category><![CDATA[rerun]]></category>
		<category><![CDATA[sessions]]></category>
		<category><![CDATA[sysdate]]></category>
		<category><![CDATA[time difference]]></category>
		<category><![CDATA[urec]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=1180</guid>
		<description><![CDATA[Figure out how long a transaction will roll back.]]></description>
			<content:encoded><![CDATA[<p>Scenario: For some reason you needed to kill a session or transaction and now the blasted thing is rolling back, taking forever.</p>
<p>If you want to know how long you could be waiting, work it out like this: (it will show all active sessions, you can finetune to select only the session you are interested in)</p>
<p>SELECT sysdate, a.sid, a.username, b.xidusn, b.used_urec, b.used_ublk<br />
FROM v$session a, v$transaction b<br />
WHERE a.saddr = b.ses_addr;</p>
<p>&nbsp;</p>
<p>Run this same query after a specific amount of time (for example 10 minutes).</p>
<p>Then do the following:</p>
<p>select first_used_urec_result / ((first_used_urec_result &#8211; second_used_urec_result)/time_difference_in_minutes)/60 from dual;</p>
<p>&nbsp;</p>
<p>Real example:</p>
<p>SELECT sysdate, a.sid, a.username, b.xidusn, b.used_urec, b.used_ublk<br />
FROM v$session a, v$transaction b<br />
WHERE a.saddr = b.ses_addr;</p>
<p>SYSDATE             SID USERNAME                       XIDUSN USED_UREC USED_UBLK<br />
03/29/2012 12:53:13 241 USER1                          39     1274002   35704</p>
<p>&nbsp;</p>
<p>Rerun query 10 minutes later:<br />
SYSDATE             SID USERNAME                       XIDUSN USED_UREC USED_UBLK<br />
03/29/2012 13:03:13 241 USER1                          39     1232582   34545</p>
<p>&nbsp;</p>
<p>select round(1274002/(( 1274002 &#8211; 1232582 )/10)/60,2)  from dual ;</p>
<p>5.13</p>
<p>&nbsp;</p>
<p>So this transaction will take another 5 hours or so to finish rolling back&#8230;ouch.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/how-long-will-a-rollback-take/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>See the history of blocking locks</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/see-the-history-of-blocking-locks</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/see-the-history-of-blocking-locks#comments</comments>
		<pubDate>Tue, 07 Feb 2012 15:40:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[addr]]></category>
		<category><![CDATA[blocking locks]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[lock history]]></category>
		<category><![CDATA[locks]]></category>
		<category><![CDATA[sql query]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=1177</guid>
		<description><![CDATA[Here is a neat SQL query that will show you the history of blocking locks on your Oracle database in the past 6 hours: &#160; select j.sid, s.spid, s.serial#, j.log_user, j.job, j.broken, j.failures, j.last_date&#124;&#124;&#8217;:'&#124;&#124;j.last_sec last_date, j.this_date&#124;&#124;&#8217;:'&#124;&#124;j.this_sec this_date, j.next_date&#124;&#124;&#8217;:'&#124;&#124;j.next_sec next_date, (j.next_date &#8211; j.last_date) interval, j.what from (select djr.SID, dj.LOG_USER, dj.JOB, dj.BROKEN, dj.FAILURES, dj.LAST_DATE, dj.LAST_SEC, dj.THIS_DATE, dj.THIS_SEC, [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a neat SQL query that will show you the history of blocking locks on your Oracle database in the past 6 hours:</p>
<p>&nbsp;</p>
<p>select j.sid,<br />
s.spid,<br />
s.serial#,<br />
j.log_user,<br />
j.job,<br />
j.broken,<br />
j.failures,<br />
j.last_date||&#8217;:'||j.last_sec last_date,<br />
j.this_date||&#8217;:'||j.this_sec this_date,<br />
j.next_date||&#8217;:'||j.next_sec next_date,<br />
(j.next_date &#8211; j.last_date) interval,<br />
j.what<br />
from (select djr.SID,<br />
dj.LOG_USER, dj.JOB, dj.BROKEN, dj.FAILURES,<br />
dj.LAST_DATE, dj.LAST_SEC, dj.THIS_DATE, dj.THIS_SEC,<br />
dj.NEXT_DATE, dj.NEXT_SEC, dj.INTERVAL, dj.WHAT<br />
from dba_jobs dj, dba_jobs_running djr<br />
where dj.job = djr.job ) j,<br />
(select p.spid, s.sid, s.serial#<br />
from v$process p, v$session s<br />
where p.addr = s.paddr ) s<br />
where j.sid = s.sid;</p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/see-the-history-of-blocking-locks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a minimal Oracle test database</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/creating-a-minimal-oracle-test-database</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/creating-a-minimal-oracle-test-database#comments</comments>
		<pubDate>Tue, 31 Jan 2012 10:15:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[10m]]></category>
		<category><![CDATA[create database]]></category>
		<category><![CDATA[db name]]></category>
		<category><![CDATA[dba oracle]]></category>
		<category><![CDATA[max size]]></category>
		<category><![CDATA[minimal database]]></category>
		<category><![CDATA[national character]]></category>
		<category><![CDATA[parameter changes]]></category>
		<category><![CDATA[password file]]></category>
		<category><![CDATA[small database]]></category>
		<category><![CDATA[system passwords]]></category>
		<category><![CDATA[target]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=1173</guid>
		<description><![CDATA[Saw this script on dba-oracle.com , very handy if you need to create a tiny database to test some parameter changes on. Make sure your environment is set: ORACLE_SID and ORACLE_HOME ( set it in /etc/oratab first for ease of use ). Use this template to create an inittestdb.ora (presuming your db name is testdb) [...]]]></description>
			<content:encoded><![CDATA[<p>Saw this script on dba-oracle.com , very handy if you need to create a tiny database to test some parameter changes on.</p>
<ul>
<li>Make sure your environment is set: ORACLE_SID and ORACLE_HOME ( set it in /etc/oratab first for ease of use ).</li>
<li>Use this template to create an inittestdb.ora (presuming your db name is testdb) and place it in $ORACLE_HOME/dbs, remember to change path values
<p>control_files = (/u01/oradata/testdb/control1.ctl,/u01/oradata/testdb/control2.ctl,/u01/oradata/testdb/control3.ctl)<br />
undo_management = AUTO<br />
undo_tablespace = UNDOTBS1<br />
db_name = testdb<br />
db_block_size = 8192<br />
sga_max_size = 1073741824<br />
sga_target = 1073741824</li>
<li>Create your password file in $ORACLE_HOME/dbs:     orapwd file=orapwtestdb password=thepassword entries=4</li>
<li>Start the db in nomount mode :<br />
sqlplus / as sysdba<br />
startup nomount</li>
<li>Create cr_testdb.sql and run it:
<p>create database testdb<br />
logfile group 1 (&#8216;/u01/oradata/testdb/redo1.log&#8217;) size 100M,<br />
group 2 (&#8216;/u01/oradata/testdb/redo2.log&#8217;) size 100M,<br />
group 3 (&#8216;/u01/oradata/testdb/redo3.log&#8217;) size 100M<br />
character set WE8ISO8859P1<br />
national character set utf8<br />
datafile &#8216;/u01/oradata/testdb/system.dbf&#8217; size 500M autoextend on next 10M maxsize unlimited extent management local<br />
sysaux datafile &#8216;/u01/oradata/testdb/sysaux.dbf&#8217; size 100M autoextend on next 10M maxsize unlimited<br />
undo tablespace undotbs1 datafile &#8216;/u01/oradata/testdb/undotbs1.dbf&#8217; size 100M<br />
default temporary tablespace temp tempfile &#8216;/u01/oradata/testdb/temp01.dbf&#8217; size 100M;</p>
<p>SQL&gt; @cr_testdb.sql</li>
<li>Create the catalog<br />
SQL&gt;@?/rdbms/admin/catalog.sql</p>
<p>SQL&gt;@?/rdbms/admin/catproc.sql</li>
<li>Change your sys and system passwords and also remember to set up the listener and tnsnames.ora if you want to access your testdb over the network.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/creating-a-minimal-oracle-test-database/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grep unique ORA- errors in the alert.log</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/grep-unique-ora-errors-in-the-alertlog</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/grep-unique-ora-errors-in-the-alertlog#comments</comments>
		<pubDate>Sat, 27 Feb 2010 15:58:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=140</guid>
		<description><![CDATA[Need to see how many unique ORA- errors your alert log contains ? cat alert_DBID.log &#124; grep ORA- &#124; sort &#124; uniq That&#8217;s all there is to it..]]></description>
			<content:encoded><![CDATA[<p>Need to see how many unique ORA- errors your alert log contains ?</p>
<p> cat alert_DBID.log | grep ORA- | sort | uniq</p>
<p>That&#8217;s all there is to it..</p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/grep-unique-ora-errors-in-the-alertlog/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kill oracle processes using grep only</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/kill-oracle-processes-using-grep-only</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/kill-oracle-processes-using-grep-only#comments</comments>
		<pubDate>Fri, 23 Oct 2009 11:48:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[kill oracle process using grep]]></category>
		<category><![CDATA[management agent]]></category>
		<category><![CDATA[nohup]]></category>
		<category><![CDATA[oms]]></category>
		<category><![CDATA[oracle listener]]></category>
		<category><![CDATA[oracle management]]></category>
		<category><![CDATA[oracle product]]></category>
		<category><![CDATA[pl]]></category>
		<category><![CDATA[sid]]></category>
		<category><![CDATA[sids]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=102</guid>
		<description><![CDATA[Use grep to kill a range of similar oracle processes]]></description>
			<content:encoded><![CDATA[<p>If you have ever sighed at needing to kill a number of Oracle processes related to one aspect of Oracle<br />
(listener,instance, agent, oms) then you will enjoy using this little script as much as I do now that I&#8217;ve found it.<br />
Be very careful with it, if you get the &#8216;requirement&#8217; wrong, you could end up killing the wrong processes.</p>
<p>For example, if you want to kill all processes associated with one particular SID, but have multiple SIDs running on your server,<br />
don&#8217;t grep for &#8216;oracle&#8217; as the list that is returned is for ALL oracle processes on the server.</p>
<p>In this example, I need to kill all processed associated with the Oracle management agent (emagent) on a server.</p>
<p>I do not need to worry about being careful as I only have one agent home on the server and can not accidentally kill irrelevant ones.<br />
<!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<pre class="medium">$ps -ef | grep emagent

oracle     395 14244  0 15:10 pts/1    00:00:00
 grep emagent
oracle    3905     1  0 13:45 pts/1    00:00:00
/home/oracle/product/agent10g/perl/bin/perl
/home/oracle/product/agent10g/bin/emwd.pl
agent /home/oracle/product/agent10g/sysman/log/emagent.nohup
oracle    3922  3905  0 13:45 pts/1    00:00:08
/home/oracle/product/agent10g/bin/emagent
oracle    3928  3922  0 13:45 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    3929  3928  0 13:45 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    3930  3928  0 13:45 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    3931  3928  0 13:45 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    3932  3928  0 13:45 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    4019  3928  0 13:45 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    4233  3928  0 13:46 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    4235  3928  0 13:46 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    4236  3928  0 13:46 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    4237  3928  0 13:46 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    4238  3928  0 13:46 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    4239  3928  0 13:46 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    4240  3928  0 13:46 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle    4241  3928  0 13:46 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent
oracle   14736  3928  0 14:41 pts/1    00:00:00
/home/oracle/product/agent10g/bin/emagent

$ps -ef | grep emagent| awk '{print $2}' | xargs kill -9
$
$ps -ef | grep emagent
oracle   27931 14244  0 15:26 pts/1    00:00:00 grep emagent</pre>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/kill-oracle-processes-using-grep-only/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Cursors</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/open-cursors</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/open-cursors#comments</comments>
		<pubDate>Fri, 23 Oct 2009 11:45:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[7788]]></category>
		<category><![CDATA[application code]]></category>
		<category><![CDATA[c1]]></category>
		<category><![CDATA[client application]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[housekeeping]]></category>
		<category><![CDATA[language statements]]></category>
		<category><![CDATA[maximum number]]></category>
		<category><![CDATA[maximum open cursors]]></category>
		<category><![CDATA[open cursor]]></category>
		<category><![CDATA[ora-01000]]></category>
		<category><![CDATA[oracle cursors]]></category>
		<category><![CDATA[pl sql]]></category>
		<category><![CDATA[sql procedure]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=99</guid>
		<description><![CDATA[Open Cursors
What they are, How to manage them,
Resolving ORA-01000]]></description>
			<content:encoded><![CDATA[<p>A <strong>cursor</strong> is a name used to access a specific private SQL area.</p>
<p>Oracle creates implicit cursors for all SQL DML (data manipluation language)          statements, even for select statements returning one row.</p>
<p>If your query returns more than one row, you can explicitly declare a          cursor in PL/SQL to process the rows one by one.</p>
<p>Here is a simple example of using a cursor in a &#8216;cursor for loop&#8217; (which          automatically opens, fetches from and closes the cursor for you) :</p>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>SQL&gt; set serveroutput on size 100000;</p>
<p>SQL&gt; begin<br />
2 for c1 in (select empno from emp) loop<br />
3 dbms_output.put_line(c1.empno);<br />
4 end loop;<br />
5 end;<br />
6 /</p>
<p>7369<br />
7499<br />
7521<br />
7566<br />
7654<br />
7698<br />
7782<br />
7788<br />
7839<br />
7844<br />
7876<br />
7900<br />
7902<br />
7934</p>
<p>PL/SQL procedure successfully completed.</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   -->Your client application may hit the following error :</p>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>ORA-01000: maximum open cursors exceeded</div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<p>This means that your application&#8217;s session has hit the database-wide          limit of the maximum number of open cursors which one session is allowed          to have.</p>
<p>The database parameter which governs this limit is :<em> open_cursors</em></p>
<p>You can change this parameter in real-time, but you should ask yourself          the question if the value is really too low, perhaps the application code         should be rewritten, to either do better housekeeping (close cursors when          they are done), or rewrite the code so that many DML statements can be          recoded to be used in one cursor.</p>
<p>Never set this to an excessive value, you want to keep open cursors in          check.<br />
Rather let a new, untuned application hit this error so that the code         can be tuned.</p>
<p>Setting this value higher does not cause performance overhead on the          database.</p>
<p>If you do decide to change the value , this is how to do it :<br />
(the default value of 50 is usually too small, so you will probably change it sooner          or later).</p>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>alter system set open_cursors=300 scope=both;</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<h3>How to find out which cursors are open for a session ?</h3>
<p>Get the session&#8217;s sid from v$session, then get the sql_text from v$open_cursor :</p>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>SQL&gt; select sid, serial#, username from v$session where username =          &#8216;SYS&#8217;;</p>
<p>SID SERIAL# USERNAME<br />
&#8212; &#8212;&#8212;  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
94    3569     SYS</p>
<p>SQL&gt; select sql_text from v$open_cursor where sid = 94;</p>
<p>SQL_TEXT<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
select i.obj#,i.ts#,i.file#,i.block#,i.intcols,i.type#,i.fla<br />
select sql_text from v$open_cursor where sid = 94</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --> <!-- **********************************************************************************************************************************************   --></p>
<h3>Recommended reading for more information on oracle cursors :</h3>
<p><a title="opens new window" onclick="window.open('http://www.oracle-database-tips.com/cgi-bin/counter.pl?url=http%3A%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fappdev.102%2Fb14251%2Fadfns_sqlproc.htm%23i1024748&amp;referrer=http%3A%2F%2Fwww.oracle-database-tips.com%2Fopen_cursors.html'); return false;" href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_sqlproc.htm#i1024748" target="_blank">Oracle          online documentation: Oracle® Database Application Developer&#8217;s Guide &#8211; Fundamentals</a></p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/open-cursors/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Match OS process to Oracle session</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/match-os-process-to-oracle-session</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/match-os-process-to-oracle-session#comments</comments>
		<pubDate>Fri, 23 Oct 2009 11:43:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[logon time]]></category>
		<category><![CDATA[memory consumption]]></category>
		<category><![CDATA[oracle os session id]]></category>
		<category><![CDATA[paddr]]></category>
		<category><![CDATA[shr]]></category>
		<category><![CDATA[spid]]></category>
		<category><![CDATA[time command]]></category>
		<category><![CDATA[unix command line]]></category>
		<category><![CDATA[virt]]></category>
		<category><![CDATA[yyyy]]></category>
		<category><![CDATA[zombie]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=97</guid>
		<description><![CDATA[Identify the oracle session whose shadow process is using excessive resources, with these 'Match os process to oracle session' instructions]]></description>
			<content:encoded><![CDATA[<p>Your server is under pressure and you have decided to kill the oracle session which is causing excessive<br />
CPU or memory consumption, here&#8217;s how you can find the oracle session associated with a unix process:</p>
<p>Use top on the unix command line to see which process is the main culprit:<br />
(use shift+M to sort the list in order of highest memory consumption)</p>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>$top<br />
top &#8211; 15:35:38 up 81 days, 47 min,  2 users,  load average: 0.03, 0.04, 0.06<br />
Tasks: 148 total,   2 running, 146 sleeping,   0 stopped,   0 zombie<br />
Cpu(s):  1.5% us,  0.0% sy,  0.0% ni, 98.5% id,  0.0% wa,  0.0% hi,  0.0% si<br />
Mem:    993492k total,   979396k used,    14096k free,     8568k buffers<br />
Swap:  1998840k total,   392928k used,  1605912k free,   791300k cached</p>
<p>PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND<br />
<strong>4132</strong> oracle    15   0  754m 149m 143m S  0.0 15.4   0:03.92 oracle<br />
9581  oracle 15 0 754m 137m 132m S 0.0 14.2 0:01.70 oracle<br />
5230  oracle 15 0 755m 132m 130m S 0.0 13.7 0:16.90 oracle<br />
6404  oracle 16 0 754m 116m 111m S 0.0 12.0 0:02.75 oracle<br />
5224  oracle 16 0 766m   99m   98m S 0.0 10.2            0:08.76 oracle<br />
5234  oracle 16 0 754m   89m   87m S 0.0 9.2              0:06.84 oracle</div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   -->Make sure the top process is a client connection shadow process:<br />
<!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>$ps -ef | grep 4132</p>
<p>oracle    4132     1  0 08:52 ?        00:00:03 oracletestdb (LOCAL=NO)<br />
oracle   23557 23472  0 15:35 pts/1    00:00:00 grep 4132</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --><br />
Inside the database, find out who this is :<br />
(formatted result)<br />
<!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>SQL&gt;</p>
<p>select<br />
p.username,<br />
s.sid,<br />
s.serial#,<br />
p.spid,<br />
s.osuser,<br />
s.status,<br />
p.program,<br />
p.terminal,<br />
to_char(s.logon_time,&#8217;dd-mon-yyyy hh24:mi:ss&#8217;) &#8220;Logon              Time&#8221;,<br />
s.module<br />
from<br />
v$process p,<br />
v$session s<br />
where<br />
p.addr = s.paddr<br />
and p.spid = &#8217;4132&#8242;;</p>
<p>USERNAME  SID   SERIAL# SPID    OSUSER STATUS<br />
&#8212;&#8212;&#8212;&#8212;   &#8212;-     &#8212;&#8212;-                 &#8212;&#8211;     &#8212;&#8212;     &#8212;&#8212;-<br />
devuser      393    1178                    4132     LarryE   ACTIVE</p>
<p>PROGRAM                            TERMINAL                 Logon Time                             MODULE<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;  &#8212;&#8212;&#8212;&#8212;-                  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-  &#8212;&#8212;&#8212;&#8212;&#8212;<br />
oracletestdb@test.world.com  UNKNOWN  16-feb-2008 13:18:20              TOAD 9.0.1.8</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --> Kill the user:          <!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>SQL&gt; alter system kill session &#8217;393,1178&#8242;;</p>
<p>System altered.</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --> The user will receive this message either immediately or at the next attempted          SQL statement:<br />
<!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>ORA-00028: your session has been killed</div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --> <!-- ****************************************************************************************   --></p>
<h3>Recommended reading:</h3>
<div id="content">
<li><a title="opens new window" onclick="window.open('http://www.oracle-database-tips.com/cgi-bin/counter.pl?url=http%3A%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fserver.102%2Fb14231%2Fmanproc.htm%23i1006851&amp;referrer=http%3A%2F%2Fwww.oracle-database-tips.com%2Fmatch_os_process_to_oracle_session.html'); return false;" href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/manproc.htm#i1006851" target="_blank"> Oracle® Database Administrator&#8217;s Guide : Terminating sessions</a></li>
<li><a title="opens new window" onclick="window.open('http://www.oracle-database-tips.com/cgi-bin/counter.pl?url=http%3A%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fserver.102%2Fb14237%2Fdynviews_2022.htm%23i1411655&amp;referrer=http%3A%2F%2Fwww.oracle-database-tips.com%2Fmatch_os_process_to_oracle_session.html'); return false;" href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2022.htm#i1411655" target="_blank"> Oracle Database Reference: v$process</a></li>
<li><a title="opens new window" onclick="window.open('http://www.oracle-database-tips.com/cgi-bin/counter.pl?url=http%3A%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fserver.102%2Fb14237%2Fdynviews_2088.htm%23i1414383&amp;referrer=http%3A%2F%2Fwww.oracle-database-tips.com%2Fmatch_os_process_to_oracle_session.html'); return false;" href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2088.htm#i1414383" target="_blank"> Oracle® Database  Reference: v$session</a></li>
</div>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/match-os-process-to-oracle-session/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Raise alert.log error</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/raise-alertlog-error</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/raise-alertlog-error#comments</comments>
		<pubDate>Fri, 23 Oct 2009 11:41:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[0000]]></category>
		<category><![CDATA[dbas]]></category>
		<category><![CDATA[dbms system]]></category>
		<category><![CDATA[dbms_system.ksdwrt]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[exception handler]]></category>
		<category><![CDATA[handy utility]]></category>
		<category><![CDATA[jan 24]]></category>
		<category><![CDATA[raise alert.log error]]></category>
		<category><![CDATA[scott grant]]></category>
		<category><![CDATA[scott test]]></category>
		<category><![CDATA[substr]]></category>
		<category><![CDATA[user error]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=95</guid>
		<description><![CDATA[Use this unsupported but useful package to log your user error code in the database's alert.log]]></description>
			<content:encoded><![CDATA[<p>Came across this very handy utility recently.</p>
<p>Warning, it is unsupported by Oracle, so don&#8217;t base your mission-critical          alerts on this method.</p>
<p>Let&#8217;s say you are creating a stored proc as user scott, and instead of          writing your<br />
trapped error message to a table, an error file or sending an email, you          would like it to be reflected<br />
in the database&#8217;s alert.log.</p>
<p>The steps below show you how.</p>
<p>If not documented, this is guaranteed to make you unpopular with DBAs who manage your database in your absence&#8230;<br />
First, grant execution privileges to scott:</p>
<p>as sys:</p>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>SQL&gt; grant execute on sys.dbms_system to scott;</p>
<p>Grant succeeded.</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --><br />
Now run and test a procedure which will write to the alert.log</p>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>declare<br />
Mess varchar2(200);<br />
begin<br />
Mess := &#8216;ORA-USER_ERROR&#8217;||&#8217;, scott.test_proc, &#8216;||&#8217;, &#8216;||substr(SQLERRM,1,100);<br />
sys.dbms_system.ksdwrt(2,Mess);<br />
commit;<br />
end;</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --><br />
This is how it reflects in the alert.log (ORA-0000 because there is no          error.)</p>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>Thu Jan 24 14:57:15 2008<br />
ORA-USER_ERROR, scott.test_proc, ORA-0000: normal, successful completion</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   -->Lastly : implement it in your procedure&#8217;s exception handler section:</p>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div>
<p>&#8230;<br />
exception<br />
when others then<br />
Mess := &#8216;ORA-USER_ERROR&#8217;||&#8217;, scott.test_proc, &#8216;||&#8217;, &#8216;||substr(SQLERRM,1,100);<br />
sys.dbms_system.ksdwrt(2,Mess);<br />
commit;<br />
&#8230;.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/raise-alertlog-error/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compile another&#8217;s Oracle schema</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/compile-anothers-oracle-schema</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/compile-anothers-oracle-schema#comments</comments>
		<pubDate>Fri, 23 Oct 2009 11:39:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[compilations]]></category>
		<category><![CDATA[compile oracle schema]]></category>
		<category><![CDATA[dbms_utility]]></category>
		<category><![CDATA[exec]]></category>
		<category><![CDATA[session settings]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=93</guid>
		<description><![CDATA[
How to compile another Oracle user schema.]]></description>
			<content:encoded><![CDATA[<p>There will be times when you want to compile a schema which does not belong          to you,<br />
or for which you do not have the password.</p>
<p>The solution is to use the dbms_utility package as a DBA user.</p>
<p>Example, if you want to recompile all procedures,functions, packages          and triggers belonging to scott<br />
here is how to do it:<br />
<!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>SQL&gt; exec dbms_utility.compile_schema(schema=&gt;&#8217;SCOTT&#8217;);<br />
PL/SQL procedure successfully completed.</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   -->If you only want to recompile all invalid options, execute it like this          :  <!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>SQL&gt; exec dbms_utility.compile_schema(schema=&gt;&#8217;SCOTT&#8217;,compile_all=&gt;false);<br />
PL/SQL procedure successfully completed.</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   -->If you want to use each object&#8217;s session settings instead of the calling          user&#8217;s settings:  <!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>SQL&gt; exec dbms_utility.compile_schema(schema=&gt;&#8217;SCOTT&#8217;,compile_all=&gt;false,          reuse_settings=&gt;true);<br />
PL/SQL procedure successfully completed.</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   -->To see if any errors were generated<br />
(you must run this command immediately after executing dbms_utility) :  <!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>SQL&gt; show errors<br />
No errors.</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   -->Another way to see if the compilations were successful :  <!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>SQL&gt; select object_name, object_type from dba_objects where owner = &#8216;SCOTT&#8217;          and status = &#8216;INVALID&#8217;;<br />
no rows selected</p></div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --> <!-- ****************************************************************************************   --></p>
<h3>Recommended reading:</h3>
<div id="content">
<li><a title="opens new window" onclick="window.open('http://www.oracle-database-tips.com/cgi-bin/counter.pl?url=http%3A%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fappdev.102%2Fb14258%2Fd_util.htm%23CHDGHICD&amp;referrer=http%3A%2F%2Fwww.oracle-database-tips.com%2Fcompile_oracle_schema.html'); return false;" href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_util.htm#CHDGHICD" target="_blank">Oracle Database PL/SQL Packages and Types Reference, DBMS_UTILITY</a></li>
</div>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/compile-anothers-oracle-schema/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NFS Mount article</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/nfs-mount-article</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/nfs-mount-article#comments</comments>
		<pubDate>Fri, 23 Oct 2009 11:37:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[5g]]></category>
		<category><![CDATA[avail]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[hangup]]></category>
		<category><![CDATA[hup]]></category>
		<category><![CDATA[ip addresses]]></category>
		<category><![CDATA[mkdir]]></category>
		<category><![CDATA[nfs mount]]></category>
		<category><![CDATA[nfs mount instructions]]></category>
		<category><![CDATA[unix environment]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=91</guid>
		<description><![CDATA[NFS Mount a linux server's filesystem to another server]]></description>
			<content:encoded><![CDATA[<p><strong>NFS Mount</strong> is incredibly useful in a corporate unix environment.</p>
<p>You can use it to share disk space amongst servers, so that each server          &#8216;sees&#8217; the shared filesystem as if it is local.</p>
<p>If your network is fast enough, you can backup your oracle database to a shared filesystem, or just keep</p>
<p>any required software on the shared filesystem so that you do not need to install the software</p>
<p>numerous times on different servers.</p>
<p>In this example, we are sharing a filesystem called orabackup on server share01.world.com, and then</p>
<p>we will mount that on a database server called prod01.world.com.</p>
<h3>Steps to take on share01:</h3>
<p>Log in as root.</p>
<p>Add prod01&#8242;s IP to /etc/exports</p>
<p>If there is more than one entry, make sure there is a space between IP          addresses.  <!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>[root@share01 ~]# cat /etc/exports</p>
<p>/orabackup -maproot=root 141.146.8.66</p>
</div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   -->Send a hangup to the mountd process to force it to reread the /etc/exports          file.  <!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>[root@share01 ~]#kill -s HUP `cat /var/run/mountd.pid`</p>
<p>Alternatively just do : exportfs -ra</p>
</div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<h3>Steps to take on prod01:</h3>
<p>Log in as root.</p>
<p>Create /orabackup  <!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>[root@prod01 ~]# mkdir /orabackup</p>
</div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   -->Edit /etc/fstab, add line to the bottom:  <!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>[root@prod01 ~]#cat /etc/fstab share01.world.com:/orabackup /orabackup nfs rsize=1024,wsize=1024</p>
</div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   -->Mount the filesystem :   <!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>[root@prod01 ~]#mount share01.world.com:/orabackup</p>
</div>
</div>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<p>Once that is completed, you will be able to access it like a local filesystem.</p>
<p><!-- ccccccccccccccccccccccccccccccccccccccccccccccccc   --></p>
<div id="textbox">
<div>
<p>[root@prod01 ~]#df -h</p>
<p>Filesystem                  Size          Used Avail Use% Mounted on</p>
<p>/dev/hda9                  7.6G          6.5G 750M 90% /</p>
<p>/dev/hda1                  99M          8.7M 86M 10%  /boot</p>
<p>none                        237M          0 237M 0%        /dev/shm</p>
<p>/dev/hda7                  12G          5.6G 5.7G 50%   /home</p>
<p>/dev/hda6                   20G          17G 1.7G 91%   /u01</p>
<p>/dev/hda3                   25G          20G 4.3G 82%    /u02</p>
<p>/dev/hda5                   20G          8.5G 11G 46%    /u03</p>
<p>/dev/hda2                   25G          20G 3.5G 86%    /u04</p>
<p>share01.world.com:/orabackup 66G 29G 34G 46% /orabackup</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/nfs-mount-article/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris: How to Find Large Files and Directories</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/solaris-how-to-find-large-files-and-directories</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/solaris-how-to-find-large-files-and-directories#comments</comments>
		<pubDate>Sun, 13 Sep 2009 08:51:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[byte blocks]]></category>
		<category><![CDATA[directory usage]]></category>
		<category><![CDATA[du]]></category>
		<category><![CDATA[find large file]]></category>
		<category><![CDATA[ko]]></category>
		<category><![CDATA[kod]]></category>
		<category><![CDATA[mbytes]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris os]]></category>
		<category><![CDATA[sourced]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[system boundaries]]></category>
		<category><![CDATA[wikis]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=57</guid>
		<description><![CDATA[Finding Large Directories and files on SunOs
]]></description>
			<content:encoded><![CDATA[<h5>Finding Large Directories</h5>
<p>To find large directories, use the <strong>du</strong> command and sort the output.</p>
<p>For example, to output the 10 largest directories in <strong>/var</strong>, sorted in ascending size order, use the following command:</p>
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">du -ko /<span class="code-keyword">var</span>|sort -n | tail -10</pre>
</div>
</div>
<p>To avoid crossing file system boundaries, that is, to see the directory usage in <strong>/</strong> but not in the other mounted files systems (<strong>/var</strong>, <strong>/opt</strong>, and so on), add the <strong>d</strong> option to the <strong>du</strong> command:</p>
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">du -kod /<span class="code-keyword">var</span>|sort -n | tail -10</pre>
</div>
</div>
<h5><a name="FindingLargeFilesandDirectoriesintheSolarisOS-FindingLargeFiles"></a>Finding Large Files</h5>
<p>To find large files, use the <strong>find</strong> command and sort the output.</p>
<p>Example 1: To find all plain files (not block, character, symbolic links, and so on) in a file system larger than 200,000 512-byte blocks (approximately 100 Mbytes) and sort on field 7 (file size) while numerically ignoring leading blanks, do this:</p>
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">find / -size +200000 -type f -ls | sort -k 7,7 -n

Sourced from: http://wikis.sun.com/display/BigAdmin/Finding+Large+Files+and+Directories+in+the+Solaris+OS</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/solaris-how-to-find-large-files-and-directories/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get rid of large listener.log file while the listener is still running.</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/get-rid-of-large-listenerlog-file-while-the-listener-is-still-running</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/get-rid-of-large-listenerlog-file-while-the-listener-is-still-running#comments</comments>
		<pubDate>Sun, 13 Sep 2009 08:10:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[listener log]]></category>
		<category><![CDATA[listener.log]]></category>
		<category><![CDATA[oracle environment]]></category>
		<category><![CDATA[parameter log]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[running log]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=54</guid>
		<description><![CDATA[Your listener.log file can get quite large if you do not make it part of your housekeeping scripts, and renaming it while the listener is running is not a good idea.

Here is the method to follow to clean it up while your listener is still running.]]></description>
			<content:encoded><![CDATA[<p>Your listener.log file can get quite large if you do not make it part of your housekeeping scripts, and renaming it while the listener is running is not a good idea.</p>
<p>Here is the method to follow to clean it up while your listener is still running.</p>
<p>Log into your listener from the command prompt (make sure your Oracle environment is set to that of where the listener is started from, the commands below assume there is only one (default)  listener running ) :</p>
<p>$<span style="color: #ff9900;">lsnrctl </span></p>
<p>..</p>
<p>LSNRCTL&gt; <span style="color: #ff9900;"> set log_status off</span><br />
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))<br />
LISTENER parameter &#8220;log_status&#8221; set to OFF<br />
The command completed successfully</p>
<p><span style="color: #3366ff;">(Now go delete/rename $ORACLE_HOME/network/log/listener.log to something else in another OS session )</span><br />
LSNRCTL&gt; <span style="color: #ff9900;">set log_status on</span><br />
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))<br />
LISTENER parameter &#8220;log_status&#8221; set to ON<br />
The command completed successfully<br />
LSNRCTL&gt; <span style="color: #ff9900;">quit</span></p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/get-rid-of-large-listenerlog-file-while-the-listener-is-still-running/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick SQL to determine your Database size. (excluding tempfiles)</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/quick-sql-to-determine-your-database-size-excluding-tempfiles</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/quick-sql-to-determine-your-database-size-excluding-tempfiles#comments</comments>
		<pubDate>Tue, 30 Jun 2009 12:30:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[c control]]></category>
		<category><![CDATA[determine oracle db size]]></category>
		<category><![CDATA[select sum]]></category>
		<category><![CDATA[size mb]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=51</guid>
		<description><![CDATA[quick sql to determine your database size exluding tempfiles.]]></description>
			<content:encoded><![CDATA[<p>SQL&gt; select DF.TOTAL/1048576 &#8220;DataFile Size Mb&#8221;,<br />
2  LOG.TOTAL/1048576 &#8220;Redo Log Size Mb&#8221;,<br />
3  CONTROL.TOTAL/1048576 &#8220;Control File Size Mb&#8221;,<br />
4  (DF.TOTAL + LOG.TOTAL + CONTROL.TOTAL)/1048576 &#8220;Total Size Mb&#8221; from dual,<br />
5  (select sum(a.bytes) TOTAL from dba_data_files a) DF,<br />
6  (select sum(b.bytes) TOTAL from v$log b) LOG,<br />
7  (select sum((cffsz+1)*cfbsz) TOTAL from x$kcccf c) CONTROL;</p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/quick-sql-to-determine-your-database-size-excluding-tempfiles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kill Oracle processes</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/kill-oracle-processes</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/kill-oracle-processes#comments</comments>
		<pubDate>Thu, 15 Jan 2009 13:14:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[kill oracle process]]></category>
		<category><![CDATA[oracle process]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=28</guid>
		<description><![CDATA[Kill a bunch of related orphan Oracle processes with one command. Permalink &#8212; click for full blog post Related Blogs Related Blogs on kill oracle process Related Blogs on oracle process]]></description>
			<content:encoded><![CDATA[<p>Kill a bunch of related orphan Oracle processes with one command.</p>
<p><a href="http://www.oracle-database-tips.com/kill_oracle_process.html">Permalink        &#8212; click for full blog post</a><br />
<h4>Related Blogs</h4>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <b>kill oracle process</b></li>
</ul>
<ul class="pc_pingback">
<li class="hdl" style="list-style: none">Related Blogs on <b>oracle process</b></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/kill-oracle-processes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VNC Tutorial</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/vnc-tutorial</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/vnc-tutorial#comments</comments>
		<pubDate>Thu, 15 Jan 2009 12:11:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[desktop type]]></category>
		<category><![CDATA[functionality]]></category>
		<category><![CDATA[permalink]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vnc]]></category>
		<category><![CDATA[vnc tutorial]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=23</guid>
		<description><![CDATA[Quick tutorial to download, install and use Free VNC for Linux. This will give you &#8216;remote desktop&#8217;-type functionality on UNix. Permalink &#8212; click for full blog post]]></description>
			<content:encoded><![CDATA[<p>Quick tutorial to download, install and use Free VNC for Linux.<br />
This will give you &#8216;remote desktop&#8217;-type functionality on UNix.</p>
<p><a href="http://www.oracle-database-tips.com/vnc_tutorial.html">Permalink        &#8212; click for full blog post</a></p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/vnc-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux du command : options used to summarize directory space usage.</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/linux-du-command-options-used-to-summarize-directory-space-usage</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/linux-du-command-options-used-to-summarize-directory-space-usage#comments</comments>
		<pubDate>Thu, 15 Jan 2009 12:10:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[linux du]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=21</guid>
		<description><![CDATA[Quick page to remind myself what options to use with the linux du command to summarize the list of directories, not all the files. Permalink &#8212; click for full blog post]]></description>
			<content:encoded><![CDATA[<p>Quick page to remind myself what options to use with the linux du command to summarize the list of directories,<br />
not all the files.</p>
<p><a href="http://www.oracle-database-tips.com/linux_du.html">Permalink &#8212; click for full blog post</a></p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/linux-du-command-options-used-to-summarize-directory-space-usage/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VSFTPD</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/vsftpd</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/vsftpd#comments</comments>
		<pubDate>Thu, 15 Jan 2009 12:09:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[vsftp]]></category>
		<category><![CDATA[vsftpd]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=17</guid>
		<description><![CDATA[Installing and running vsftpd on your CentOS 4.5 server Permalink &#8212; click for full blog post]]></description>
			<content:encoded><![CDATA[<p>Installing and running vsftpd on your CentOS 4.5 server</p>
<p><a href="http://www.oracle-database-tips.com/vsftpd.html">Permalink &#8212; click for full blog post</a></p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/vsftpd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AWR reports</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/awr-reports</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/awr-reports#comments</comments>
		<pubDate>Thu, 15 Jan 2009 12:07:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[awr]]></category>
		<category><![CDATA[awr report]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=13</guid>
		<description><![CDATA[Use these steps to publish oracle awr reports regularly and mail them to yourself Permalink &#8212; click for full blog post]]></description>
			<content:encoded><![CDATA[<p>Use these steps to publish oracle awr reports regularly and mail them to yourself</p>
<p><a href="http://www.oracle-database-tips.com/awr.html">Permalink &#8212; click for full blog post</a></p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/awr-reports/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle FTP Script</title>
		<link>http://oracle-database-tips.com/wp/oracle-scripts/oracle-ftp-script</link>
		<comments>http://oracle-database-tips.com/wp/oracle-scripts/oracle-ftp-script#comments</comments>
		<pubDate>Thu, 15 Jan 2009 10:51:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Scripts]]></category>
		<category><![CDATA[ftp script]]></category>
		<category><![CDATA[oracle ftp]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://oracle-database-tips.com/wp/?p=10</guid>
		<description><![CDATA[Automate the transfer of files across servers with this oracle ftp script. Permalink &#8212; click for full blog post]]></description>
			<content:encoded><![CDATA[<p>Automate the transfer of files across servers with this oracle ftp script.</p>
<p><a href="http://www.oracle-database-tips.com/oracle_ftp_script.html">Permalink &#8212; click for full blog post</a></p>
]]></content:encoded>
			<wfw:commentRss>http://oracle-database-tips.com/wp/oracle-scripts/oracle-ftp-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

