Sunday, January 29, 2012

DMZ Configuration For R12


(1) Make sure a cold backup taken before start the DMZ configration:
(2) Startup database and database listener only on both RAC nodes (srohsnoil33 and srohsnoil34)
(3) run the script to change the profile options hierarchy type values to SERVRESP
(3.1) log into primay MT (srohsnoil008) as apsroi1i user
(3.2) $ cd $FND_TOP/patch/115/sql
(3.3) connect as APPS user

$ sqlplus apps/<apps_passwd>
SQL> @txkChangeProfH.sql SERVRESP

(4) Backup xml file first
-- /sroi1i/inst/apps/sroi1i_srohsnoil013/appl/admin/sroi1i_srohsnoil013.xml
-- /sroi1i/inst/apps/sroi1i_srohsnoil009/appl/admin/sroi1i_srohsnoil009.xml
-- /sroi1i/inst/apps/sroi1i_srohsnoil010/appl/admin/sroi1i_srohsnoil010.xml
-- /sroi1i/inst/apps/sroi1i_srohsnoil012/appl/admin/sroi1i_srohsnoil012.xml
-- /sroi1i/inst/apps/sroi1i_srohsnoil008/appl/admin/sroi1i_srohsnoil008.xml
-- /sroi1i/inst/apps/sroi1i_srohsnoil011/appl/admin/sroi1i_srohsnoil011.xml

(4) Run Autoconfig on DMZ node first:
(4.1) Log into DMZ node (srohsnoil013) as apsroi1i user

Backup original xml files first
$ cd $AD_TOP/bin
$ ./adconfig.sh run=INSTE8_SETUP contextfile=/sroi1i/inst/apps/sroi1i_srohsnoil013/appl/admin/sroi1i_srohsnoil013.xml appspass=<apps_passwd>

Log out and log back in to source env files

(5) Run Autoconfig on additional MT's with the following order:
(5.1) Run autoconfig on srohsnoil009

$ cd $AD_TOP/bin
$ ./adconfig.sh run=INSTE8_SETUP contextfile=/sroi1i/inst/apps/sroi1i_srohsnoil009/appl/admin/sroi1i_srohsnoil009.xml appspass=<apps_passwd>

Log out and log back in to source env files
(5.2) Run autoconfig on srohsnoil010

$ cd $AD_TOP/bin
$ ./adconfig.sh run=INSTE8_SETUP contextfile=/sroi1i/inst/apps/sroi1i_srohsnoil010/appl/admin/sroi1i_srohsnoil010.xml appspass=<apps_passwd>

Log out and log back in to source env files
(5.3) Run autoconfig on srohsnoil012
$ cd $AD_TOP/bin
$ ./adconfig.sh run=INSTE8_SETUP contextfile=/sroi1i/inst/apps/sroi1i_srohsnoil012/appl/admin/sroi1i_srohsnoil012.xml appspass=<apps_passwd>

Log out and log back in to source env files

(6) Run Autoconfig on PCP nodes:
(6.1) Run autoconfig on PCP-2 node, srohsnoil011:

$ cd $AD_TOP/bin
$ ./adconfig.sh contextfile=/sroi1i/inst/apps/sroi1i_srohsnoil011/appl/admin/sroi1i_srohsnoil011.xml appspass=<apps_passwd>

Log out and log back in to source env files
(6.2) Run autoconfig on PCP-1 node, srohsnoil008:
$ cd $AD_TOP/bin
$ ./adconfig.sh contextfile=/sroi1i/inst/apps/sroi1i_srohsnoil008/appl/admin/sroi1i_srohsnoil008.xml appspass=<apps_passwd>

Log out and log back in to source env files

(7) Start up the Application only on Primary MT (srohsnoil008)
(8) Log into sroi1i Application, and Verify 'Hierarchy Type' is set to 'Server-Responsibility'

Login to Application as SYSADMIN with Application Developer responsibility.

Navigate to Application Developer ==> Profile
Query for 'APPS_WEB_AGENT' ==> and verify the field 'Hierarchy Type' from 'Security' to 'Server-Responsibility'
Query for 'APPS_SERVLET_AGENT'  ==> and verify the field 'Hierarchy Type' from 'Security' to 'Server-Responsibility'
Query for 'APPS_JSP_AGENT' ==> and verify the field 'Hierarchy Type' from 'Security' to 'Server-Responsibility'
Query for 'APPS_FRAMEWORK_AGENT' ==> and verify the field 'Hierarchy Type' from 'Security' to 'Server-Responsibility'

(9) Node Trust Level profile option verify and/or Change

Change the responsibility to "System Administrator"
Navigate to Profile ==> System ==> Click on 'Server', enter 'srohsnoil013' ==>  Query for the profile option 'Node Trust Level', and scroll on RIGHT to see the server name.
==> Click on find ==> On the server level for srohsnoil013 change value from blank to 'External'
==>  Save the record.

(10) Responsiblities Trust Level profile option verify and/or Change
(10.1) The list responsibilities of DMZ are :
HR Employee Self Service I
HR Employee Self Service II
HR Employee Self Service III
HR Employee Self Service IV
HR Employee Self Service V
HR Employee Self Service VII
HR Employee Self Service VIII
HR Employee Self Service XX
HR Employee Self Service SG

(10.2) As "System Administrator" responsibility ==> Navigate to Profile ==> System ==> Click on 'Responbsibility', enter 'HR Employee Self Service%'
==> Query for "Responsibility Trust Level", scroll on RIGHT to see the Responsibility name

it should show 'External'

(10.3) Repeat Step (9.2) for all the listed responsibilities
(11) Profile Change: The profile change should only occur at SERVER level

