You are on page 1of 5

1/3/2020 cmclean.

sql : Cleaning the Concurrent Manager tables | ORACLE CLOUD ADMIN BLOG
Advertisements

REPORT THIS AD

ORACLE CLOUD ADMIN BLOG


This Blog dedicated to Oracle DBA & Apps DBA & Oracle ICS / OIC

Ads cmclean.sql : Cleaning the Concurrent Manager tables


To cleanup running and pending requests we use cmclean.sql, If we stop
Search concurrent managers using abort options then concurrent requests will be in
running state ,Next when we start concurrent manager the processes will not
start properly.
Categories
Basic UNIX
CMCLEAN will update below tables:
1) FND_CONCURRENT_QUEUES
Oracle Apps DBA
2) FND_CONCURRENT_PROCESSES
R12.2
3) FND_CONCURRENT_REQUESTS
Oracle CLOUD
4) FND_CONFLICTS_DOMAIN
Oracle Cloud ICS / OIC 5) FND_CONCURRENT_CONFLICT_SETS
ORACLE DBA
DataGuard GET CMCLEAN SCRIPT FROM ORACLE NOTEID:
Oracle database Concurrent Processing – cmclean.sql – Non Destructive Script to Clean
RMAN Concurrent Manager Tables [ID 134007.1]
WEBLOGIC
—- SCRIPT —-
****************
Archives
REM
March 2019 (1) REM FILENAME
February 2019 (12) REM cmclean.sql
June 2018 (8) REM DESCRIPTION
August 2016 (2) REM Clean out the concurrent manager tables
July 2016 (2) REM NOTES
June 2016 (2)
REM Usage: sqlplus @cmclean
REM
May 2016 (1)
REM
January 2016 (1)
REM $Id: cmclean.sql,v 1.4 2001/04/07 15:55:07 pferguso Exp $
December 2015 (1) REM
October 2015 (1) REM
August 2014 (1) REM
July 2014 (4) +===================================================================
June 2014 (2) set verify off;
May 2014 (2)
set head off;
set timing off
April 2014 (1)
set pagesize 1000
March 2014 (2)
column manager format a20 heading ‘Manager short name’
February 2014 (15) column pid heading ‘Process id’
January 2014 (3) column pscode format a12 heading ‘Status code’
December 2013 (2) column ccode format a12 heading ‘Control code’
November 2013 (17) column request heading ‘Request ID’
October 2013 (8) column pcode format a6 heading ‘Phase’
column scode format a6 heading ‘Status’
WHENEVER SQLERROR EXIT ROLLBACK;
Subscribe to Blog via DOCUMENT
Email WARNING : Do not run this script without explicit instructions
from Oracle Support
*** Make sure that the managers are shut down ***

https://oracle-admin.com/2013/11/10/cmclean-sql-cleaning-the-concurrent-manager-tables/ 1/5
1/3/2020 cmclean.sql : Cleaning the Concurrent Manager tables | ORACLE CLOUD ADMIN BLOG

