Tuesday, August 2, 2011

cmclean.sql

REM
REM FILENAME
REM cmclean.sql
REM DESCRIPTION
REM Clean out the concurrent manager tables
REM NOTES
REM Usage: sqlplus @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 a20 heading 'Manager short name'
column pid heading 'Process id'
column pscode format a12 heading 'Status code'
column ccode format a12 heading 'Control code'
column request heading 'Request ID'
column pcode format a6 heading 'Phase'
column scode format a6 heading 'Status'


WHENEVER SQLERROR EXIT ROLLBACK;

DOCUMENT

WARNING : Do not run this script without explicit instructions
from Oracle Support


*** Make sure that the managers are shut down ***
*** before running this script ***

*** If the concurrent managers are NOT shut down, ***
*** exit this script now !! ***

#

accept answer prompt 'If you wish to continue type the word ''dual'': '

set feed off
select null from &answer;
set feed on


REM Update process status codes to TERMINATED

prompt
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
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'
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 -----------------------------------------------------

Enable FRD in 11i

How to Enable FRD trace in 11i.

1. Make the user value for profile option 'ICX: Forms Launcher' the same as the site value
e.g. copy value of ICX: Forms Launcher for the site Test115
'http://testserver.oracle.com:8005/dev60cgi/f60cgi'
to be the value for the user.
2. Append the user value of ICX: Forms Launcher with the Forms parameters for FRD
e.g. update the value of ICX: Forms Launcher for the user to be
'http://testserver.oracle.com:8005/dev60cgi/f60cgi?record=all&log=/tmp/username_frd.log
3. Login to the Personal Home Page, navigate to the form and perform the steps that you wish to trace.
4. Locate the file in the directory set by variable $FORMS60_TRACE_PATH. Note: the default directory for
$FORMS60_TRACE_PATH is $ORACLE_HOME/forms60/log.

Autoconfig steps in ecsprod

BEFORE AUTOCONFIG

Internal and External Nodes

· Save context files
· cp $TNS_ADMIN/tnsnames.ora $TNS_ADMIN/tnsnames.ora.preauto
· cp $FND_SECURE/ecsprod.dbc $FND_SECURE/ecsprod.dbc.preauto
· Save jserv.properties and zone.properties
· Add xml entry for smtp host if it is not done already.
· Commentout cron jobs on rh132 and rh133

Internal Nodes

· cp $OA_HTML/bin/appsweb_$CONTEXT_NAME.cfg $OA_HTML/bin/appsweb_$CONTEXT_NAME.cfg.preauto
· cp $COMMON_TOP/admin/scripts/$CONTEXT_NAME/adfrmctl.sh $COMMON_TOP/admin/scripts/$CONTEXT_NAME/adfrmctl.sh.preauto
(this is needed because the DIRTMP environment variable is customized and cannot be set in the context file)


External Nodes

· cp $IAS_CONFIG_HOME/Apache/Apache/conf/url_fw.conf $IAS_CONFIG_HOME/Apache/Apache/conf/url_fw.conf.preauto


Database

· Rename workflow tables and create temporary workflow tables from the original workflow tables.



AFTER AUTOCONFIG

Internal and External Nodes

· Take out the entries created for the database services from the tnsnames.ora file – they already exist in the include file


Internal Nodes

· put back the Markview entries in the .cfg files - this step should be eliminated with Begin/End Customization or some other methodology - in all environments we should have .cfg.170 files that include the Markview entries and are not overwritten by autoconfig
· make sure "ICX: Forms Launcher" has "?config=170systems" appended to the end for Site Level and all the internal server level- this step will be eliminated as well - John has the solution
· create new _reporting.dbc DBC file from $FND_SECURE similar to DBC file used for discoverer (check with Matt) - this should use the _reporting service
· send _reporting.dbc to the Discoverer admins (Jason Dimmer) + Discoverer middle tier admins (Krishnan)
· fix CITRIX ADI by putting in the new server ID form the DBC file - once this is done inform Skip and he will propagate the change to all users
· make sure the workflow configurations are were not lost – recreate them if they were
· make sure that in the file $COMMON_TOP/admin/scripts/$CONTEXT_NAME/adfrmctl.sh the environment variable DIRTMP is set to the pre-autoconfig value


External Nodes

· jdbc entry in the .dbc file should use the external service

APPS_JDBC_URL=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=usmliu112-vip.arrow.com)(PORT=1521))(ADDRESS=(PROTOCOL=tcp)(HOST=usmliu111-vip.arrow.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ecsprod_external)))
· Copy jserv.properties from backup for double-click fix.
· Replace this section from the $IAS_CONFIG_HOME/Apache/Apache/conf/url_fw.conf

#======================================================================
#Include URLs for product OIR (iReceivables)
#======================================================================

#RewriteRule ^/OA_HTML/AnonymousLogin\.jsp$ - [L]
#RewriteRule ^/OA_HTML/SelfRegistration\.jsp$ - [L]

WITH:

#======================================================================
#Include URLs for product OIR (iReceivables)
#======================================================================

RewriteRule ^/OA_HTML/AnonymousLogin\.jsp$ - [L]
RewriteRule ^/OA_HTML/SelfRegistration\.jsp$ - [L]
RewriteRule ^/OA_CGI/FNDWRR\.exe$ - [L]

· Prepare new DBC file for reporting with the reporting service if needed – follow the above example and use ecsprod_reporting instead of ecsprod_external.
· Fix broken link between GFS and Ascent if we change the apps password.


Database

· Rename backup copy of workflow tables to actual names.