<?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>ORATraining Blog &#187; Concurrent manager</title>
	<atom:link href="http://www.oratraining.com/blog/tag/concurrent-manager/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oratraining.com/blog</link>
	<description>Not just another Oracle Blog</description>
	<lastBuildDate>Wed, 01 Sep 2010 15:23:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>cmclean.sql script to cleanup concurrent manager tables</title>
		<link>http://www.oratraining.com/blog/2009/04/cmclean-sql-script-to-cleanup-concurrent-manager-tables/</link>
		<comments>http://www.oratraining.com/blog/2009/04/cmclean-sql-script-to-cleanup-concurrent-manager-tables/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 12:42:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Concurrent manager]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle Applications]]></category>
		<category><![CDATA[Oracle Applications DBA]]></category>
		<category><![CDATA[oracle applications]]></category>

		<guid isPermaLink="false">http://www.oratraining.com/blog/?p=127</guid>
		<description><![CDATA[Click here to download cmclean.sql REM REM FILENAME REM   cmclean.sql REM DESCRIPTION REM   Clean out the concurrent manager tables REM NOTES REM   Usage: sqlplus &#60;apps_user/apps_passwd&#62; @cmclean REM REM REM   $Id: cmclean.sql,v 1.4 2001/04/07 15:55:07 pferguso Exp $ REM REM REM +==============================+ set verify off; set head off; set timing off set pagesize 1000 column manager format [...]]]></description>
			<content:encoded><![CDATA[<h4 style="font-size: 1em;">Click here to download <a href="http://www.oratraining.com/docs/oracle/scripts/cmclean.sql" target="_blank">cmclean.sql</a></h4>
<p>REM<br />
REM FILENAME<br />
REM   cmclean.sql<br />
REM DESCRIPTION<br />
REM   Clean out the concurrent manager tables<br />
REM NOTES<br />
REM   Usage: sqlplus &lt;apps_user/apps_passwd&gt; @cmclean<br />
REM<br />
REM<br />
REM   $Id: cmclean.sql,v 1.4 2001/04/07 15:55:07 pferguso Exp $<br />
REM<br />
REM<br />
REM +==============================+<br />
set verify off;<br />
set head off;<br />
set timing off<br />
set pagesize 1000<br />
column manager format a20 heading &#8216;Manager short name&#8217;<br />
column pid heading &#8216;Process id&#8217;<br />
column pscode format a12 heading &#8216;Status code&#8217;<br />
column ccode format a12 heading &#8216;Control code&#8217;<br />
column request heading &#8216;Request ID&#8217;<br />
column pcode format a6 heading &#8216;Phase&#8217;<br />
column scode format a6 heading &#8216;Status&#8217;<br />
WHENEVER SQLERROR EXIT ROLLBACK;<span id="more-127"></span><br />
DOCUMENT<br />
WARNING : Do not run this script without explicit instructions<br />
from Oracle Support<br />
*** Make sure that the managers are shut down     ***<br />
*** before running this script                    ***<br />
*** If the concurrent managers are NOT shut down, ***<br />
*** exit this script now !!                       ***<br />
#<br />
accept answer prompt &#8216;If you wish to continue type the word &#8221;dual&#8221;: &#8216;<br />
set feed off<br />
select null from &amp;answer;<br />
set feed on<br />
REM     Update process status codes to TERMINATED<br />
prompt<br />
prompt  &#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 />
prompt  &#8212; Updating invalid process status codes in FND_CONCURRENT_PROCESSES<br />
set feedback off<br />
set head on<br />
break on manager<br />
SELECT  concurrent_queue_name manager,<br />
concurrent_process_id pid,<br />
process_status_code pscode<br />
FROM    fnd_concurrent_queues fcq, fnd_concurrent_processes fcp<br />
WHERE   process_status_code not in (&#8216;K&#8217;, &#8216;S&#8217;)<br />
AND     fcq.concurrent_queue_id = fcp.concurrent_queue_id<br />
AND     fcq.application_id = fcp.queue_application_id;<br />
set head off<br />
set feedback on<br />
UPDATE  fnd_concurrent_processes<br />
SET     process_status_code = &#8216;K&#8217;<br />
WHERE   process_status_code not in (&#8216;K&#8217;, &#8216;S&#8217;);<br />
REM     Set all managers to 0 processes<br />
prompt<br />
prompt  &#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 />
prompt  &#8212; Updating running processes in FND_CONCURRENT_QUEUES<br />
prompt  &#8212; Setting running_processes = 0 and max_processes = 0 for all managers<br />
UPDATE  fnd_concurrent_queues<br />
SET     running_processes = 0, max_processes = 0;<br />
REM     Reset control codes<br />
prompt<br />
prompt  &#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 />
prompt  &#8212; Updating invalid control_codes in FND_CONCURRENT_QUEUES<br />
set feedback off<br />
set head on<br />
SELECT  concurrent_queue_name manager,<br />
control_code ccode<br />
FROM    fnd_concurrent_queues<br />
WHERE   control_code not in (&#8216;E&#8217;, &#8216;R&#8217;, &#8216;X&#8217;)<br />
AND     control_code IS NOT NULL;<br />
set feedback on<br />
set head off<br />
UPDATE  fnd_concurrent_queues<br />
SET     control_code = NULL<br />
WHERE   control_code not in (&#8216;E&#8217;, &#8216;R&#8217;, &#8216;X&#8217;)<br />
AND     control_code IS NOT NULL;<br />
REM     Also null out target_node for all managers<br />
UPDATE  fnd_concurrent_queues<br />
SET     target_node = null;<br />
REM     Set all &#8216;Terminating&#8217; requests to Completed/Error<br />
REM     Also set Running requests to completed, since the managers are down<br />
prompt<br />
prompt  &#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 />
prompt  &#8212; Updating any Running or Terminating requests to Completed/Error<br />
set feedback off<br />
set head on<br />
SELECT  request_id request,<br />
phase_code pcode,<br />
status_code scode<br />
FROM    fnd_concurrent_requests<br />
WHERE   status_code = &#8216;T&#8217; OR phase_code = &#8216;R&#8217;<br />
ORDER BY request_id;<br />
set feedback on<br />
set head off<br />
UPDATE  fnd_concurrent_requests<br />
SET     phase_code = &#8216;C&#8217;, status_code = &#8216;E&#8217;<br />
WHERE   status_code =&#8217;T&#8217; OR phase_code = &#8216;R&#8217;;<br />
REM     Set all Runalone flags to &#8216;N&#8217;<br />
REM     This has to be done differently for Release 10<br />
prompt<br />
prompt  &#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 />
prompt  &#8212; Updating any Runalone flags to &#8216;N&#8217;<br />
prompt<br />
set serveroutput on<br />
set feedback off<br />
declare<br />
c         pls_integer := dbms_sql.open_cursor;<br />
upd_rows  pls_integer;<br />
vers      varchar2(50);<br />
tbl       varchar2(50);<br />
col       varchar2(50);<br />
statement varchar2(255);<br />
begin<br />
select substr(release_name, 1, 2)<br />
into   vers<br />
from fnd_product_groups;<br />
if vers &gt;= 11 then<br />
tbl := &#8216;fnd_conflicts_domain&#8217;;<br />
col := &#8216;runalone_flag&#8217;;<br />
else<br />
tbl := &#8216;fnd_concurrent_conflict_sets&#8217;;<br />
col := &#8216;run_alone_flag&#8217;;<br />
end if;<br />
statement := &#8216;update &#8216; || tbl || &#8216; set &#8216; || col || &#8216;=&#8221;N&#8221; where &#8216; || col || &#8216; = &#8221;Y&#8221;&#8217;;<br />
dbms_sql.parse(c, statement, dbms_sql.native);<br />
upd_rows := dbms_sql.execute(c);<br />
dbms_sql.close_cursor(c);<br />
dbms_output.put_line(&#8216;Updated &#8216; || upd_rows || &#8216; rows of &#8216; || col || &#8216; in &#8216; || tbl || &#8216; to &#8221;N&#8221;&#8217;);<br />
end;<br />
/</p>
<p>prompt</p>
<p>prompt  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>prompt  Updates complete.<br />
prompt  Type commit now to commit these updates, or rollback to cancel.<br />
prompt  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>prompt</p>
<p>set feedback on</p>
<p>REM  &lt;= Last REM statment &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<left><a class="tt" href="http://twitter.com/home/?status=cmclean.sql+script+to+cleanup+concurrent+manager+tables+http://bit.ly/bR8sTN" title="Post to Twitter"><img class="nothumb" src="http://www.oratraining.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.oratraining.com/blog/2009/04/cmclean-sql-script-to-cleanup-concurrent-manager-tables/&amp;title=cmclean.sql+script+to+cleanup+concurrent+manager+tables" title="Post to Digg"><img class="nothumb" src="http://www.oratraining.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a></left><div class="fblike" style="height:25px; height:25px; overflow:hidden;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.oratraining.com%2Fblog%2F2009%2F04%2Fcmclean-sql-script-to-cleanup-concurrent-manager-tables%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allow Transparency="true" style="border:none; overflow:hidden; width:450px;"></iframe></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.oratraining.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.oratraining.com/blog/2009/04/cmclean-sql-script-to-cleanup-concurrent-manager-tables/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to submit concurrent program from command promot / shell</title>
		<link>http://www.oratraining.com/blog/2009/04/how-to-submit-concurrent-program-from-command-promot-shell/</link>
		<comments>http://www.oratraining.com/blog/2009/04/how-to-submit-concurrent-program-from-command-promot-shell/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 14:21:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Concurrent manager]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle Applications]]></category>
		<category><![CDATA[Oracle Applications DBA]]></category>
		<category><![CDATA[oracle applications]]></category>

		<guid isPermaLink="false">http://www.oratraining.com/blog/?p=103</guid>
		<description><![CDATA[We can submit concurrent programs from OS command / shell prompt using CONCSUB utility. Following is the syntax of the same: CONCSUB &#60;APPS username&#62;/&#60;APPS password&#62; &#60;responsibility application short name&#62; &#60;responsibility name&#62; &#60;username&#62; [WAIT=N&#124;Y&#124;&#60;n seconds&#62;] CONCURRENT &#60;program application short name&#62; &#60;program name&#62; [PROGRAM_NAME="&#60;description&#62;"] [REPEAT_TIME=&#60;resubmission time&#62;] [REPEAT_INTERVAL= &#60;number&#62;] [REPEAT_INTERVAL_UNIT=&#60; resubmission unit&#62;] [REPEAT_INTERVAL_TYPE=&#60; resubmission type&#62;] [REPEAT_END=&#60;resubmission end date and [...]]]></description>
			<content:encoded><![CDATA[<p>We can submit concurrent programs from OS command / shell prompt using CONCSUB utility. Following is the <strong>syntax</strong> of the same:</p>
<p>CONCSUB &lt;APPS username&gt;/&lt;APPS password&gt;<br />
&lt;responsibility application short name&gt;<br />
&lt;responsibility name&gt;<br />
&lt;username&gt;<br />
[WAIT=N|Y|&lt;n seconds&gt;]<br />
CONCURRENT<br />
&lt;program application short name&gt;<br />
&lt;program name&gt;<br />
[PROGRAM_NAME="&lt;description&gt;"]<br />
[REPEAT_TIME=&lt;resubmission time&gt;]<br />
[REPEAT_INTERVAL= &lt;number&gt;]<br />
[REPEAT_INTERVAL_UNIT=&lt; resubmission unit&gt;]<br />
[REPEAT_INTERVAL_TYPE=&lt; resubmission type&gt;]<br />
[REPEAT_END=&lt;resubmission end date and time&gt;]<br />
[NLS_LANGUAGE=&lt;language of the request&gt;]<br />
[NLS_TERRITORY=&lt;territory of the request&gt;]<br />
[START=&lt;date&gt;]<br />
[IMPLICIT=&lt; type of concurrent request&gt;<br />
[&lt;parameter 1&gt; ... &lt;parameter n&gt;]</p>
<p><strong>Examples:</strong></p>
<p><strong>Active Users</strong><br />
CONCSUB apps/[apps_pwd] SYSADMIN &#8220;System Administrator&#8221; SYSADMIN WAIT=N CONCURRENT FND FNDSCURS</p>
<p><strong>Prints Environment Variables</strong><br />
CONCSUB apps/[apps_pwd] SYSADMIN &#8220;System Administrator&#8221; SYSADMIN WAIT=N CONCURRENT FND FNDPRNEV APPL_TOP</p>
<left><a class="tt" href="http://twitter.com/home/?status=How+to+submit+concurrent+program+from+command+promot+%2F+shell+http://bit.ly/cVYoor" title="Post to Twitter"><img class="nothumb" src="http://www.oratraining.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.oratraining.com/blog/2009/04/how-to-submit-concurrent-program-from-command-promot-shell/&amp;title=How+to+submit+concurrent+program+from+command+promot+%2F+shell" title="Post to Digg"><img class="nothumb" src="http://www.oratraining.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a></left><div class="fblike" style="height:25px; height:25px; overflow:hidden;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.oratraining.com%2Fblog%2F2009%2F04%2Fhow-to-submit-concurrent-program-from-command-promot-shell%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allow Transparency="true" style="border:none; overflow:hidden; width:450px;"></iframe></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.oratraining.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.oratraining.com/blog/2009/04/how-to-submit-concurrent-program-from-command-promot-shell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Oracle Applications Concurrent Request phase codes and status codes</title>
		<link>http://www.oratraining.com/blog/2009/04/oracle-applications-concurrent-request-phase-codes-and-status-codes/</link>
		<comments>http://www.oratraining.com/blog/2009/04/oracle-applications-concurrent-request-phase-codes-and-status-codes/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 14:06:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Concurrent manager]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle Applications]]></category>
		<category><![CDATA[Oracle Applications DBA]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[oracle applications]]></category>
		<category><![CDATA[submit concurrent program]]></category>
		<category><![CDATA[submit concurrent request]]></category>

		<guid isPermaLink="false">http://www.oratraining.com/blog/?p=98</guid>
		<description><![CDATA[  Table Name: FND_CONCURRENT_REQUESTS Column Name: PHASE_CODE   Value  Meaning  C  Completed  I  Inactive  P  Pending  R  Running   Table Name: FND_CONCURRENT_REQUESTS Column Name: STATUS_CODE   Value  Meaning  D  Cancelled  U  Disabled  E  Error  M  No Manager  R  Normal  I  Normal  C  Normal  H  On Hold  W  Paused  B  Resuming  P  Scheduled  Q  Standby  S [...]]]></description>
			<content:encoded><![CDATA[<p> </p>
<p><strong>Table Name:</strong> FND_CONCURRENT_REQUESTS</p>
<p><strong>Column Name:</strong> PHASE_CODE<br />
 </p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="91" valign="top"><strong>Value</strong></td>
<td width="180" valign="top"><strong> Meaning</strong></td>
</tr>
<tr>
<td width="91" valign="top"> C</td>
<td width="180" valign="top"> Completed</td>
</tr>
<tr>
<td width="91" valign="top"> I</td>
<td width="180" valign="top"> Inactive</td>
</tr>
<tr>
<td width="91" valign="top"> P</td>
<td width="180" valign="top"> Pending</td>
</tr>
<tr>
<td width="91" valign="top"> R</td>
<td width="180" valign="top"> Running</td>
</tr>
</tbody>
</table>
<p> <br />
<strong>Table Name: </strong>FND_CONCURRENT_REQUESTS</p>
<p><strong>Column Name:</strong> STATUS_CODE<br />
 </p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="91" valign="top"><strong>Value</strong></td>
<td width="180" valign="top"><strong> Meaning</strong></td>
</tr>
<tr>
<td width="91" valign="top"> D</td>
<td width="180" valign="top"> Cancelled</td>
</tr>
<tr>
<td width="91" valign="top"> U</td>
<td width="180" valign="top"> Disabled</td>
</tr>
<tr>
<td width="91" valign="top"> E</td>
<td width="180" valign="top"> Error</td>
</tr>
<tr>
<td width="91" valign="top"> M</td>
<td width="180" valign="top"> No   Manager</td>
</tr>
<tr>
<td width="91" valign="top"> R</td>
<td width="180" valign="top"> Normal</td>
</tr>
<tr>
<td width="91" valign="top"> I</td>
<td width="180" valign="top"> Normal</td>
</tr>
<tr>
<td width="91" valign="top"> C</td>
<td width="180" valign="top"> Normal</td>
</tr>
<tr>
<td width="91" valign="top"> H</td>
<td width="180" valign="top"> On   Hold</td>
</tr>
<tr>
<td width="91" valign="top"> W</td>
<td width="180" valign="top"> Paused</td>
</tr>
<tr>
<td width="91" valign="top"> B</td>
<td width="180" valign="top"> Resuming</td>
</tr>
<tr>
<td width="91" valign="top"> P</td>
<td width="180" valign="top"> Scheduled</td>
</tr>
<tr>
<td width="91" valign="top"> Q</td>
<td width="180" valign="top"> Standby</td>
</tr>
<tr>
<td width="91" valign="top"> S</td>
<td width="180" valign="top"> Suspended</td>
</tr>
<tr>
<td width="91" valign="top"> X</td>
<td width="180" valign="top"> Terminated</td>
</tr>
<tr>
<td width="91" valign="top"> T</td>
<td width="180" valign="top"> Terminating</td>
</tr>
<tr>
<td width="91" valign="top"> A</td>
<td width="180" valign="top"> Waiting</td>
</tr>
<tr>
<td width="91" valign="top"> Z</td>
<td width="180" valign="top"> Waiting</td>
</tr>
<tr>
<td width="91" valign="top"> G</td>
<td width="180" valign="top"> Warning</td>
</tr>
</tbody>
</table>
<left><a class="tt" href="http://twitter.com/home/?status=Oracle+Applications+Concurrent+Request+phase+codes+and+status+codes+http://bit.ly/cKy8Jb" title="Post to Twitter"><img class="nothumb" src="http://www.oratraining.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.oratraining.com/blog/2009/04/oracle-applications-concurrent-request-phase-codes-and-status-codes/&amp;title=Oracle+Applications+Concurrent+Request+phase+codes+and+status+codes" title="Post to Digg"><img class="nothumb" src="http://www.oratraining.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a></left><div class="fblike" style="height:25px; height:25px; overflow:hidden;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.oratraining.com%2Fblog%2F2009%2F04%2Foracle-applications-concurrent-request-phase-codes-and-status-codes%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allow Transparency="true" style="border:none; overflow:hidden; width:450px;"></iframe></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.oratraining.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.oratraining.com/blog/2009/04/oracle-applications-concurrent-request-phase-codes-and-status-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle SQL hints</title>
		<link>http://www.oratraining.com/blog/2009/04/oracle-sql-hints/</link>
		<comments>http://www.oratraining.com/blog/2009/04/oracle-sql-hints/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 06:56:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Applications Performance Tuning]]></category>
		<category><![CDATA[Database Performance Tuning]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle DBA]]></category>
		<category><![CDATA[Concurrent manager]]></category>
		<category><![CDATA[oracle applications]]></category>
		<category><![CDATA[Oracle Applications DBA]]></category>

		<guid isPermaLink="false">http://www.oratraining.com/blog/?p=89</guid>
		<description><![CDATA[/*+ hint */ /*+ hint(argument) */ /*+ hint(argument-1 argument-2) */ All hints except /*+ rule */ cause the CBO to be used. Therefore, it is good practise to analyze the underlying tables if hints are used (or the query is fully hinted. There should be no schema names in hints. Hints must use aliases if [...]]]></description>
			<content:encoded><![CDATA[<p>/*+ hint */</p>
<p>/*+ hint(argument) */</p>
<p>/*+ hint(argument-1 argument-2) */</p>
<p>All hints except /*+ rule */ cause the CBO to be used. Therefore, it is good practise to analyze the underlying tables if hints are used (or the query is <em>fully</em> hinted.</p>
<p>There should be no schema names in hints. Hints must use aliases if alias names are used for table names. So the following is wrong:</p>
<p>select /*+ index(scott.emp ix_emp) */ from scott.emp <strong>emp_alias</strong></p>
<p>better:</p>
<p>select /*+ index(<strong>emp_alias</strong> ix_emp) */ &#8230; from scott.emp <strong>emp_alias</strong></p>
<p><strong>Why using hints</strong></p>
<p><span id="more-89"></span><br />
It is a perfect valid question to ask why hints should be used. Oracle comes with an <span style="text-decoration: underline;">optimizer</span> that promises to optimize a <span style="text-decoration: underline;">query&#8217;s execution plan</span>. When this optimizer is really doing a good job, no hints should be required at all.</p>
<p>Sometimes, however, the characteristics of the data in the database are changing rapidly, so that the optimizer (or more accuratly, its statistics) are out of date. In this case, a hint could help.</p>
<p>It must also be noted, that Oracle allows to <em>lock</em> the statistics when they look ideal which should make the hints meaningless again.</p>
<p><strong>Hint categories</strong></p>
<p>Hints can be categorized as follows:</p>
<ul class="unIndentedList">
<li> Hints for Optimization Approaches and Goals,</li>
<li> Hints for Access Paths, Hints for Query Transformations,</li>
<li> Hints for Join Orders,</li>
<li> Hints for Join Operations,</li>
<li> Hints for Parallel Execution,</li>
<li> Additional Hints</li>
</ul>
<p><strong>Documented Hints</strong></p>
<p><strong>Hints for Optimization Approaches and Goals</strong></p>
<ul class="unIndentedList">
<li> ALL_ROWS<br />
One of the hints that &#8216;invokes&#8217; the <span style="text-decoration: underline;">Cost based optimizer</span><br />
ALL_ROWS is usually used for <em>batch processing</em> or <em>data warehousing</em> systems.</li>
<li> FIRST_ROWS<br />
One of the hints that &#8216;invokes&#8217; the <span style="text-decoration: underline;">Cost based optimizer</span><br />
FIRST_ROWS is usually used for <em>OLTP</em> systems.</li>
<li> CHOOSE<br />
One of the hints that &#8216;invokes&#8217; the <span style="text-decoration: underline;">Cost based optimizer</span><br />
This hint lets the server choose (between ALL_ROWS and FIRST_ROWS, based on <span style="text-decoration: underline;">statistics gathered</span>.</li>
<li> RULE<br />
The RULE hint should be considered deprecated as it is dropped from Oracle9i2.</li>
</ul>
<p>See also the following initialization parameters: <span style="text-decoration: underline;">optimizer_mode</span>, <span style="text-decoration: underline;">optimizer_max_permutations</span>, <span style="text-decoration: underline;">optimizer_index_cost_adj</span>, <span style="text-decoration: underline;">optimizer_index_caching</span> and</p>
<p><strong>Hints for Access Paths</strong></p>
<ul class="unIndentedList">
<li> CLUSTER<br />
Performs a <span style="text-decoration: underline;">nested loop</span> by the cluster index of one of the tables.</li>
<li> FULL<br />
Performs <span style="text-decoration: underline;">full table scan</span>.</li>
<li> HASH<br />
Hashes one table (full scan) and creates a hash index for that table. Then hashes other table and uses hash index to find corresponding records. Therefore not suitable for &lt; or &gt; join conditions.</li>
<li> ROWID<br />
Retrieves the row by <span style="text-decoration: underline;">rowid</span></li>
<li> INDEX<br />
Specifying that index index_name should be used on table tab_name: /*+ index (tab_name index_name) */<br />
Specifying that the index should be used the the <span style="text-decoration: underline;">CBO</span> thinks is most suitable. (Not always a good choice).<br />
Starting with Oracle 10g, the index hint can be described: /*+ index(my_tab my_tab(col_1, col_2)) */. Using the index on my_tab that starts with the columns col_1 and col_2.</li>
<li> INDEX_ASC</li>
<li> INDEX_COMBINE</li>
<li> INDEX_DESC</li>
<li> INDEX_FFS</li>
<li> INDEX_JOIN</li>
<li> NO_INDEX</li>
<li> AND_EQUAL<br />
The AND_EQUAL hint explicitly chooses an execution plan that uses an access path that merges the scans on several single-column indexes</li>
</ul>
<p><strong>Hints for Query Transformations</strong></p>
<ul class="unIndentedList">
<li> FACT<br />
The FACT hint is used in the context of the star transformation to indicate to the transformation that the hinted table should be considered as a fact table.</li>
<li> MERGE</li>
<li> NO_EXPAND</li>
<li> NO_EXPAND_GSET_TO_UNION</li>
<li> NO_FACT</li>
<li> NO_MERGE</li>
<li> NOREWRITE</li>
<li> REWRITE</li>
<li> STAR_TRANSFORMATION</li>
<li> USE_CONCAT</li>
</ul>
<p><strong>Hints for Join Operations</strong></p>
<ul class="unIndentedList">
<li> DRIVING_SITE</li>
<li> HASH_AJ</li>
<li> HASH_SJ</li>
<li> LEADING</li>
<li> MERGE_AJ</li>
<li> MERGE_SJ</li>
<li> NL_AJ</li>
<li> NL_SJ</li>
<li> USE_HASH</li>
<li> USE_MERGE</li>
<li> USE_NL</li>
</ul>
<p><strong>Hints for Parallel Execution</strong></p>
<ul class="unIndentedList">
<li> NOPARALLEL</li>
<li> PARALLEL</li>
<li> NOPARALLEL_INDEX</li>
<li> PARALLEL_INDEX</li>
<li> PQ_DISTRIBUTE</li>
</ul>
<p><strong>Additional Hints</strong></p>
<ul class="unIndentedList">
<li> ANTIJOIN <a name="append"></a></li>
<li> APPEND<br />
If a table or an index is specified with <span style="text-decoration: underline;">nologging</span>, this hint applied with an insert statement produces a <strong>direct path insert</strong> which reduces generation of <span style="text-decoration: underline;">redo</span>.</li>
<li> BITMAP</li>
<li> BUFFER</li>
<li> CACHE</li>
<li> CARDINALITY</li>
<li> CPU_COSTING</li>
<li> <span style="text-decoration: underline;">DYNAMIC_SAMPLING</span></li>
<li> INLINE</li>
<li> MATERIALIZE</li>
<li> NO_ACCESS</li>
<li> NO_BUFFER</li>
<li> NO_MONITORING</li>
<li> NO_PUSH_PRED</li>
<li> NO_PUSH_SUBQ</li>
<li> NO_QKN_BUFF</li>
<li> NO_SEMIJOIN</li>
<li> NOAPPEND</li>
<li> NOCACHE</li>
<li> OR_EXPAND</li>
<li> ORDERED</li>
<li> ORDERED_PREDICATES</li>
<li> PUSH_PRED</li>
<li> PUSH_SUBQ</li>
<li> <span style="text-decoration: underline;">QB_NAME</span></li>
<li> <span style="text-decoration: underline;">RESULT_CACHE</span> (<span style="text-decoration: underline;">Oracle 11g</span>)</li>
<li> SELECTIVITY</li>
<li> SEMIJOIN</li>
<li> SEMIJOIN_DRIVER</li>
<li> STAR<br />
The STAR hint forces a star query plan to be used, if possible. A star plan has the largest table in the query last in the join order and joins it with a nested loops join on a concatenated index. The STAR hint applies when there are at least three tables, the large table&#8217;s concatenated index has at least three columns, and there are no conflicting access or join method hints. The optimizer also considers different permutations of the small tables.</li>
<li> SWAP_JOIN_INPUTS</li>
<li> USE_ANTI</li>
<li> USE_SEMI</li>
</ul>
<p><strong>Undocumented hints:</strong></p>
<ul class="unIndentedList">
<li> BYPASS_RECURSIVE_CHECK<br />
Workaraound for bug 1816154</li>
<li> BYPASS_UJVC</li>
<li> CACHE_CB</li>
<li> CACHE_TEMP_TABLE</li>
<li> CIV_GB</li>
<li> COLLECTIONS_GET_REFS</li>
<li> CUBE_GB</li>
<li> CURSOR_SHARING_EXACT</li>
<li> DEREF_NO_REWRITE</li>
<li> DML_UPDATE</li>
<li> DOMAIN_INDEX_NO_SORT</li>
<li> DOMAIN_INDEX_SORT</li>
<li> DYNAMIC_SAMPLING</li>
<li> DYNAMIC_SAMPLING_EST_CDN</li>
<li> EXPAND_GSET_TO_UNION</li>
<li> FORCE_SAMPLE_BLOCK</li>
<li> GBY_CONC_ROLLUP</li>
<li> GLOBAL_TABLE_HINTS</li>
<li> HWM_BROKERED</li>
<li> IGNORE_ON_CLAUSE</li>
<li> IGNORE_WHERE_CLAUSE</li>
<li> INDEX_RRS</li>
<li> INDEX_SS</li>
<li> INDEX_SS_ASC</li>
<li> INDEX_SS_DESC</li>
<li> LIKE_EXPAND</li>
<li> LOCAL_INDEXES</li>
<li> MV_MERGE</li>
<li> NESTED_TABLE_GET_REFS</li>
<li> NESTED_TABLE_SET_REFS</li>
<li> NESTED_TABLE_SET_SETID</li>
<li> NO_FILTERING</li>
<li> NO_ORDER_ROLLUPS</li>
<li> NO_PRUNE_GSETS</li>
<li> NO_STATS_GSETS</li>
<li> NO_UNNEST</li>
<li> NOCPU_COSTING</li>
<li> OVERFLOW_NOMOVE</li>
<li> PIV_GB</li>
<li> PIV_SSF</li>
<li> PQ_MAP</li>
<li> PQ_NOMAP</li>
<li> REMOTE_MAPPED</li>
<li> RESTORE_AS_INTERVALS</li>
<li> SAVE_AS_INTERVALS</li>
<li> SCN_ASCENDING</li>
<li> SKIP_EXT_OPTIMIZER</li>
<li> SQLLDR</li>
<li> SYS_DL_CURSOR</li>
<li> SYS_PARALLEL_TXN</li>
<li> SYS_RID_ORDER</li>
<li> TIV_GB</li>
<li> TIV_SSF</li>
<li> UNNEST</li>
<li> USE_TTT_FOR_GSETS</li>
</ul>
<left><a class="tt" href="http://twitter.com/home/?status=Oracle+SQL+hints+http://bit.ly/dC2dGR" title="Post to Twitter"><img class="nothumb" src="http://www.oratraining.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter-big3.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.oratraining.com/blog/2009/04/oracle-sql-hints/&amp;title=Oracle+SQL+hints" title="Post to Digg"><img class="nothumb" src="http://www.oratraining.com/blog/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a></left><div class="fblike" style="height:25px; height:25px; overflow:hidden;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.oratraining.com%2Fblog%2F2009%2F04%2Foracle-sql-hints%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allow Transparency="true" style="border:none; overflow:hidden; width:450px;"></iframe></div><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.oratraining.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.oratraining.com/blog/2009/04/oracle-sql-hints/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