Enter your email address to *** before running this script ***
subscribe to this blog and *** If the concurrent managers are NOT shut down, ***
*** exit this script now !! ***
receive notifications of new
#
posts by email. accept answer prompt ‘If you wish to continue type the word ”dual”: ‘
set feed off
Join 164 other subscribers select null from &answer;
set feed on
Email Address REM Update process status codes to TERMINATED
prompt
Subscribe prompt ————————————————————————
prompt — Updating invalid process status codes in
FND_CONCURRENT_PROCESSES
set feedback off
set head on
break on manager
SELECT concurrent_queue_name manager,
concurrent_process_id pid,
process_status_code pscode
FROM fnd_concurrent_queues fcq, fnd_concurrent_processes fcp
WHERE process_status_code not in (‘K’, ‘S’)
AND fcq.concurrent_queue_id = fcp.concurrent_queue_id
AND fcq.application_id = fcp.queue_application_id;
set head off
set feedback on
UPDATE fnd_concurrent_processes
SET process_status_code = ‘K’
WHERE process_status_code not in (‘K’, ‘S’);
REM Set all managers to 0 processes
prompt
prompt ————————————————————————
prompt — Updating running processes in FND_CONCURRENT_QUEUES
prompt — Setting running_processes = 0 and max_processes = 0 for all managers
UPDATE fnd_concurrent_queues
SET running_processes = 0, max_processes = 0;
REM Reset control codes
prompt
prompt ————————————————————————
prompt — Updating invalid control_codes in FND_CONCURRENT_QUEUES
set feedback off
set head on
SELECT concurrent_queue_name manager,
control_code ccode
FROM fnd_concurrent_queues
WHERE control_code not in (‘E’, ‘R’, ‘X’)
AND control_code IS NOT NULL;
set feedback on
set head off
UPDATE fnd_concurrent_queues
SET control_code = NULL
WHERE control_code not in (‘E’, ‘R’, ‘X’)
AND control_code IS NOT NULL;
REM Also null out target_node for all managers
UPDATE fnd_concurrent_queues
SET target_node = null;
REM Set all ‘Terminating’ requests to Completed/Error
REM Also set Running requests to completed, since the managers are down
prompt
prompt ————————————————————————
prompt — Updating any Running or Terminating requests to Completed/Error
canceled by CMCLEAN
set feedback off
set head on
SELECT request_id request,
phase_code pcode,
status_code scode
FROM fnd_concurrent_requests
WHERE status_code = ‘T’ OR phase_code = ‘R’
https://oracle-admin.com/2013/11/10/cmclean-sql-cleaning-the-concurrent-manager-tables/ 2/5
1/3/2020 cmclean.sql : Cleaning the Concurrent Manager tables | ORACLE CLOUD ADMIN BLOG
ORDER BY request_id;
set feedback on
set head off
UPDATE fnd_concurrent_requests
SET phase_code = ‘C’, status_code = ‘E’
WHERE status_code =’T’ OR phase_code = ‘R’;
REM Set all Runalone flags to ‘N’
REM This has to be done differently for Release 10
prompt
prompt ————————————————————————
prompt — Updating any Runalone flags to ‘N’
prompt
set serveroutput on
set feedback off
declare
c pls_integer := dbms_sql.open_cursor;
upd_rows pls_integer;
vers varchar2(50);
tbl varchar2(50);
col varchar2(50);
statement varchar2(255);
begin
select substr(release_name, 1, 2)
into vers
from fnd_product_groups;
if vers >= 11 then
tbl := ‘fnd_conflicts_domain’;
col := ‘runalone_flag’;
else
tbl := ‘fnd_concurrent_conflict_sets’;
col := ‘run_alone_flag’;
end if;
statement := ‘update ‘ || tbl || ‘ set ‘ || col || ‘=”N” where ‘ || col || ‘ = ”Y”’;
dbms_sql.parse(c, statement, dbms_sql.native);
upd_rows := dbms_sql.execute(c);
dbms_sql.close_cursor(c);
dbms_output.put_line(‘Updated ‘ || upd_rows || ‘ rows of ‘ || col || ‘ in ‘ || tbl || ‘ to
”N”’);
end;
/
prompt
prompt ————————————————————————
prompt Updates complete.
prompt Type commit now to commit these updates, or rollback to cancel.
prompt ————————————————————————
prompt
set feedback on
REM <= Last REM statment —————————————————–
Disclaimer
EXCEPT WHERE EXPRESSLY PROVIDED OTHERWISE, THE INFORMATION,
SOFTWARE,
PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS. ORACLE EXPRESSLY
DISCLAIMS
ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED,
INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR
PURPOSE AND NON-INFRINGEMENT. ORACLE MAKES NO WARRANTY
THAT: (A) THE RESULTS
THAT MAY BE OBTAINED FROM THE USE OF THE SOFTWARE WILL BE
ACCURATE OR
RELIABLE; OR (B) THE INFORMATION, OR OTHER MATERIAL OBTAINED
WILL MEET YOUR
EXPECTATIONS. ANY CONTENT, MATERIALS, INFORMATION OR SOFTWARE
DOWNLOADED OR
OTHERWISE OBTAINED IS DONE AT YOUR OWN DISCRETION AND RISK.
ORACLE SHALL HAVE
NO RESPONSIBILITY FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR
https://oracle-admin.com/2013/11/10/cmclean-sql-cleaning-the-concurrent-manager-tables/ 3/5
1/3/2020 cmclean.sql : Cleaning the Concurrent Manager tables | ORACLE CLOUD ADMIN BLOG
LOSS OF DATA THAT
RESULTS FROM THE DOWNLOAD OF ANY CONTENT, MATERIALS,
INFORMATION OR SOFTWARE.
ORACLE RESERVES THE RIGHT TO MAKE CHANGES OR UPDATES TO THE
SOFTWARE AT ANY
TIME WITHOUT NOTICE.
Limitation of Liability
IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL,
SPECIAL OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR LOSS OF
PROFITS, REVENUE,
DATA OR USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN
ACTION IN
CONTRACT OR TORT, ARISING FROM YOUR ACCESS TO, OR USE OF, THE
SOFTWARE.
SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OR EXCLUSION OF
LIABILITY.
ACCORDINGLY, SOME OF THE ABOVE LIMITATIONS MAY NOT APPLY TO
YOU.

Advertisements

REPORT THIS AD

REPORT THIS AD

Share this:

 Twitter  Facebook

Like this:

Loading...

https://oracle-admin.com/2013/11/10/cmclean-sql-cleaning-the-concurrent-manager-tables/ 4/5
1/3/2020 cmclean.sql : Cleaning the Concurrent Manager tables | ORACLE CLOUD ADMIN BLOG

By Oracle-DBA-masters, on November 10, 2013 at 4:10 pm, under Oracle Apps DBA. Tags:
cmclean.sql. No Comments
Post a comment or leave a trackback: Trackback URL.

« How To Clear Cache – R12 HOW TO FIND APPS PASSWORD – R12 »

Leave a Reply

Enter your comment here...

This site uses Akismet to reduce spam. Learn how your comment data is
processed.

|.

https://oracle-admin.com/2013/11/10/cmclean-sql-cleaning-the-concurrent-manager-tables/ 5/5

You might also like