(11.1) APPS_FRAMEWORK_AGENT (make sure there's no '/' at the end for SERVER level profile)
As "System Administrator" responsibility ==> Navigate to Profile ==> System
==> Click on 'Server', enter 'srohsnoil013' ==> Query for the profile option 'Application Framework Agent', scroll on RIGHT to see the server name.
==> Click on find ==> on the server level for srohsnoil013 change value to "https://sriamyhcmw.srv.com:443"
==> Save the record.

(11.2) APPS_JSP_AGENT (make sure there's no '/' at the end for SERVER level profile)
As "System Administrator" responsibility ==> Navigate to Profile ==> System
==> Click on 'Server', enter 'srohsnoil013' ==> Query for the profile option 'Applications JSP Agent', scroll on RIGHT to see the server name.
==> Click on find ==> on the server level for srohsnoil013 change value to "https://sriamyhcmw.srv.com:443"
==> Save the record.

(11.3) APPS_WEB_AGENT  (make sure there's no '/' at the end for SERVER level profile)
As "System Administrator" responsibility ==> Navigate to Profile ==> System
==> Click on 'Server', enter 'srohsnoil013' ==> Query for the profile option 'Applications Web Agent', scroll on RIGHT to see the server name.
==> Click on find ==> on the server level for srohsnoil013 change value to "https://sriamyhcmw.srv.com:443/pls/sroi1i"
==> Save the record.

(11.4) APPS_SERVLET_AGENT (make sure there's no '/' at the end for SERVER level profile)
As "System Administrator" responsibility ==> Navigate to Profile ==> System
==> Click on 'Server', enter 'srohsnoil013' ==> Query for the profile option 'Apps Servlet Agent', scroll on RIGHT to see the server name.
==> Click on find ==> on the server level for srohsnoil013 change value to "https://sriamyhcmw.srv.com:443/OA_HTML"
==> Save the record.

(12) Assign one of the Responsiblities in (10.1) to SYSADMIN
-- For example: HR Employee Self Service I
(13) Startup MT processes on PCP-2 node (srohsnoil011)
(14) Startup MT processes on DMZ node (srohsnoil013)
(15) Log into DMZ url (https://sriamyhcmw.srv.com) and verify the resonsibility is accessible

HANDY APPS SCRIPTS


Find any profile Values
======================
select PROFILE_OPTION_VALUE from FND_PROFILE_OPTION_VALUES where
PROFILE_OPTION_ID=(Select PROFILE_OPTION_ID from fnd_profile_options where PROFILE_OPTION_NAME ='WF_MAIL_WEB_AGENT');

This is the list of few profile options which Apps DBA use frequently. It is not necessary that you as Apps DBA must know all profile options,
it depends on your implemnetation.

Applications Help Web Agent
Applications Servlet Agent
Applications Web Agent
Concurrent: Active Request Limit
Concurrent: Hold Requests
Concurrent: Multiple Time Zones
Concurrent: Report Access Level
Concurrent: Report Copies
Concurrent: Request priority
Database Instance
Enable Security Group
FND: Debug Log Filename
FND: Debug Log Level
Forms Runtime Parameters
Gateway User ID
ICX: Discoverer Launcher
ICX: Forms Launcher
ICX: Report Launcher
ICX: Limit Connect
ICX: Limit time
ICX: Session Timeout
MO Operating Unit
Node Trust Level
RRA: Delete Temporary Files
RRA: Enabled
RRA: Service Prefix
RRA: Maximum Transfer Size
Self Service Personal Home Page Mode
Sign-On: Audit Level
Signon Password Failure Limit
Signon Password Hard to Guess
Signon Password Length
Signon Password No Reuse
Site Name
Socket Listener Port
TCF: Host
TCF: Port
TWO TASK

Spid.sql

select sid, b.serial#, osuser, b.username, status, process, paddr, spid
from v$process a,v$session b
where spid = '&spid'
and a.addr = b.paddr
and b.username != ' '
order by 1
/

Applied_Patches_11i.sql


  REM
  REM Applied_Patches_11i.sql - used to create 11i Applied_Patches_Report.txt
  REM
   set feedback off
   set linesize 80
   set pagesize 9000

   column patch_name head Bug format a10
   column application_short_name head Product format a7
   column patch_type head Patch_Type format a16
   column patch_level head Patch_Level format a12
   column last_update_date head Applied format a11
   column ReportDate head ReportDate format a20

   prompt
   prompt 11i Applied Patches by Most Recently Applied Date

   SELECT sysdate ReportDate FROM dual;

   SELECT distinct ap.patch_name,
          decode(ab.application_short_name, null, mini.app_short_name,
          ab.application_short_name) application_short_name,
          ap.patch_type patch_type,  mini.patch_level patch_level,
          ap.last_update_date Applied
     FROM applsys.ad_bugs ab, applsys.ad_applied_patches ap,
          applsys.ad_patch_drivers pd, applsys.ad_patch_driver_minipks mini
    WHERE ab.bug_number = ap.patch_name
          and ap.applied_patch_id = pd.applied_patch_id
          and pd.patch_driver_id = mini.patch_driver_id(+)
   ORDER BY ap.last_update_date desc;



shrink_rbs.sql

@rseg
@rbs_info2
select 'alter rollback segment '||r.name ||' shrink ;'
from   v$rollname r,
       v$rollstat s
where s.usn = r.usn
and r.name != 'SYSTEM'
  and  r.name not in  (
                select r.name rname
                from   v$lock l,
                       v$process p,
                       v$rollname r,
                       v$rollstat s,
                       v$session  s1
                where  l.sid = s1.sid (+)
                and    trunc(l.id1(+)/65536) = r.usn
                and    l.type(+) = 'TX'
                and    l.lmode (+) = 6
                and    s.usn = r.usn
                and    s1.paddr = p.addr
                )
/

Rseg

select r.name rname,
       s.rssize "size"
from   v$rollname r,
       v$rollstat s
where s.usn = r.usn
/

rbs_info2

set lines 80
set pages 68
col username format a8
col rname format a7
col sid format 9999
col userid format a8
select r.name rname ,
       p.pid "PID",
       p.spid "SPID",
       NVL(p.username, 'NO TRANSACTION') "USERID",
       p.terminal,
       s.rssize "SIZE"
 ,    s1.username "USERNAME"
  ,    s1.sid
from   v$lock l,
       v$process p,
       v$rollname r,
       v$rollstat s,
       v$session  s1
where  l.sid = s1.sid (+)
and    trunc(l.id1(+)/65536) = r.usn
and    l.type(+) = 'TX'
and    l.lmode (+) = 6
and    s.usn = r.usn
and    s1.paddr = p.addr
order by r.name
/

user_sess.sql

Select distinct usr.user_name
from applsys.fnd_logins l, applsys.fnd_user usr, v$session sess
Where l.user_id =usr.user_id and l.spid = sess.process and l.end_time is null order by usr.user_name;

fnd_waiting_jobs.sql

REM $Header: afrqwait.sql 115.3 2000/01/10 12:25:25 pkm ship $
REM +======================================================================+
REM |   Copyright (c) 1992 Oracle Corporation Belmont, California, USA     |
REM |                       All rights reserved.                           |
REM +======================================================================+
REM FILENAME
REM   pendingi.sql
REM DESCRIPTION
REM   Selects all the Pending Requests with status Q
REM
REM           Ram Bhoopalam   Created
REM +======================================================================+

Set Pages 58
Set Linesize 80

Column Reqst     Format 9999999
Column Orcl      Format A8
Column Priority  Format 99999
Column Program   Format A25
Column Start_At  Format A15
Column Req_Date  Format A15

Column Reqst    HEADING 'Request|ID'
Column Orcl     HEADING 'Oracle|Name'
Column Priority HEADING 'Priority'
Column Program  HEADING 'Program'
Column Req_Date HEADING 'Requested at'
Column Start_At HEADING 'To Start at'

Break On Report
Comput Count OF Reqst ON Report

TTITLE 'Pending for Conflict Resolution Manager'

select request_id Reqst,
       User_Concurrent_Program_Name Program,
       To_Char(Request_Date, 'MM-DD-YY HH24:MI') Req_Date,
       To_Char(Requested_Start_Date, 'MM-DD-YY HH24:MI') Start_At
from fnd_concurrent_requests Fcr, Fnd_Concurrent_Programs_TL Fcp,
     fnd_oracle_userid O
where Status_Code = 'Q'
  And (
       Fcr.Concurrent_Program_Id = Fcp.Concurrent_Program_Id And
          Program_Application_ID = Application_ID )
  And  Hold_Flag = 'N'
  And  Fcr.Oracle_ID = O.Oracle_ID
  And  Requested_Start_Date <= Sysdate
Order By  Requested_Start_Date Asc,
          Decode(Priority, Null, 9999999, Priority) Asc,
          Request_ID Asc
/


TTITLE 'Pending for Conflict Resolution Manager|( requested to run at a later time )'

select request_id Reqst,
       User_Concurrent_Program_Name Program,
       To_Char(Request_Date, 'MM-DD-YY HH24:MI') Req_Date,
       To_Char(Requested_Start_Date, 'MM-DD-YY HH24:MI') Start_At
from fnd_concurrent_requests Fcr, Fnd_Concurrent_Programs_TL Fcp,
     fnd_oracle_userid O
where Status_Code = 'Q'
  And (
       Fcr.Concurrent_Program_Id = Fcp.Concurrent_Program_Id And
          Program_Application_ID = Application_ID )
  And  Hold_Flag = 'N'
  And  Fcr.Oracle_ID = O.Oracle_ID
  And  Requested_Start_Date > Sysdate
Order By  Requested_Start_Date Asc,
          Decode(Priority, Null, 9999999, Priority) Asc,
          Request_ID Asc
/


TTITLE 'Pending for Conflict Resolution Manager|( on Hold )'

select request_id Reqst,
       User_Concurrent_Program_Name Program,
       To_Char(Request_Date, 'MM-DD-YY HH24:MI') Req_Date,
       To_Char(Requested_Start_Date, 'MM-DD-YY HH24:MI') Start_At
from fnd_concurrent_requests Fcr, Fnd_Concurrent_Programs_TL Fcp,
     fnd_oracle_userid O
where Status_Code = 'Q'
  And (
       Fcr.Concurrent_Program_Id = Fcp.Concurrent_Program_Id And
          Program_Application_ID = Application_ID )
  And  Hold_Flag = 'Y'
  And  Fcr.Oracle_ID = O.Oracle_ID
Order By  Requested_Start_Date Asc,
          Decode(Priority, Null, 9999999, Priority) Asc,
          Request_ID Asc
/


TTITLE 'Waiting Concurrent Requests'

select request_id Reqst,
       User_Concurrent_Program_Name Program,
       To_Char(Request_Date, 'MM-DD-YY HH24:MI') Req_Date,
       To_Char(Requested_Start_Date, 'MM-DD-YY HH24:MI') Start_At
from fnd_concurrent_requests Fcr, Fnd_Concurrent_Programs_TL Fcp,
     fnd_oracle_userid O
where Status_Code = 'A'
  And (
       Fcr.Concurrent_Program_Id = Fcp.Concurrent_Program_Id And
          Program_Application_ID = Application_ID )
  And  Fcr.Oracle_ID = O.Oracle_ID
Order By  Requested_Start_Date Asc,
          Decode(Priority, Null, 9999999, Priority) Asc,
          Request_ID Asc
/


TTITLE OFF
Set Pages 60
Set Linesize 80
Clear Breaks
Clear Computes

lock.sql

declare cursor c1 is
 select * from v$lock where request != 0 order by id1, id2;
 wid1            number := -999999;
 wid2            number := -999999;
 wholder_detail  varchar2(200);
 v_err_msg          varchar2(80);
 wsid            number(5);
 wstep           number(2);
 wtype           varchar2(10);
 wobject_name    varchar2(180);
 wobject_name1   varchar2(80);
 wlock_type      varchar2(50);
 w_lastcallet     varchar2(11);
 h_lastcallet     varchar2(11);
   begin
     for c1_rec in c1 loop
       if c1_rec.id1 = wid1 and c1_rec.id2 = wid2 then
          null;
       else
          wstep  := 10;
          select sid , type into wsid , wtype
            from v$lock
            where id1  = c1_rec.id1
              and id2  = c1_rec.id2
              and request = 0
              and lmode != 4;
         dbms_output.put_line('  ');
          wstep  := 20;
         select 'Holder DBU: '||s.username ||' OSU: '||s.osuser ||' DBP:'||p.spid||' APP: '|| s.process ||
              ' SID:' || s.sid || ' Status: ' || s.status  ||
              ' (' ||         floor(last_call_et/3600)||':'||
                                      floor(mod(last_call_et,3600)/60)||':'||
                                      mod(mod(last_call_et,3600),60) ||
              ') Module:'|| module ||
                 ' AppSrvr: ' || substr(replace(machine,'GEIPS-AMER\',null),1,15)
             into wholder_detail
             from v$session s, v$process p
             where s.sid= wsid
               and s.paddr = p.addr;
         dbms_output.put_line(wholder_detail);

         begin
      select decode(wtype,'TX', 'Transaction',
                               'DL', 'DDL Lock',
                               'MR', 'Media Recovery',
                               'RT', 'Redo Thread',
                               'UN', 'User Name',
                               'TX', 'Transaction',
                               'TM', 'DML',
                               'UL', 'PL/SQL User Lock',
                               'DX', 'Distributed Xaction',
                               'CF', 'Control File',
                               'IS', 'Instance State',
                               'FS', 'File Set',
                               'IR', 'Instance Recovery',
                               'ST', 'Disk Space Transaction',
                               'TS', 'Temp Segment',
                               'IV', 'Library Cache Invalida-tion',
                               'LS', 'Log Start or Switch',
                               'RW', 'Row Wait',
                               'SQ', 'Sequence Number',
                               'TE', 'Extend Table',
                               'TT', 'Temp Table',
                               'Un-Known Type of Lock')
              into wlock_type
              from dual;
           declare
             cursor c3 is
               select object_id from v$locked_object
                 where session_id = wsid;
           begin
             wobject_name := '';
             for c3_rec in c3 loop
               select object_type||': '||owner||'.'||object_name
                into wobject_name
                from dba_objects
                where object_id = c3_rec.object_id;
              wobject_name := wobject_name ||' '||wobject_name1;
            end loop;
          exception
            when others then
              wobject_name := wobject_name ||' No Object Found';
          end;
          dbms_output.put_line('Lock Held: '||wlock_type||' for Object :'||wobject_name);
        exception
          when no_data_found then
            dbms_output.put_line('Lock Held: '||wlock_type||' No object found in DBA Objects');
        end;
      end if;
         wstep  := 30;
      select '....   Requestor DBU: '||s.username ||' OSU: '||s.osuser ||' DBP:'||p.spid||' APP: '|| s.process ||
                  ' SID:' || s.sid || ' Status: ' || s.status  ||
                  ' (' ||         floor(last_call_et/3600)||':'||
                                  floor(mod(last_call_et,3600)/60)||':'||
                                  mod(mod(last_call_et,3600),60) ||
                  ') Module:'|| module ||
                ' AppSrvr: ' || substr(replace(machine,'GEIPS-AMER\',null),1,15)
            into wholder_detail
            from v$session s, v$process p
            where s.sid= c1_rec.sid
              and s.paddr = p.addr;
      dbms_output.put_line(wholder_detail);
      wid1  := c1_rec.id1;
      wid2  := c1_rec.id2;
    end loop;
    if wid1 = -999999 then
         wstep  := 40;
      dbms_output.put_line('No one requesting locks held by others');
    end if;
  exception
    when others then
           v_err_msg := (sqlerrm ||'  '|| sqlcode||' step='||to_char(wstep));
      DBMS_OUTPUT.PUT_LINE(v_err_msg);
 end;
/

select 'Alter tablespace ' || tablespace_name || ' end backup' from dba_tablespaces;

lock_on_obj.sql

set lines 250
col OBJECT_NAME for a30
col MACHINE for a20
select
   c.owner,
   c.object_name,
   c.object_type,
   b.sid,
   b.serial#,
   b.status,
   b.osuser,
   b.machine
from
   v$locked_object a ,
   v$session b,
   dba_objects c
where
   b.sid = a.session_id
and
   a.object_id = c.object_id;

crtime.sql

rem ********************************************************************
rem * ccmreq.sql scripts list all the running request .
rem ********************************************************************
set lines 155
col os form A7 head AppProc
col spid form a6 head DBProc
col program form A43 trunc
set pages 60
col time form 9999.99 head Elapsed
col "Req Id" form 9999999999
col "Parent" form a9
col "Prg Id" form 999999
col qname head "Concurrent Manager Queue" format a25 trunc
col sid format 99999 head SID
set recsep off
select q.concurrent_queue_name || ' - ' || target_node qname
      ,a.request_id "Req Id"
      ,decode(a.parent_request_id,-1,NULL,a.parent_request_id) "Parent"
      ,a.concurrent_program_id "Prg Id"
      ,a.phase_code,a.status_code
      ,b.os_process_id "OS"
      ,vs.sid
      ,vp.spid
      ,(nvl(actual_completion_date,sysdate)-actual_start_date)*1440 "Time"
      ,c.concurrent_program_name||' - '||
       c2.user_concurrent_program_name "program"
from APPLSYS.fnd_Concurrent_requests a,APPLSYS.fnd_concurrent_processes b
    ,applsys.fnd_concurrent_queues q
    ,APPLSYS.fnd_concurrent_programs_tl c2
    ,APPLSYS.fnd_concurrent_programs c
    ,v$session vs
    ,v$process vp
where a.controlling_manager = b.concurrent_process_id
  and a.concurrent_program_id = c.concurrent_program_id
  and a.program_application_id = c.application_id
  and c2.concurrent_program_id = c.concurrent_program_id
  and a.phase_code in ('I','P','R','T')
  and b.queue_application_id = q.application_id
  and b.concurrent_queue_id = q.concurrent_queue_id
  and c2.language = 'US'
  and vs.process (+) = b.os_process_id
  and vs.paddr = vp.addr (+)
--order by 9,2,1
order by 9
/

inact.sql

select sid, b.serial#, osuser, b.username, status, process, paddr, spid, module, b.program
from v$process a,v$session b
where status = 'INACTIVE'
and a.addr = b.paddr
and b.username != ' '
order by 1
/

analyzereq.sql

conc_running.sql

SELECT   f.request_id,
         pt.user_concurrent_program_name                             user_concurrent_program_name,
         f.actual_start_date                                         actual_start_date,
         f.actual_completion_date                                    actual_completion_date,
         Floor(((f.actual_completion_date - f.actual_start_date) * 24 * 60 * 60) / 3600)
         ||' HOURS '
         ||Floor((((f.actual_completion_date - f.actual_start_date) * 24 * 60 * 60) - Floor(((f.actual_completion_date - f.actual_start_date) * 24 * 60 * 60) / 3600) * 3600) / 60)
         ||' MINUTES '
         ||Round((((f.actual_completion_date - f.actual_start_date) * 24 * 60 * 60) - Floor(((f.actual_completion_date - f.actual_start_date) * 24 * 60 * 60) / 3600) * 3600 - (Floor((((f.actual_completion_date - f.actual_start_date) * 24 * 60 * 60) - Floor(((f.actual_completion_date - f.actual_start_date) * 24 * 60 * 60) / 3600) * 3600) / 60) * 60)))
         ||' SECS ' time_difference,
         Decode(p.concurrent_program_name,'ALECDC',p.concurrent_program_name
                                                   ||'['
                                                   ||f.description
                                                   ||']',
                                          p.concurrent_program_name) concurrent_program_name,
         Decode(f.phase_code,'R','Running',
                             'C','Complete',
                             f.phase_code) phase,
         f.status_code
FROM     apps.fnd_concurrent_programs p,
         apps.fnd_concurrent_programs_tl pt,
         apps.fnd_concurrent_requests f
WHERE    f.concurrent_program_id = p.concurrent_program_id
         AND f.program_application_id = p.application_id
         AND f.concurrent_program_id = pt.concurrent_program_id
         AND f.program_application_id = pt.application_id
         AND pt.language = Userenv('Lang')
         AND f.actual_start_date IS NOT NULL
         AND f.phase_code = 'R'
ORDER BY f.actual_completion_date - f.actual_start_date DESC;

long.sql

select  sid||','||serial# "Sess" , qcsid , username , opname , target , message from v$session_longops
where totalwork <>sofar;

ses.sql

select a.name, b.statistic#, b.value, b.sid
from v$sysstat a, v$sesstat b
where a.statistic# = b.statistic#
and b.sid = &1
and a.name like '%table%' ;

session_wait_info.sql

ttitle 'Events Sessions are Waiting For'

column   event ON format   a30
column   p3text ON format   a15
column   p2text ON format   a15
column   p1text ON format   a15

set linesize 132
set pagesize 54

select event, p1, p1text, p2, p2text, p3, p3text, count(*)
from   v$session_wait
group by event, p1, p1text, p2, p2text, p3, p3text
order by count(*)
/

session_cache_hit_ratio.sql

select v$sess_io.* , 1-(PHYSICAL_READS/(BLOCK_GETS+CONSISTENT_GETS)) cache_hit_ratio, username
from   v$sess_io, v$session
where physical_reads > 0
and    1-(PHYSICAL_READS/(BLOCK_GETS+CONSISTENT_GETS)) < .90
and (block_gets  > 0 or consistent_gets > 0)
and v$session.sid = v$sess_io.sid
order by  1-(PHYSICAL_READS/(BLOCK_GETS+CONSISTENT_GETS))
/

sessdtl.sql

select s.sid , s.serial# , s.process , s.status ,
       OSUser "osuser" , p.spid , s.USERNAME  "user"
  from v$process p, v$session s
 where addr = paddr
 and s.sid = &Session_ID
 order by status , sid
/

sesswait.sql

select s.sid,s.serial#,
s.status,w.event,
w.p1,w.p2,w.state,
w.wait_time,
w.seconds_in_wait
from v$session s,v$session_wait w where
s.sid=w.sid
and w.seconds_in_wait >3600;

conc_det_new.sql

set line 80
set head off
set trimspool on
set verify off

col request        format  A80

ttitle center 'Concurrent Request Details' skip 2

SELECT 'Request Id:          ' ||to_char(a.request_id) request,
       'Parent Request Id:   ' ||decode(to_char(parent_request_id),'-1',null,to_char(parent_request_id)) request,
       'Program Name:        ' ||substr(b.user_concurrent_program_name,1,50) request,
       'Req Start Time:      ' ||to_char(a.requested_start_date,'DD-MON-RR HH24:MI:SS') request,
       'Start Time:          ' ||to_char(a.actual_start_date,'DD-MON-RR HH24:MI:SS') request,
       'End Time:            ' ||to_char(a.actual_completion_date,'DD-MON-RR HH24:MI:SS') request,
       'Execution Time:      ' || to_char(round(trunc(((actual_completion_date-actual_start_date)*24*60*60)/60)+(((actual_completion_date-actual_start_date)*24*60*60)-(trunc(((actual_completion_date-actual_start_date)*24*60*60)/60)*60))/100,2)) request,
       'User:                ' || fu.user_name request,
       'Phase:               ' || decode(a.phase_code,'R','Running','P','Inactive','C','Completed', a.phase_code) request,
       'Status:              ' || decode(a.status_code,'E','Error',   'C','Normal',    'X','Terminated', 'Q','On Hold', 'D','Cancelled', 'G','Warning', 'R','Normal',  'W', 'Paused', a.status_code) request,
       'Parameters:          ' || substr(a.argument_text,1,55) request,
       '                     ' || substr(a.argument_text,56,55) request,
       '                     ' || substr(a.argument_text,111,55) request
FROM apps.fnd_user fu,
     apps.fnd_concurrent_programs_vl b,
     apps.fnd_concurrent_requests a
WHERE  a.concurrent_program_id = b.concurrent_program_id
and fu.user_id = a.requested_by
AND a.request_id = &request_id
;
set pagesize 24
set verify on
set head on
ttitle off


conc_process.sql

select b.request_id,a.USER_CONCURRENT_PROGRAM_NAME
from apps.fnd_concurrent_programs_vl a, apps.fnd_concurrent_requests b
where a.concurrent_program_id = b.concurrent_program_id
  and b.status_code = 'R'
  and b.phase_code = 'R'
order by 1
/


Definition of any DDL
======================
select dbms_metadata.get_ddl('TABLE','FND_LOGINS','APPLSYS') from dual;

Find Product Patch Level / Version
==================================
select PATCH_LEVEL from fnd_product_installations where
APPLICATION_ID in (select APPLICATION_ID from fnd_application where APPLICATION_SHORT_NAME like '%AD%');

select PATCH_NAME from ad_applied_patches where PATCH_NAME='3453499';


Select name, name into: visible_option_value, :profile_option_value from v$database
select node_name,target_node from fnd_concurrent_queues;


insert into table apps.fnd_concurrent_requests (select * from fnd_concurrent_requests_bkp);

select LOGFILE_NAME, LOGFILE_NODE_NAME, OUTFILE_NAME, OUTFILE_NODE_NAME from fnd_concurrent_requests where REQUEST_ID=1091889;
select max_processes, running_processes, CONCURRENT_QUEUE_NAME from FND_CONCURRENT_QUEUES where CONCURRENT_QUEUE_NAME  like 'XDP%' and CONCURRENT_QUEUE_NAME not like 'XDP_MANAGER';
select max_processes, running_processes, CONCURRENT_QUEUE_NAME from FND_CONCURRENT_QUEUES
    where CONCURRENT_QUEUE_NAME  like 'XDP%';

Validating a user Passowrd
===========================
select fnd_web_sec.validate_login('sysadmin','br3adman') from dual;
select fnd_web_sec.validate_login('bol-support','****************') from dual;

   
update wf_event_subscriptions set system_guid =wf_core.translate('WF_SYSTEM_GUID') where
    system_guid <> wf_core.translate('WF_SYSTEM_GUID');

select name, status from wf_events
    where guid in (select event_filter_guid from wf_event_subscriptions where
    system_guid <> wf_core.translate('WF_SYSTEM_GUID'));


Select profile_option_value from
applsys.fnd_profile_option_values where profile_option_id in
(Select a.profile_option_id from  applsys.fnd_profile_option_values A, applsys.fnd_profile_options B
where a.profile_option_id=b.profile_option_id
and profile_option_name like '%ICX%REPORT%SERVER');


select MESSAGE_NAME, MESSAGE_TEXT
  from FND_NEW_MESSAGES, FND_APPLICATION
  where FND_NEW_MESSAGES.LANGUAGE_CODE ='xx'
        and FND_NEW_MESSAGES.APPLICATION_ID = FND_APPLICATION.APPLICATION_ID
        and FND_APPLICATION.APPLICATION_SHORT_NAME = 'MSD'
        and message_text like '%Search String%'

WF PARAMETERS
=============

SELECT
 c.parameter_name,
 a.parameter_value
 FROM fnd_svc_comp_param_vals a,
 fnd_svc_components b,
 fnd_svc_comp_params_b c
 WHERE b.component_id = a.component_id
 AND b.component_type = c.component_type
 AND c.parameter_id = a.parameter_id
 AND c.encrypted_flag = 'N'
 AND b.component_name = 'Workflow Notification Mailer'
 ORDER BY c.parameter_name;

Query To Set Open notifications
==============================
Update wf_notifications set status = 'CLOSED', mail_status = 'SENT',end_date = sysdate;  372933.1

bash-2.05b$ diff htmlvars_apps.js .snapshot/AUTOHOTSNAP_auohscoar16_TCOA6I_CODE_20070128/htmlvars_apps.js
$APACHE_TOP/Apache/htdocs/discwb4/scripts/

Using the System Administrator responsibility, navigate to Globalpreferences, change the Workflow administrator field from SYSADMIN to
workflow administrator web applications (TAR # 4499451.993).
   
SQL> update wf_resources set text='FND_RESP|FND|FNDWF_ADMIN_WEB_NEW|STANDARD' where name = 'WF_ADMIN_ROLE';

select COMPONENT_TYPE,COMPONENT_NAME,COMPONENT_STATUS  from FND_SVC_COMPONENTS;

update apps.fnd_concurrent_requests set hold_flag = 'Y', status_code = 'H', phase_code = 'I' where phase_code = 'P';


select user_end_date from wf_local_user_roles where user_name='SYSADMIN';
update wf_local_user_roles set USER_END_DATE=null where USER_NAME='SYSADMIN' and USER_END_DATE='28-OCT-06';
select effective_end_date from wf_local_user_roles where effective_end_date
='28-OCT-06';
update wf_local_user_roles set EFFECTIVE_END_DATE='31-MAR-12' where EFFECTIVE_END_DATE='28-OCT-06';

select tablespace_name,sum(maxbytes/1024/1024/1024) " size in GB " from dba_temp_files group by tablespace_name;
select tablespace_name,sum(maxbytes/1024/1024/1024) " size in GB " from dba_data_files group by tablespace_name;

Submit a concurrent request using CONCSUB
------------------------------------------
CONCSUB apps/BvGUWXhk SYSADMIN 'System Administrator' SYSADMIN CONCURRENT FND FNDCPPUR START="$PURGE_TIME" REPEAT_DAYS=1 REPEAT_INTERVAL_TYPE="START" "ALL" "Age" "30" '""' '""' '""' '""' '""' '""' '""' '""' "Yes" "Yes"



update alr_alerts set   enabled_flag='N' , end_date_active = sysdate, last_update_date = sysdate
where alert_name like 'ALERTNAME'

COL USER_CONCURRENT_QUEUE_NAME FOR A35
COL CONCURRENT_QUEUE_NAME FOR A23


SELECT APPLSYS.FND_CONCURRENT_QUEUES_TL.USER_CONCURRENT_QUEUE_NAME,
APPLSYS.FND_CONCURRENT_QUEUES.CONCURRENT_QUEUE_NAME,
APPLSYS.FND_CONCURRENT_QUEUES.RUNNING_PROCESSES
FROM   APPLSYS.FND_CONCURRENT_QUEUES, APPLSYS.FND_CONCURRENT_QUEUES_TL
WHERE  APPLSYS.FND_CONCURRENT_QUEUES.CONCURRENT_QUEUE_NAME
IN ('FNDICM', 'STANDARD', 'FNDCRM', 'FNDSM_AUTHENTICATION',
'INVMGR', 'WFMLRSVC', 'WFWSSVC', 'WFALSNRSVC', 'XDP_Q_EVENT_SVC', 'FNDSCH',
'FNDSM_AUOHSF5NE01', 'FNDICM', 'INVTMRPM', 'PODAMGR', 'ZIPQM')
AND   (APPLSYS.FND_CONCURRENT_QUEUES.CONCURRENT_QUEUE_ID=APPLSYS.FND_CONCURRENT_QUEUES_TL.CONCURRENT_QUEUE_ID)
ORDER BY APPLSYS.FND_CONCURRENT_QUEUES_TL.USER_CONCURRENT_QUEUE_NAME ASC
/

select profile_option_id, profile_option_name from fnd_profile_options where profile_option_name = 'SITENAME'
select * from fnd_profile_option_values where  profile_option_id = 125;

Assign new value:

update fnd_profile_option_values
   set profile_option_value = '&new_value '|| trunc(sysdate),
       last_update_date = sysdate,
       last_updated_by = (select user_id from fnd_user where user_name = 'SYSADMIN')
 where profile_option_id = (select profile_option_id
                              from fnd_profile_options
                             where profile_option_name = 'SITENAME');


==================================================

VERTEXT INSTALLATION USING vprtmupd



/sroi1i/applmgr/1200/pay/12.0.0/vendor/quantum/data

$ cd /sroi1i/applmgr/1200/pay/12.0.0/vendor/quantum/utils/utils
cbmaint  diagnos  diagnos.tst  L6909641.log  locupd  vprtmupd  vprtrep
$ cbmaint
Vertex Payroll Tax Q Series - ISAM Database Maintenance Program

Version 3.0.1 2011/12/16

Copyright 1999-2012 Vertex Inc.


Select an ISAM Maintenance Function
-----------------------------------

1.  - Create Database
2.  - Migrate Database
3.  - Reindex Database

9.  - Exit Program

Select: 1

Select a Database to Create
----------------------------

1.  - GeoCoder Database
2.  - Payroll Tax Database
3.  - All Databases
9.  - Main Menu

Select: 2

Enter Datasource Directory: /sroi1i/applmgr/1200/pay/12.0.0/vendor/quantum/data

Database Created
Payroll database creation successful (36 .dbf files).

Select a Database to Create
----------------------------

1.  - GeoCoder Database
2.  - Payroll Tax Database
3.  - All Databases
9.  - Main Menu

Select: 9

Select an ISAM Maintenance Function
-----------------------------------

1.  - Create Database
2.  - Migrate Database
3.  - Reindex Database

9.  - Exit Program

Select: 9
$ vprtmupd


Vertex Payroll Tax Q Series - Monthly Update Program

Version 3.0.1    2011/12/16

Copyright (c) Vertex Inc.  1994-2011.  All Rights Reserved.

WARNING! The update process will destroy the contents of the
current database before it creates a new one.  Please make
a backup before proceeding.


Select a Monthly Update Function
--------------------------------
1.  - Update Payroll Tax Database
2.  - Exit Program

Select: 1

Beginning Payroll Tax Monthly Update Process.

Enter Data Source:   /sroi1i/applmgr/1200/pay/12.0.0/vendor/quantum/data
Enter the path to the update file:  /sroi1i/applmgr/1200/pay/12.0.0/vendor/quantum/data

Updating database. Please wait. It may take a while...

A database error occurred during the update process. Restore the old database
and retry.
Press Enter to continue...

Any issues we can also diagnose as follows
==========================================

$ diagnos


Vertex Payroll Tax Q Series - Diagnostic Program

Version 3.0.1    2011/12/16

Copyright (c) Vertex Inc.  1994-2011.  All Rights Reserved.


Select Diagnostic Function
--------------------------

1.  - Test Vertex Payroll Tax Q Series Payroll Database Connection
2.  - Test Vertex Payroll Tax Q Series Location Database Connection
3.  - Test Vertex Payroll Tax Q Series Calculation

9.  - Exit Program

Select:  1

Enter database connection information ==>
Datasource:  /sroi1i/applmgr/1200/pay/12.0.0/vendor/quantum/data

==> Vertex Payroll Tax Q Series: payroll database open successful. <==

>> Payroll database schema version 3.0.0 and
program schema version 3.0.0 match. <<

>> Payroll database is not populated. <<

==> Vertex Payroll Tax Q Series: payroll database close successful. <==


Select Diagnostic Function
--------------------------

1.  - Test Vertex Payroll Tax Q Series Payroll Database Connection
2.  - Test Vertex Payroll Tax Q Series Location Database Connection
3.  - Test Vertex Payroll Tax Q Series Calculation

9.  - Exit Program

Select:9

Queries for Applications


To Know the definition of a DDL Commands.
=========================================
select  dbms_metadata.get_ddl ('TABLE', 'TABLE_NAME', 'SCHEMA_NAME') from dual

Tablspace Size Info
==================

select a.TABLESPACE_NAME, a.MAX, b.USED,
round((b.USED/a.MAX)*100,2) PCT  from
(select TABLESPACE_NAME, sum(MAXBYTES/1024/1024)
MAX from dba_Data_files group by TABLESPACE_NAME) a,(select tablespace_name, sum(bytes/1024/1024) USED from dba_segments group by tablespace_name) b where a.TABLESPACE_NAME=b.TABLESPACE_NAME and b.USED > a.MAX *(60/100)
===========================================================================
USER RESPONSIBILITY

select t1.user_name, t1.end_date, t3.responsibility_name, t2.creation_date
from fnd_user t1, fnd_user_resp_groups t2, fnd_responsibility_vl t3
where t1.user_id = t2.user_id
and t2.responsibility_id = t3.responsibility_id
and t3.responsibility_name like '&responsibility_name';
===========================================================================

To Find a Provile Value
=======================
SELECT PROFILE_OPTION_NAME, PROFILE_OPTION_VALUE FROM APPS.FND_PROFILE_OPTIONS
A,APPS.FND_PROFILE_OPTION_VALUES B WHERE A.PROFILE_OPTION_ID=B.PROFILE_OPTION_ID AND
PROFILE_OPTION_NAME LIKE 'SITENAME';
=============================================================================
Find a SQL Query by using SID
============================

select s.username, s.status,s.SQL_ADDRESS,t.SQL_TEXT,s.last_call_et/3600
 from v$session s,v$sqltext t
 where t.ADDRESS=s.SQL_ADDRESS and s.sid=&sid order by piece;
===================================================================
To See the profile values for a particular USER
===============================================
select
n.profile_option_name,
n.user_profile_option_name NAME,
decode(v.level_id,
10001, 'Site',
10002, 'Application',
10003, 'Responsibility',
10004, 'User',
10005, 'Server',
10006, 'Org',
10007, 'SERVRESP',
'UnDef') LEVEL_SET,
decode(to_char(v.level_id),
'10001', '',
'10002', app.application_short_name,
'10003', rsp.responsibility_key,
'10004', usr.user_name,
'10005', svr.node_name,
'10006', org.name,
'10007', 'Serv/resp',
'UnDef') "CONTEXT",
v.profile_option_value VALUE,
usr.user_name
from fnd_profile_options p,
fnd_profile_option_values v,
fnd_profile_options_tl n,
fnd_user usr,
fnd_application app,
fnd_responsibility rsp,
fnd_nodes svr,
hr_operating_units org
where p.profile_option_id = v.profile_option_id (+)
and p.profile_option_name = n.profile_option_name
and usr.user_name in ('&UserName')
and usr.user_id (+) = v.level_value
and rsp.application_id (+) = v.level_value_application_id
and rsp.responsibility_id (+) = v.level_value
and app.application_id (+) = v.level_value
and svr.node_id (+) = v.level_value
and org.organization_id (+) = v.level_value
order by 1,2,3,6;
=====================================================
To Update any profile Values
=====================================================
update /*+parallel (a,8) */ fnd_profile_option_values a
2 set a.profile_option_value= replace(a.profile_option_value,'appsnidcprod-nmcmotor.oracle.com','appsnidcprod.nmcmotor.com')
3 where upper(a.profile_option_value) like upper('%appsnidcprod-nmcmotor.oracle.com%');

========================================
select dbms_metadata.get_ddl('TABLE','FND_LOGINS','APPLSYS') from dual;
select 'alter system kill session ''' || sid||','||serial#||''' IMMEDIATE ' || ';' from v$session where status ='INACTIVE';
select 'alter PACKAGE ''' || OWNER||'.'|| OBJECT_NAME|| '''  '  ||  'compile body ;' from dba_objects where status ='INVALID';
select to_char(STARTUP_TIME,'dd-mon-yyyy hh24:mi:ss') from v$instance;
================================================

PCP CM CHECKS
=============
select distinct node_name,node_name2 from fnd_concurrent_queues;
SELECT COUNT(*) FROM WF_NOTIFICATIONS WHERE MAIL_STATUS IN ('MAIL', 'INVALID', 'OPEN');
Select running_processes,max_processes from apps.fnd_concurrent_queues where running_processes > 0 or max_processes > 0;
select * from fnd_profile_option_values where PROFILE_OPTION_ID=125;

select t.PROFILE_OPTION_ID , z.USER_PROFILE_OPTION_NAME , v.PROFILE_OPTION_VALUE, v.level_id
  from fnd_profile_options t, fnd_profile_option_values v, fnd_profile_options_tl z
  where v.PROFILE_OPTION_ID = t.PROFILE_OPTION_ID
  and z.PROFILE_OPTION_NAME = t.PROFILE_OPTION_NAME
  and t.PROFILE_OPTION_NAME in ('WF_MAIL_WEB_AGENT') ;


Saturday, January 28, 2012

RAC PCP CONFIGURATION

======================================
Section A: Prep Work BEFORE RAC and PCP
======================================
(A.1) Make sure to have a cold backup taken before RAC+PCP convertion:
-- Please note down the RFC number
(A.2) Create RFC to have sysadmin team to perform the following tasks on DB RAC-1 Node 
-- mount the file system oradata WITH "noac" (i.e add "noac") in the mount option on RAC-1 node 
/etc/fstab entry for 'oradata' mount poing
From:
adc26stor07-nas:/export/srio1i_07/i_oradata oradata nfs rw,bg,nointr,hard,timeo=600,wsize=32768,rsize=32768,nfsvers=3,tcp,noacl
To:
adc26stor07-nas:/export/srio1i_07/i_oradata oradata nfs rw,bg,nointr,hard,timeo=600,wsize=32768,rsize=32768,nfsvers=3,tcp,noac,noacl
(A.3) Create RFC to have sysadmin team to perform the following tasks on DB RAC-2 Node 
Change the following OS parameter and reboot the server afterwards
hugepages: 24100
shmmax: 52614348800
shmall: 12845300
Note: 
-- the Hugepage setting in RAC-1 node was done previously (Refer to RFC:)
-- database cannot startup properly due to memory issue if Huge_page etc not changed
============
Section B: RAC and PCP setup
============
(B.1) Backup init.ora file (log into RAC node-1: as or<sid> user)
$ cd $ORACLE_HOME/dbs
(B.2) Modify init<SID>1.ora
(B.2.1) 
From:
*.cluster_database_instances=1
*.cluster_database=FALSE
To:
*.cluster_database_instances=2
*.cluster_database=TRUE
(B.2.2)
Add the following to init<SID>1.ora
*._immediate_commit_propagation=TRUE
*._lm_global_posts=TRUE
(B.3) Start first instance and create spfile
log into RAC node-1: as or<sid> user
$ sqlplus '/as sysdba'
SQL> startup;
SQL> create spfile='/srio1i/oradata/data01/spfilesrio1i.ora' from pfile='/srio1i/oracle/product/111/dbs/initsrio1i1.ora';
(B.4) Shutdown and restart the instance srio1i1
$ sqlplus '/as sysdba'
SQL> shutdown immediate;
SQL> startup;
(B.5) Create APPS_UNDOTS2 tablespace
log into RAC node-1: sriohsnoill36.oracleoutsourcing.com as orsrio1i user
$ sqlplus '/as sysdba'
SQL> create undo tablespace APPS_UNDOTS2 DATAFILE '/srio1i/oradata/data01/undo201.dbf' size 500M AUTOEXTEND ON NEXT 50M MAXSIZE 5000M;
SQL> alter tablespace APPS_UNDOTS2 add datafile '/srio1i/oradata/data01/undo202.dbf' size 500M AUTOEXTEND ON NEXT 50M MAXSIZE 5000M;
SQL> alter tablespace APPS_UNDOTS2 add datafile '/srio1i/oradata/data01/undo203.dbf' size 500M AUTOEXTEND ON NEXT 50M MAXSIZE 5000M;


(B.6) Add log threads.
log into RAC node-1: sriohsnoill36.oracleoutsourcing.com as orsrio1i user
$ sqlplus '/as sysdba'
SQL> alter database add LOGFILE thread 2 
GROUP 5('/srio1i/oradata/data03/log05a.dbf', '/srio1i/oradata/data03/log05b.dbf') SIZE 1000M, 
GROUP 6('/srio1i/oradata/data03/log06a.dbf', '/srio1i/oradata/data03/log06b.dbf') SIZE 1000M,
GROUP 7('/srio1i/oradata/data03/log07a.dbf', '/srio1i/oradata/data03/log07b.dbf') SIZE 1000M,
GROUP 8('/srio1i/oradata/data03/log08a.dbf', '/srio1i/oradata/data03/log08b.dbf') SIZE 1000M; 
(B.7) Enable log thread 2
log into RAC node-1: sriohsnoill36.oracleoutsourcing.com as orsrio1i user
$ sqlplus '/as sysdba'
SQL > alter database enable thread 2;
(B.8) register the remote listeners
log into RAC node-1: sriohsnoill36.oracleoutsourcing.com as orsrio1i user
$ sqlplus '/as sysdba'
SQL> alter system set local_listener='srio1i1_LOCAL' scope=both sid='srio1i1';
SQL> alter system set local_listener='srio1i2_LOCAL' scope=both sid='srio1i2';
SQL> alter system set remote_listener='srio1i_REMOTE' scope=both sid='*';
(B.9) Start second instance (srio1i2)
log into RAC node-2: sriohsnoill37.oracleoutsourcing.com as orsrio1i user
$ sqlplus '/as sysdba'
SQL> startup;
SQL> select instance_name,status from v$instance;
(B.10) Run autoconfig on DB with the following order:
IMPORTANT: backup context_file and init.ora file before running autoconfig:
(B.10.1) Run autoconfig on RAC-1 node, sriohsnoill36 first:
$ cd $ORACLE_HOME/appsutil/bin
$ ./adconfig.sh contextfile=/srio1i/oracle/product/111/appsutil/srio1i1_sriohsnoill36.xml appspass=<apps_passwd>
(B.10.2) Run autoconfig on RAC-2 node (sriohsnoill37): 
$ cd $ORACLE_HOME/appsutil/bin
$ ./adconfig.sh contextfile=/srio1i/oracle/product/111/appsutil/srio1i1_sriohsnoill37.xml appspass=<apps_passwd>
(B.11) Make sure the following context file parameter is set on both PCP nodes (SRIOHSNOIL008 and SRIOHSNOIL011)
Ensure s_appldcp=ON in context_file
$ grep -i APPLDCP $CONTEXT_FILE
         <APPLDCP oa_var="s_appldcp">ON</APPLDCP>
(B.12) Run autoconfig on PCP nodes
(B.12.1) Run autoconfig on PCP-1 node, SRIOHSNOIL008:
$ cd $AD_TOP/bin
$ ./adconfig.sh contextfile=/srio1i/inst/apps/srio1i_SRIOHSNOIL008/appl/admin/srio1i_SRIOHSNOIL008.xml appspass=<apps_passwd>
(B.12.2) Run autoconfig on PCP-2 node, SRIOHSNOIL011: 
$ cd $AD_TOP/bin
$ ./adconfig.sh contextfile=/srio1i/inst/apps/srio1i_SRIOHSNOIL011/appl/admin/srio1i_SRIOHSNOIL011.xml appspass=<apps_passwd>
(B.12.3) Run autoconfig on PCP-1 node again:
$ cd $AD_TOP/bin
$ ./adconfig.sh contextfile=/srio1i/inst/apps/srio1i_SRIOHSNOIL008/appl/admin/srio1i_SRIOHSNOIL008.xml appspass=<apps_passwd>
(B.12.4) Skip autoconfig on DMZ node at this point.
(B.13) Verify all the tnsnames.ora entries in both the PCP nodes, Each node should have the other nodes tns entries.
(B.14) Startup Application in both PCP nodes only: Do NOT start the Concurrent Manager.
(B.14.1) PCP-1: SRIOHSNOIL008
$ cd $SCRIPT_TOP
$ mv adcmctl.sh adcmctl.sh_save
Start other components
$ ./adstrtal.sh apps/<apps_passwd>
(B.14.2) PCP-2: SRIOHSNOIL011
$ cd $SCRIPT_TOP
$ mv adcmctl.sh adcmctl.sh_save
Start other components
$ ./adstrtal.sh apps/<apps_passwd>
(B.15) PCP setup:
(B.15.1)
Log on to application as "SYSADMIN" with "System Administrator responsibility"
Navigate to Profile ==> System, change the profile option 'Concurrent: TM Transport Type' to 'QUEUE', and verify that the transaction manager works across the Oracle RAC instance.
Navigate to Profile ==> System, change the profile option 'Concurrent: PCP Instance Check' to 'ON'
(B.16) Verfiy the NODE information for the following PCP managers
Log on to application as "SYSADMIN" with "System Administrator responsibility" ==> Concurrent ==> Manager ==> Define:
USER_CONCURRENT_QUEUE_NAME                                   CONCURRENT_QUEUE_NAME          PRIMAY       SECONDARY      MAX_PROCESSES SLEEP_SECONDS
------------------------------------------------------------ ------------------------------ --------------- --------------- ------------- -------------
FastFormula Transaction Manager PCP2                         FFTM2                          SRIOHSNOIL011                                  1            60
INV Remote Procedure Manager PCP2                            INVTMRPM2                      SRIOHSNOIL011                                  1            30
NOV Custom Manager PCP2                                      XXNOV_CUSTMGR2                 SRIOHSNOIL011     SRIOHSNOIL008                10            60
NOV Payroll Child Manager PCP2                               XXNOV_PAYCHLD2                 SRIOHSNOIL011     SRIOHSNOIL008                10            45
NOV Payroll Manager PCP2                                     XXNOV_PAYMGR2                  SRIOHSNOIL011     SRIOHSNOIL008                 5            60
Output Post Processor PCP2                                   FNDCPOPP2                      SRIOHSNOIL011     SRIOHSNOIL008                 1            30
PO Document Approval Manager PCP2                            PODAMGR2                       SRIOHSNOIL011                                 15            60
Receiving Transaction Manager PCP2                           RCVOLTM2                       SRIOHSNOIL011                                  1            60
Standard Manager PCP2                                        STANDARD2                      SRIOHSNOIL011     SRIOHSNOIL008                 8            30
                 
(B.17) Verfiy and/or modify the NODE information for the remaining PCP managers as well as work-shift info:
Log on to application as "SYSADMIN" with "System Administrator responsibility" ==> Concurrent ==> Manager ==> Define:


-- please refer to Concurrent Manager information in /autofs/upgrade/pmp/NOV/mgr.lst file


(B.18) Startup Concurrent Manager on PCP-1 Node (SRIOHSNOIL008)


$ cd $SCRIPT_TOP
$ mv adcmctl.sh_save adcmctl.sh 
$ ./adcmctl.sh start apps/<apps_passwd>
(B.19) Verify the Concurrent Managers starts on PCP-2 node (SRIOHSNOIL011)
(B.19.1) make sure that APPS listener started on PCP-2 node (SRIOHSNOIL011)
$ lsnrctl status APPS_srio1i
(B19.2)
Concurrent Managers should automatically starts on SRIOHSNOIL011 WITHOUT runs adcmctl.sh script.
(B.20) 
Log on to application as "SYSADMIN" with "System Administrator responsibility" to Concurrent ==> Manager ==> Administrator screen and verify all managers start properly 
SQL> select USER_CONCURRENT_QUEUE_NAME, concurrent_queue_name, node_name, node_name2 from fnd_concurrent_queues_vl where USER_CONCURRENT_QUEUE_NAME like '%PCP2%' order by 1;


WorkFlow Issue
===============

As there are huge number of OMERROR and WFERROR which are OPEN  and CANCELLED MAIL for User sysadmin, the issue is occuring.
Hence to start with, we shall reduce the number of WFERROR and OMERROR for user on

***DISCLAIMER***
The Item type will forcefully abort/end-date ALL OPEN types'
Hence this is totally intended to meet your specific business requirement,so kindly take appropriate backups '

Backup tables:
WF_NOTIFICATIONS
applsys.wf_notification_out
WF_ITEMS

-----------------------------------------------------------------------------------------------------------

1. UPDATE all OPEN and CANCELLED records WFERROR and OMERROR records to CLOSED.

For WFERROR:

SQL>UPDATE WF_NOTIFICATIONS SET STATUS='CLOSED' ,MAIL_STATUS='SENT' where recipient_role = 'SYSADMIN' and MESSAGE_TYPE ='WFERROR'

For OMERROR:

SQL>UPDATE WF_NOTIFICATIONS SET STATUS='CLOSED' ,MAIL_STATUS='SENT' where recipient_role = 'SYSADMIN' and MESSAGE_TYPE ='OMERROR''
commit;

commit;

----------------------------------------------------------------------------------------------
2. Deleting ONLY WFERROR type in READY status under mailer queue:

SQL>delete from applsys.wf_notification_out where CORRID ='<BELOW CORRID>'
SQL>COMMIT;

CORRID:
APPS:WFERROR:RETRY _ONLY 0 = Ready 1365
APPS:WFERROR:DEFAULT_EVENT_ERROR 0 = Ready 606536
APPS:WFERROR:DEFAULT_EVENT_EXT_ERROR 0 = Ready 16
APPS:WFERROR:RESET_ERROR_MESSAGE 0 = Ready 9971

APPS:OMERROR:OMERROR_MSG 0 = Ready 12673

Example:

SQL>delete from applsys.wf_notification_out where CORRID ='APPS:WFERROR:DEFAULT_EVENT_ERROR'


=============================================================

3. Purging CLOSED, Obsolete records of WFERROR, Later can be done for OMERROR as well.

  1. Run the following query to determine how many item instances are there for WFERROR which are
  currently not end dated..

  SQL> SELECT COUNT(*) FROM WF_ITEMS WHERE END_DATE IS NULL AND ITEM_TYPE = 'WFERROR';

  2. Run the following PL/SQL script to end date
=========================================================================================================
Get a hash Value of Process ID (client pid)
=========================================================================================================
col program for a15
col machine for a15
col terminal for a15
col sid   for  9999
col serial#  for 9999999
set lines 152

select s.sid,s.serial#,'*'||s.process||'*'  Client,p.spid Server,s.sql_address,s.sql_hash_value,s.username,
s.program || s.module,s.action,s.terminal,s.machine, s.status, --s.last_call_et s.last_call_et/3600, s.taddr
from v$session s, v$process p where p.addr=s.paddr and s.sid=nvl('&sid',s.sid) and p.spid=nvl('&spid',p.spid) and
nvl(s.process,-1) = nvl('&ClientPid',nvl(s.process,-1));

===================================================================
Using the PID Get a Query running by a USER
=============================================
select s.username, s.status,s.SQL_ADDRESS,t.SQL_TEXT,s.last_call_et/3600
 from v$session s,v$sqltext t
 where t.ADDRESS=s.SQL_ADDRESS and s.sid=&sid order by piece;
===================================================================
To See the profile values for a particular USER
===============================================
select
n.profile_option_name,
n.user_profile_option_name NAME,
decode(v.level_id,
10001, 'Site',
10002, 'Application',
10003, 'Responsibility',
10004, 'User',
10005, 'Server',
10006, 'Org',
10007, 'SERVRESP',
'UnDef') LEVEL_SET,
decode(to_char(v.level_id),
'10001', '',
'10002', app.application_short_name,
'10003', rsp.responsibility_key,
'10004', usr.user_name,
'10005', svr.node_name,
'10006', org.name,
'10007', 'Serv/resp',
'UnDef') "CONTEXT",
v.profile_option_value VALUE,
usr.user_name
from fnd_profile_options p,
fnd_profile_option_values v,
fnd_profile_options_tl n,
fnd_user usr,
fnd_application app,
fnd_responsibility rsp,
fnd_nodes svr,
hr_operating_units org
where p.profile_option_id = v.profile_option_id (+)
and p.profile_option_name = n.profile_option_name
and usr.user_name in ('&UserName')
and usr.user_id (+) = v.level_value
and rsp.application_id (+) = v.level_value_application_id
and rsp.responsibility_id (+) = v.level_value
and app.application_id (+) = v.level_value
and svr.node_id (+) = v.level_value
and org.organization_id (+) = v.level_value
order by 1,2,3,6;
=====================================================
select name, to_char(sysdate,'DD-MM-YYYY hh24:mi:ss') from V$DATABASE;

Tips and Queries for Troubleshooting Advanced Topologies (Doc ID 364439.1)
============================================================================
update /*+parallel (a,8) */ fnd_profile_option_values a
2 set a.profile_option_value= replace(a.profile_option_value,'appsnidcprod-nmcmotor.oracle.com','appsnidcprod.nmcmotor.com')
3 where upper(a.profile_option_value) like upper('%appsnidcprod-nmcmotor.oracle.com%');

========================================
Starting MWA server & dispatcher:
cd $MWA_TOP/bin
./mwactl.sh start 30002
./mwactl.sh start_dispatcher &

cd $MWA_TOP/bin
./mwactl.sh -login sysadmin/simple4u stop_force 30002 &
./mwactl.sh stop_dispatcher &

sec$ORACLE_HOME/OPatch/opatch lsinventory -detail -invPtrLoc $ORACLE_HOME/oraInst.loc | egrep 'Oracle Application Server 10g|Patch of Oracle Application Server 10g'
================================================================================
adodfcmp odffile=/pnob1i/applmgr/1200/pji/12.0.0/patch/115/odf/pjit130.odf
userid=applsys/Welcom777 changedb=yes priv_schema=system/Hue62Ka mode=tables touser=apps/Welcom777
===================================================================================================
find . -mtime -4
select dbms_metadata.get_ddl('TABLE','FND_LOGINS','APPLSYS') from dual;
select 'alter system kill session ''' || sid||','||serial#||''' IMMEDIATE ' || ';' from v$session where status ='INACTIVE';
select 'alter PACKAGE ''' || OWNER||'.'|| OBJECT_NAME|| '''  '  ||  'compile body ;' from dba_objects where status ='INVALID';
select to_char(STARTUP_TIME,'dd-mon-yyyy hh24:mi:ss') from v$instance;
224266.1 How to Change the DBID and the DBNAME by using NID
601807.1   Upgrade 11g
============================================================================================
select PROFILE_OPTION_VALUE from FND_PROFILE_OPTION_VALUES where PROFILE_OPTION_ID=(Select PROFILE_OPTION_ID from fnd_profile_options where PROFILE_OPTION_NAME ='SIGNON_PASSWORD_HARD_TO_GUESS');
============================================================================================
TROUBLESHOOT LOGIN PAGE / APACHE
================================

$ cd $LOG_HOME
$ find . -name 'application.log'
./ora/10.1.3/j2ee/oacore/oacore_default_group_2/application.log
./ora/10.1.3/j2ee/oacore/oacore_default_group_1/application.log
./ora/10.1.3/j2ee/oafm/oafm_default_group_1/application.log


$FND_TOP/admin/template/custom/httpd_conf_1013.tmp
$INST_TOP/ora/10.1.3/Apache/Apache/conf/httpd.conf

When the issue occur check the log files apart from access and error_log

sec_case_sensitive_logon             boolean     FALSE

==============================================================
Related metalink notes to enable additional debugging

419839.1 – How to enable Apache, OC4J and OPMN logging in Oracle Applications R12
422419.1 – R12 – How To Enable and Collect Debug for HTTP, OC4J and OPMN

==============================================================================
PRINTERS
=========

lpstat -t|grep -i 4_
lpstat -a
telnet hostname port
telnet 69.25.45.13 515 "Whether port is open"
tcptraceroute 69.25.45.13 515
netstat -rn
[AMD64] appkinci@auohskinc06 > /usr/local/git/bin/tcptraceroute 69.25.45.12 515

==================================================================================

opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./6196748

Level 12 trace for a concurrent prog  Doc ID 295963.1

select REQUEST_ID,ORACLE_ID,ORACLE_PROCESS_ID,ORACLE_SESSION_ID,OS_PROCESS_ID from applsys.FND_CONCURRENT_REQUESTS where REQUEST_ID=13787589;
update APPLSYS.fnd_Concurrent_requests set PHASE_CODE='C', STATUS_CODE='D' where REQUEST_ID=13787589;
commit;

apscheck.sql from note 246150.1

1.Login as system owner and run:

alter profile AD_PATCH_MONITOR_PROFILE limit failed_login_attempts unlimited;
alter profile default limit failed_login_attempts unlimited password_lock_time 1/1440;
alter user apps account unlock;
==================================================================================
select text from dba_source where name='XXMSC_INVENTORY_TRANSFER' and type='PACKAGE';
select text from dba_source where name='XXMSC_INVENTORY_TRANSFER' and type='PACKAGE BODY';

Here is an important update on the CPU Patch process, need to be followed for all customers as part of migration/implementation:

***************************************************************************************************
==============================
package version
===============

select text from all_source where name = '&pkg_name' and line < 7;

==================================================================

select to_char(sysdate,'DD-MON-YY HH24:MI:SS') from dual;
========================================================

SET MARKUP HTML ON

SPOOL RESP_MF_BUY_file.xls;

====================================
Update override address: afsvcpup.sql

select COMPONENT_ID,COMPONENT_NAME from FND_SVC_COMPONENTS where COMPONENT_NAME like '%Workflow Notification%';

COMPONENT_ID     COMPONENT_NAME
-------------    ------------------------------
       10006     Workflow Notification Mailer

select PARAMETER_ID,DISPLAY_NAME from FND_SVC_COMP_PARAMS_TL where DISPLAY_NAME like '%Test%Address%';

PARAMETER_ID     DISPLAY_NAME
-------------    --------------------
       10057     Test Address


update FND_SVC_COMP_PARAM_VALS set PARAMETER_VALUE='gleue.srik@google.com' where COMPONENT_ID=10006 and PARAMETER_ID =10057;

1 row updated.

SQL> commit;


select PARAMETER_VALUE from FND_SVC_COMP_PARAM_VALS  where COMPONENT_ID=10006 and PARAMETER_ID =10057;

===========================================
$ORACLE_HOME/OPatch/opatch lsinventory -invPtrLoc $ORACLE_HOME/oraInst.loc
$ORACLE_HOME/OPatch/opatch apply -invPtrLoc $ORACLE_HOME/oraInst.loc

When ICM is started on mid tier it launches 1367 fndlibr processes. This is causing a DB crash.
Configure ICM for the correct sizing.

[AMD64] apdrfnyi@auohsrfny02 > ps -elf|grep -i fndlibr|wc -l
1367
================================================================================


*******************************************
Please perform the following step before running 12.1.1 upgrade driver to improve the performance of XLIFFImporter java objects as suggested by support.

Reff :SR 3-1679349151

Apply the following patches instead before the Rel 12.1.1 driver is applied since these patches should have the performance fixes.

· Patch 9179588 (9179588:R12.AD.B) è Merge this patch with Patch 7461070 (R12.AD.B.1) and then apply

· Patch 7303029 (7303029:12.1.0) èPatch needs to be applied in  preinstall mode.

**************************************************************************************

select 'New Invalid objects', object_name from dba_objects where status='INVALID' and object_name not in (select object_name from apps.invalids_TKAD51);

select 'New Disabled Triggers',trigger_name from dba_triggers where status='DISABLED' and trigger_name not in (select trigger_name from disabled_TKAD51);

**************************************************************************************
Module installation mode has been changed without problems for Alerts, Cash Management, Payments and Manufacturing.

-- XLA status -- Find a Status of any Product
SQL> select fpi.application_id, fpi.status, fpi.patch_level from fnd_product_installations fpi where fpi.application_id = 602;

APPLICATION_ID S PATCH_LEVEL
-------------- - ------------------------------
           602 S R12.XLA.A.6


Reg Sub ledger Accounting (XLA), if customer is licensed for other applications that uses SLA, e.g. AR, AP, Costing, PA...etc, then
fnd_product_installations.Status should be 'S'. If they are licensed for FSAH (Financial Services Accounting Hub), then
fnd_product_installations.Status should be 'I'.
**************************************************************************************
Select a.APPLICATION_ID, i.STATUS
from fnd_application ,fnd_product_installations i
where a.APPLICATION_ID=i.APPLICATION_ID
and a.APPLICATION_SHORT_NAME ='&applshortname'

**************************************************************************************
Status of RAC

cd /oracrs/oracle/product/111/bin
./crs_stat -t
./crs_stop -all
./crs_start -all

===============================================================

1. FND Message Log

1) Enable the FND Debug Log
a)  Navigate to System Administrator responsibility
b) Set the following  profiles at the USER level:
FND: Debug Log Enabled = YES
FND: Debug Log  Filename = NULL
FND: Debug Log Level = STATEMENT
FND: Debug Log Module =  %

2) Using a SQL client run the following query and Note down this  log_seq
select max(log_sequence) from fnd_log_messages;

3) Reproduce  the issue

4) Run the follow using the logseq number from step 2 and  upload in spreadsheet format
Select * from fnd_log_messages where  log_sequence > &log_seq_noted_above order by  log_sequence;
===============================================================

Apache Clearing Cache in R12  742107.1

or else

$ grep s_jsp_main_mode $CONTEXT_FILE
         <jsp_debug_parameters oa_var="s_jsp_main_mode">recompile</jsp_debug_parameters>

then u can just remove _pages and bring apache
if u dont find recompile then u need to run ojspCompile.pl
then we have run this script


rm -fr $INST_TOP/ora/10.1.3/j2ee/oacore/persistence/*
rm -fr $INST_TOP/ora/10.1.3/j2ee/oafm/persistence/*
rm -fr $INST_TOP/ora/10.1.3/j2ee/forms/persistence/*
===============================================================
Check APPS_MODE or stand alone
============================================================================
SQL> SELECT SP_VALUE FROM EUL5_US.EUL5_APP_PARAMS WHERE APP_ID = 1016;

SP_VALUE
--------------------------------------------------------------------------------
1

if "1" then it is APPS_MODE or else stand alone

sqlplus -s apps/****** @$AD_TOP/patch/115/sql/adsetmmd.sql ENABLE
sqlplus -s apps/****** @$AD_TOP/patch/115/sql/adsetmmd.sql DISABLE

frmcmp_batch module=ARXTWMAI.fmb userid=apps/X1yMF2mg output_file=/tbic1i/applmgr/1200/ar/12.0.0/forms/US/ARXTWMAI.fmx compile_all=special

CREATE PUBLIC DATABASE LINK R11toR12 CONNECT TO apps IDENTIFIED BY xxxxx USING 'TMANGI';
SQL> select * from dba_db_links where DB_LINK like '%R11%';


select HOST_NAME,INSTANCE_NAME from v$instance@R11TOR12;

SQL> select sysdate from dual@r11tor12;

Toget Diagnostics for Applications
==================================
"Diagnostics: Apps Check" Concurrent programe. File listing multiple file versions for FA.


Check whether #Patch DriverApplied NLS

col DRIVER_FILE_NAME for a16
set linesize 300

select apd.driver_file_name,to_char(apd.creation_date,'DD-MON-YYYY:HH24:MI:SS') "Started",to_char(apd.last_update_date,'DD-MON-YYYY:HH24:MI:SS') "Last_Updated",apd.DRIVER_TYPE_C_FLAG "C",apd.DRIVER_TYPE_D_FLAG "D",apd.DRIVER_TYPE_G_FLAG "G" ,apd.MERGED_DRIVER_FLAG "Merged", apdl.language "Language" from ad_patch_drivers apd, ad_patch_driver_langs apdl where apd.patch_driver_id=apdl.patch_driver_id and apd.driver_file_name like '%&1%';

#CHECK ANY FILE VERSION FROM A SQL

select A.FILE_ID, A.APP_SHORT_NAME, A.SUBDIR, A.FILENAME, max(B.VERSION) from
AD_FILES A, AD_FILE_VERSIONS B where A.FILE_ID = B.FILE_ID and A.FILENAME = '&filename'
group by A.FILE_ID, A.APP_SHORT_NAME, A.SUBDIR, A.FILENAME;

select application_id, application_short_name, basepath from applsys.FND_APPLICATION where APPLICATION_ID = 13015;

select application_id, product_version, tablespace, index_tablespace from applsys.FND_PRODUCT_INSTALLATIONS where application_id = 13015;


Gather Schema Statistics can be scheduled with the following parameters.

Gather Schema Statistics ALL:10::NOBACKUP::LASTRUN:GATHER::Y

To Relink any Specific Executable
adrelink.sh force=y ranlib=y "pay PYUGEN"
adrelink.sh force=y ranlib=y "fnd FNDLIBR"