Tuesday, December 19, 2017

ORA-04030: out of process memory while compiling XLA Package

XLA Invalid Object in R12 Application:


SQL>select object_name,object_type from dba_objects where status='INVALID';
OBJECT_NAME OBJECT_TYPE
----------------------------------- -------------------
XLA_00200_AAD_S_000010_PKG PACKAGE BODY
XLA_00200_AAD_S_000011_PKG PACKAGE BODY

SQL> alter package apps.XLA_00200_AAD_S_000010_PKG COMPILE BODY;
alter package apps.XLA_00200_AAD_S_000010_PKG COMPILE BODY
*
ERROR at line 1:
ORA-04030: out of process memory when trying to allocate 4108 bytes (PLS
non-lib hp,pdzgM64_New_Link)


Solution:

SQL> alter system set plsql_optimize_level =0;

System altered.

SQL> alter package apps.XLA_00200_AAD_S_000011_PKG compile body;

Package body altered.

SQL> alter system set plsql_optimize_level =2;


System altered.

Monday, October 16, 2017

R12 Concurrent Manager not came up

To solve this problem, need to perform the below steps

1.  Stop all middle tier services including the concurrent managers.
2.  Stop the database.
3.  Start the database.
4.  Connect SQLPLUS as APPS user and run the following :

EXEC FND_CONC_CLONE.SETUP_CLEAN;
COMMIT;
EXIT;

5.  Run AutoConfig on all tiers, firstly on the DB tier and then the APPS tiers and webtiers to repopulate the required system tables.
6.  Connect to SQLPLUS as APPS user and run the following statement :

select CONCURRENT_QUEUE_NAME from FND_CONCURRENT_QUEUES where CONCURRENT_QUEUE_NAME like 'FNDSM%';

If the above SQL does not returning any value then please do the following:

Go to $FND_TOP/patch/115/sql

Connect SQLPLUS as APPS user and run the following script :

SQL> @afdcm037.sql;

This script will create libraries for FNDSM and create managers for preexisting nodes.

Check again that FNDSM entries now exist:

select CONCURRENT_QUEUE_NAME from FND_CONCURRENT_QUEUES where CONCURRENT_QUEUE_NAME like 'FNDSM%';

Tuesday, September 26, 2017

The system has encountered an error when servicing the request, Please try again. If the error persists, please contact the system administrator.

While accessing R12.2 EBS url we have faced this below mentioned error

"The system has encountered an error when servicing the request, Please try again. If the error persists, please contact the system administrator."

In Weblogic Console, all the services are up and running successfully.

In Oacore_server.log file:

java.lang.NoClassDefFoundError: Could not initialize class oracle.apps.fnd.functionSecurity.User

In oacore_server.out file:

Exception in static block of jtf.cache.CacheManager. Stack trace is: oracle.apps.jtf.base.resources.FrameworkException: IAS Cache initialization failed. The Distributed Caching System failed to initialize on port: 12345. The list of hosts in the distributed caching system is: 172.16.1.1 . The port 12345 should be free on each host running the JVMs.

Solution:

Shut down the application services and check the java cache port number is still accessing or not.

$netstat -ntpl |grep 12345
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 ::ffff:172.16.1.1:12345 :::*                        LISTEN      6171/java

find the process for this port number and kill the process.

$ps -ef|grep 6171
applmgr   6171     1  0 Jul27 ?        00:51:22 /u01/applmgr/fs1/EBSapps/comn/util/jdk32/bin/java -
applmgr  27304 24214  0 16:19 pts/0    00:00:00 grep 6171

$kill -9 6171

Start the application services and this time ebs url worked fine without any issue.

Thursday, September 21, 2017

Find Roles and Privilege

SQL> desc user_sys_privs;
 Name                                      Null?    Type
 ----------------------------------------- -------- ------------------------
 USERNAME                                           VARCHAR2(30)
 PRIVILEGE                                 NOT NULL VARCHAR2(40)
 ADMIN_OPTION                                       VARCHAR2(3)

 SQL>desc dba_role_privs;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 GRANTEE                                            VARCHAR2(30)
 GRANTED_ROLE                              NOT NULL VARCHAR2(30)
 ADMIN_OPTION                                       VARCHAR2(3)

 DEFAULT_ROLE                                       VARCHAR2(3)

SQL>desc role_sys_privs;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ROLE                                      NOT NULL VARCHAR2(30)
 PRIVILEGE                                 NOT NULL VARCHAR2(40)
 ADMIN_OPTION                                       VARCHAR2(3)

SQL>desc role_tab_privs;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ROLE                                      NOT NULL VARCHAR2(30)
 OWNER                                     NOT NULL VARCHAR2(30)
 TABLE_NAME                                NOT NULL VARCHAR2(30)
 COLUMN_NAME                                        VARCHAR2(30)
 PRIVILEGE                                 NOT NULL VARCHAR2(40)
 GRANTABLE                                          VARCHAR2(3)

SQL>desc role_role_privs;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ROLE                                      NOT NULL VARCHAR2(30)
 GRANTED_ROLE                              NOT NULL VARCHAR2(30)
 ADMIN_OPTION                                       VARCHAR2(3)

Current User Privileges:
-----------------------------
SQL> desc user_sys_privs;
 Name                                      Null?    Type
 ----------------------------------------- -------- ------------------------
 USERNAME                                           VARCHAR2(30)
 PRIVILEGE                                 NOT NULL VARCHAR2(40)

 ADMIN_OPTION                                       VARCHAR2(3)


Wednesday, August 23, 2017

Purge Application Log Files May Be Manually Regularly

you can purge the following Middle Tier files:

1. Shutdown middle (web) tier using the command: $ADMIN_SCRIPTS_HOME/adopmnctl.sh stopall

2. Clean out the Apache/oc4j log files in IAS 10g (10.1.3) ORACLE_HOME:

From an Unix shell where the Apps environment has been sourced,

a-1. $ cd $LOG_HOME/ora/10.1.3/Apache/
a-2. $ pwd (Verify that you are in the "Apache logs directory")
a-3. $ rm -r *

b-1. $ cd $LOG_HOME/ora/10.1.3/opmn/
b-2. $ pwd (Verify that you are in the "opmn logs directory")
b-3. $ rm -r *

c-1. $ rm $APPLRGF/javacache.log

d-1. $ cd $APPLRGF/jvmDump
d-2. $ pwd (Verify that you are in the "jvmDump directory")
d-3. $ rm -r *

For EACH j2ee log group, purge the following files:

You could have multiple JVMs per each type of log groups so "default_group_#" refers to generic #. Whereby the steps below for cleaning should be for each JVM.

e-1. $ cd $LOG_HOME/ora/10.1.3/j2ee/forms/[ forms_default_group_# ]
e-2. $ pwd (Verify that you are in the "forms_default_group_#" directory)
e-3. $ rm -r *

f-1. $ cd $LOG_HOME/ora/10.1.3/j2ee/oacore/[ oacore_default_group_# ]
f-2. $ pwd (Verify that you are in the "oacore_default_group_#" directory)
f-3. $ rm -r *

g-1. $ cd $LOG_HOME/ora/10.1.3/j2ee/oafm/
g-2. $ pwd (Verify that you are in the oafm directory)
g-3. $ rm -r *

h-1. $ cd $LOG_HOME/ora/10.1.3/j2ee/oafm/[ oacore_default_group_# ]
h-2. $ pwd (verify that you are in the "oafm_default_group_#" directory)
h-3. $ rm -r *

Ref : Which Application Log Files May Be Manually Purged Regularly? (Doc ID 2005894.1)

Tuesday, August 8, 2017

Tuning OPP Heap Memory Issue

SELECT service_id, service_handle, developer_parameters
FROM fnd_cp_services WHERE service_id = (SELECT manager_type
FROM fnd_concurrent_queues
WHERE concurrent_queue_name = 'FNDCPOPP');

use the below command to check whether you will succeed with 2GB of heapsize or not.

$ java -Xmx2048m -version

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Increase the memory value from 512 to 1024 or higher

UPDATE fnd_cp_services
SET developer_parameters ='J:oracle.apps.fnd.cp.gsf.GSMServiceController:-mx1024m'
WHERE service_id = (SELECT manager_type FROM fnd_concurrent_queues
WHERE concurrent_queue_name = 'FNDCPOPP');


Monday, August 7, 2017

Find Details of Specific OS PID

SELECT p.spid, s.SID, s.serial#, s.action, s.username, s.status, s.program "Session Program",
       p.program "Process Program", s.module, s.lockwait, s.state, s.sql_hash_value,
       s.schemaname, s.osuser, s.machine, s.last_call_et, p.program,
       p.terminal, logon_time, module, s.osuser , f.request_id,  f.request_date,
        f.completion_text, f.outcome_product,
        f.logfile_node_name, f.outfile_name, argument_text,
       f.outfile_node_name, f.oracle_id, f.concurrent_program_id,
       f.responsibility_application_id, f.responsibility_id,
       f.last_update_login, f.nls_language, f.controlling_manager, f.actual_start_date,f.actual_completion_date
  FROM v$process p, v$session s, fnd_concurrent_requests f
 WHERE s.paddr = p.addr /*and s.status = 'ACTIVE'*/
   AND s.username NOT LIKE '%SYS%'
   AND p.spid IN (SELECT oracle_process_id
                    FROM fnd_concurrent_requests
                   WHERE 1 = 1 AND oracle_process_id = &os_pid);

Find Concurrent Request id from SID

SELECT s.inst_id,a.request_id,s.sid,s.serial#,c.spid
  FROM apps.fnd_concurrent_requests a, gv$process c, gv$session s
   WHERE s.sid in ('&SID')
  AND s.paddr = c.addr
  AND a.oracle_process_id = c.spid
  AND a.phase_code = UPPER ('R');

Inactive Sessions

Inactive Session:

select distinct  a.logon_time,a.sql_id,a.username,a.module,a.inst_id,a.osuser,a.program,substr(machine,1,20) "Machine Name",a.status, ' alter system kill session '''||a.sid||','||a.serial#||''';'
from gv$session a, gv$sql b 
where a.status='INACTIVE'
and a.logon_time < sysdate-1 --and a.module like '%JDBC Thin Client%'
and a.machine like ‘%hostname%'  and username='APPS'

and a.sql_id=b.sql_id;

Total Count of sessions

select count(s.status) TOTAL_SESSIONS
from gv$session s;

Total Count of Inactive sessions

select count(s.status) INACTIVE_SESSIONS
from gv$session s, v$process p
where
p.addr=s.paddr and
s.status='INACTIVE';

SESSIONS WHICH ARE IN INACTIVE STATUS FROM MORE THAN 1HOUR

select count(s.status) "INACTIVE SESSIONS > 1HOUR "
from gv$session s, v$process p
where
p.addr=s.paddr and
s.last_call_et > 3600 and
s.status='INACTIVE';

How to Kill a INACTIVE session:

select 'alter system kill session ''' ||sid|| ',' || serial#|| ''' immediate;' from v$session where status='INACTIVE';


TOTAL FORM SESSIONS

SELECT COUNT(S.SID) INACTIVE_FORM_SESSIONS FROM V$SESSION S
WHERE S.STATUS='INACTIVE' and
s.action like ('%FRM%');

INACTIVE FORM SESSION:

col program for a15
col last_call_et for 999.99
select p.spid, s.sid, s.process,s.last_call_et/3600 last_call_et ,s.status,s.action,s.module,s.program,t.disk_reads,lpad(t.sql_text,30) "Last SQL"
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status='INACTIVE'
and s.action like 'FRM:%'
and s.last_call_et > 3600
order by last_call_et desc;


TOAD SESSIONS

select p.spid, s.sid,s.process cli_process,s.last_call_et/3600 last_call_et ,
s.status,s.action,s.module,s.program
from gv$session s, gv$process p
where
p.addr=s.paddr
and s.MODULE like ('%TOAD%')
Order by last_call_et;

Thursday, July 20, 2017

R12.2.4 : Unable to locate the server named error in supplier search page

Error:

While accessing Supplier Entry getting the below error,

Description: Unable to locate the server named "fa5099-obiee.oracleads.com" --- the server does not have a DNS entry. Perhaps there is a misspelling in the server name, or the server no longer exists. Double-check the name and try again.

Solution:

Navigation: Payables Manager -> Suppliers -> Entry

Click “Personalize Page”:

Search for "Rich Container", you will be able to find 2 elements, and click the update seed and set the renderedd property to false for both the elements.

To Enable the personalize in EBS:

Set the profile value,

FND: Personalization Region Link Enabled = Yes
Personalize Self-Service Defn = Yes
Disable Self-Service Personal = No


Wednesday, July 19, 2017

staus: Failure - Test Failed: IO Error: Got minus one from a read call Error

While connecting the database through sql developer got error,

"staus: Failure - Test Failed: IO Error: Got minus one from a read call"

Solution:

set "tcp.validnode_checking = no" or comment this parameter in sqlnet.ora file then restart listener on db server and test again.


Find Process ID from SID

select spid
FROM V$SESSION S, V$PROCESS P
where s.sid = '362899073'
and s.paddr = p.addr;

Sunday, July 16, 2017

adoacorectl.sh: exiting with status 206

While starting the EBS services through adstrtall.sh script in DMZ server, we have got the below error.

Log File:

ias-instance id=TEST_oracle.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--------------------------------------------------------------------------------
ias-component/process-type/process-set:
    default_group/oacore/default_group/

Error
--> Process (index=1,uid=607085474,pid=0)
    no port available from the port range
    failed to start a managed process after the maximum retry limit
    no port available from the port range
    no port available from the port range
    Log:
    none

07/16/17-14:04:00 :: adoacorectl.sh: exiting with status 206

Solution:

Stopped the Discover services which is running in same server using ./opmnctl stopall

Started the EBS services using ./adstrtall.sh. now oacore service started without any issue.

Finally started the discover services.




Finding the PID of the process using a specific port

lsof -n -i :80 | grep LISTEN
nginx   125004 nginx    3u  IPv4   6645      0t0  TCP 0.0.0.0:80 (LISTEN)

netstat -tulnp |grep 1011

Thursday, July 13, 2017

Find Weblogic version and FMW EBS Component Version on R12.2

After Logging into the application set the environment to RUN Filesystem

. /u01/oracle/EBSapps.env run

Then
cat $FMW_HOME/wlserver_10.3/.product.properties | grep WLS_PRODUCT_VERSION

You will get Below Output:

WLS_PRODUCT_VERSION=10.3.6.0
To find the FMW version Oracle E-Business Suite Component Version on R12.2

export ORACLE_HOME=/u01/oracle/fs1/FMW_Home/Oracle_EBS-app1

./opatch lsinv

You will get below Output

Oracle E-Business Suite Component 11.1.1.6.0

Tuesday, July 11, 2017

SQL script to check product patchlevel or codelevel

SELECT app_short_name, MAX(patch_level)
FROM apps.ad_patch_driver_minipks
GROUP BY app_short_name ;

Friday, July 7, 2017

Check Current Undo Configuration and Advise Recommended Setup

SET SERVEROUTPUT ON
SET LINES 600
ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY HH24:MI:SS';

DECLARE
v_begin_time           varchar2(30);
v_end_time             varchar2(30);
v_max_qry_len          number;
v_unto_tbs             varchar2(100);
v_cur_undo_ret         number;
v_cur_undo_mb          number;
v_undo_autoext         varchar2(5);
v_cur_dt               date;
v_recommended_undo_mb  number;
v_analyse_start_time   date;
v_analyse_end_time     date;
BEGIN
select sysdate
into v_cur_dt
from dual;

select sysdate into v_cur_dt from dual;
DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('--------------------------------------------------');
DBMS_OUTPUT.PUT_LINE('- Undo Analysis started at : ' || v_cur_dt || ' -');
DBMS_OUTPUT.PUT_LINE('--------------------------------------------------');

SELECT begin_time,end_time into v_analyse_start_time, v_analyse_end_time
FROM v$undostat WHERE undoblks = (SELECT MAX(undoblks) FROM v$undostat);

DBMS_OUTPUT.PUT_LINE('NOTE:The following analysis is based upon the peak database workload during the period -');
DBMS_OUTPUT.PUT_LINE('Begin Time : ' || v_analyse_start_time);
DBMS_OUTPUT.PUT_LINE('End Time   : ' || v_analyse_end_time);


select min(BEGIN_TIME), max(end_time) into v_begin_time, v_end_time from v$undostat;
select max(MAXQUERYLEN) into v_max_qry_len from v$undostat;
select value into v_cur_undo_ret from v$parameter where name = 'undo_retention';
select value into v_unto_tbs from v$parameter where name = 'undo_tablespace';

SELECT ROUND((UR * (UPS * DBS))/1024/1024)
INTO v_recommended_undo_mb
FROM
 ( select max(MAXQUERYLEN) UR
from v$undostat) ,
 (SELECT undoblks/((end_time-begin_time)*86400) AS UPS
  FROM v$undostat
  WHERE undoblks =
  (SELECT MAX(undoblks)
FROM v$undostat)),
 (SELECT block_size AS DBS
  FROM dba_tablespaces
  WHERE tablespace_name =
  (SELECT UPPER(value)
FROM v$parameter
WHERE name = 'undo_tablespace'));


select sum(bytes)/1024/1024 into v_cur_undo_mb from dba_data_files where tablespace_name = v_unto_tbs;

SELECT CASE(select count(*) from dba_data_files
where tablespace_name = v_unto_tbs
and autoextensible = 'YES')
WHEN 0 THEN 'OFF'
ELSE 'ON' END
into v_undo_autoext
from dual;

DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('----');
DBMS_OUTPUT.PUT_LINE(RPAD('Longest running query ran for : ',40) || ' : ' || v_max_qry_len || ' Seconds');
DBMS_OUTPUT.PUT_LINE(RPAD('Current undo retention is ',40) || ' : ' || v_cur_undo_ret || ' Seconds');
DBMS_OUTPUT.PUT_LINE(RPAD('Current undo tablespace size is ',40) || ' : ' || v_cur_undo_mb || 'M');
DBMS_OUTPUT.PUT_LINE(RPAD('AUTOEXTEND for undo tablespace size is ',40) || ' : ' || v_undo_autoext);
DBMS_OUTPUT.PUT_LINE('----');
DBMS_OUTPUT.PUT_LINE(RPAD('Recommended undo retention is ',40) || ' : ' || TO_CHAR(v_max_qry_len+1) || ' Seconds');
DBMS_OUTPUT.PUT_LINE(RPAD('Recommended undo tablespace size is ',40) || ' : ' || v_recommended_undo_mb || 'M');

select sysdate into v_cur_dt from dual;
DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('----------------------------------------------------');
DBMS_OUTPUT.PUT_LINE('- Undo Analysis completed at : ' || v_cur_dt || ' -');
DBMS_OUTPUT.PUT_LINE('----------------------------------------------------');

END;
/


Sample Output:
------------------

- Undo Analysis started at : 30/08/2013 11:08:40 -
---------------------------------------------------------
NOTE:The following analysis is based upon the database workload during the period -
Begin Time : 23/08/2013 11:08:40
End Time   : 30/08/2013 11:08:40

Current Undo Configuration
----------------------------------
Current undo tablespace                                              : UNDOTBS2
Current undo tablespace size (datafile size now)        : 20M
Current undo tablespace size (consider autoextend)   : 20M
AUTOEXTEND for undo tablespace is                      : ON
Current undo retention                                                : 900
UNDO GUARANTEE is set to                                  :FALSE

Undo Advisor Summary
------------------------------
Finding 1:Undo Tablespace is under pressure. Recommendation 1:Size undo tablespace to 26 MB

Undo Space Recommendation
------------------------------------
Minimum Recommendation                : Size undo tablespace to 26 MB
Rationale                                              : Increase undo tablespace size so that long running queries will not fail
Recommended Undo Tablespace Size : 26M

Retention Recommendation
---------------------------------
The best possible retention with current configuration is    : 9171 Seconds
The longest running query ran for                                        : 2543 Seconds
The undo retention required to avoid errors is                     : 2543 Seconds

PL/SQL procedure successfully completed.

 

Tuesday, July 4, 2017

Find the Concurrent Manager Status through Back END

select
decode(CONCURRENT_QUEUE_NAME,
'FNDICM','Internal Manager',
'FNDCRM','Conflict Resolution Manager',
'AMSDMIN','Marketing Data Mining Manager',
'C_AQCT_SVC','C AQCART Service',
'FFTM','FastFormula Transaction Manager'
,'FNDCPOPP','Output Post Processor',
'FNDSCH','Scheduler/Prereleaser Manager',
'FNDSM_AQHERP','Service Manager: AQHERP',
'FTE_TXN_MANAGER','Transportation Manager',
'IEU_SH_CS','Session History Cleanup',
'IEU_WL_CS','UWQ Worklist Items Release for Crashed session',
'INVMGR','Inventory Manager',
'INVTMRPM','INV Remote Procedure Manager',
'OAMCOLMGR','OAM Metrics Collection Manager',
'PASMGR','PA Streamline Manager',
'PODAMGR','PO Document Approval Manager',
'RCVOLTM','Receiving Transaction Manager',
'STANDARD','Standard Manager',
'WFALSNRSVC','Workflow Agent Listener Service',
'WFMLRSVC','Workflow Mailer Service','WFWSSVC',
'Workflow Document Web Services Service','WMSTAMGR',
'WMS Task Archiving Manager',
'XDP_APPL_SVC','SFM Application Monitoring Service',
'XDP_CTRL_SVC','SFM Controller Service',
'XDP_Q_EVENT_SVC','SFM Event Manager Queue Service',
'XDP_Q_FA_SVC','SFM Fulfillment Actions Queue Service',
'XDP_Q_FE_READY_SVC','SFM Fulfillment Element Ready Queue Service',
'XDP_Q_IN_MSG_SVC','SFM Inbound Messages Queue Service',
'XDP_Q_ORDER_SVC','SFM Order Queue Service',
'XDP_Q_TIMER_SVC','SFM Timer Queue Service',
'XDP_Q_WI_SVC','SFM Work Item Queue Service',
'XDP_SMIT_SVC','SFM SM Interface Test Service')
as "Concurrent Manager's Name",
max_processes as "TARGET Processes",
running_processes as "ACTUAL Processes"
from apps.fnd_concurrent_queues
where CONCURRENT_QUEUE_NAME in ('FNDICM','FNDCRM','AMSDMIN','C_AQCT_SVC','FFTM','FNDCPOPP','FNDSCH','FNDSM_AQHERP','FTE_TXN_MANAGER','IEU_SH_CS','IEU_WL_CS','INVMGR','INVTMRPM','OAMCOLMGR','PASMGR','PODAMGR','RCVOLTM','STANDARD','WFALSNRSVC','WFMLRSVC','WFWSSVC','WMSTAMGR','XDP_APPL_SVC','XDP_CTRL_SVC','XDP_Q_EVENT_SVC','XDP_Q_FA_SVC','XDP_Q_FE_READY_SVC','XDP_Q_IN_MSG_SVC','XDP_Q_ORDER_SVC','XDP_Q_TIMER_SVC','XDP_Q_WI_SVC','XDP_SMIT_SVC');

Monday, July 3, 2017

Find the Number of Concurrent Requests were completed for last 7 Days

select
trunc(REQUESTED_START_DATE),count(*)
FROM FND_CONCURRENT_REQUESTS
WHERE REQUESTED_START_DATE BETWEEN sysdate-7 AND sysdate
group by rollup(trunc(REQUESTED_START_DATE));


Friday, June 23, 2017

How to create and remove a soft link in Linux

A symlink can be created like:

ln -s /path/ linkname

To remove a symlink

rm linkname

Tuesday, June 20, 2017

Find currently Running Concurrent Jobs

SELECT DISTINCT c.USER_CONCURRENT_PROGRAM_NAME,
      round(((sysdate-a.actual_start_date)*24*60*60/60),2) AS Process_time,
    a.request_id,a.parent_request_id,a.request_date,a.actual_start_date,a.actual_completion_date,
      (a.actual_completion_date-a.request_date)*24*60*60 AS end_to_end,
      (a.actual_start_date-a.request_date)*24*60*60 AS lag_time,
      d.user_name, a.phase_code,a.status_code,a.argument_text,a.priority
FROM     apps.fnd_concurrent_requests a,
    apps.fnd_concurrent_programs b , 
    apps.FND_CONCURRENT_PROGRAMS_TL c,
    apps.fnd_user d
WHERE   a.concurrent_program_id=b.concurrent_program_id AND
    b.concurrent_program_id=c.concurrent_program_id AND
    a.requested_by=d.user_id AND
    status_code='R' order by Process_time desc;

Find sid,serial#,spid of the concurrent Request.

SELECT a.request_id, d.sid, d.serial# , c.SPID
    FROM apps.fnd_concurrent_requests a,
    apps.fnd_concurrent_processes b,
    v$process c,
    v$session d
    WHERE a.controlling_manager = b.concurrent_process_id
    AND c.pid = b.oracle_process_id
    AND b.session_id=d.audsid
    AND a.request_id = &Request_ID
    AND a.phase_code = 'R';

Find Currently Running Concurrent Program withe processed Time

SELECT DISTINCT c.USER_CONCURRENT_PROGRAM_NAME,round(((sysdate-a.actual_start_date)*24*60*60/60),2) AS Process_time,
 a.request_id,a.parent_request_id,a.request_date,a.actual_start_date,a.actual_completion_date,(a.actual_completion_date-a.request_date)*24*60*60 AS end_to_end,
 (a.actual_start_date-a.request_date)*24*60*60 AS lag_time,d.user_name, a.phase_code,a.status_code,a.argument_text,a.priority
FROM   apps.fnd_concurrent_requests a,apps.fnd_concurrent_programs b,apps.FND_CONCURRENT_PROGRAMS_TL c,apps.fnd_user d
WHERE  a.concurrent_program_id=b.concurrent_program_id AND b.concurrent_program_id=c.concurrent_program_id AND
a.requested_by=d.user_id AND status_code='R' order by Process_time desc;

Monday, June 12, 2017

Find Table Locked or not and How to Unlock Table

To check table has been locked or not:

select owner, table_name, stattype_locked
from dba_tab_statistics
where stattype_locked is not null


Unlock the particular table:

exec dbms_stats.unlock_table_stats('APPLSYS','FND_CP_GSM_IPC_AQTBL');
exec dbms_stats.unlock_table_stats('APPLSYS','FND_SOA_JMS_IN');
exec dbms_stats.unlock_table_stats('APPLSYS','FND_SOA_JMS_OUT');

Find SQL Statement from Concurrent Request

SELECT A.REQUEST_ID, D.SID, D.SERIAL#, D.OSUSER, D.PROCESS, C.SPID,
       E.SQL_TEXT
  FROM APPS.FND_CONCURRENT_REQUESTS A,
       APPS.FND_CONCURRENT_PROCESSES B,
       V$PROCESS C,
       V$SESSION D,
       V$SQL E
WHERE A.CONTROLLING_MANAGER = B.CONCURRENT_PROCESS_ID
   AND C.PID = B.ORACLE_PROCESS_ID
   AND B.SESSION_ID = D.AUDSID
   AND D.SQL_ADDRESS = E.ADDRESS
   AND A.REQUEST_ID = &REQUEST_ID;

Find SQL statement from SID

select sql_text from gv$sqltext where hash_value in (select sql_hash_value
from gv$session where sid in (&sid)) order by hash_value, piece;

Compile JSP Manually in Oracle Apps

perl ojspCompile.pl –-compile –-flush -p 2

Find Patch Level Version

SELECT patch_level FROM fnd_product_installations WHERE patch_level LIKE '%HR%';

Find SID from Concurrent Request ID & PID

From Concurrent Request ID

select SID,SERIAL# from gv$session
where audsid in (
select oracle_session_id
from apps.fnd_concurrent_requests
where request_id = &conc_req_number);

From PID:


select * from v$session where paddr in (select addr from v$process where spid = 7590);

How to Kill the Session Block

select * from dba_blockers;

HOLDING_SESSION
---------------
            332

select inst_id,sid,serial#,spid,username,program from gv$session where sid=332;


ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;

List Particular Responsibilities for All User

SELECT fu.user_name,frt.RESPONSIBILITY_NAME
FROM
fnd_user_resp_groups furg,
FND_RESPONSIBILITY fr,
fnd_responsibility_tl frt,
fnd_user fu
WHERE fu.user_id = furg.user_id
AND furg.responsibility_id = fr.RESPONSIBILITY_ID
AND frt.responsibility_id = fr.RESPONSIBILITY_ID
AND frt.responsibility_name like '%system%Admi%'
ORDER BY 1

Find the Concurrent Program for Request set

select user_concurrent_program_name
  from fnd_concurrent_programs_tl
 where concurrent_program_id in
          (select concurrent_program_id
             from fnd_request_set_programs
            where request_set_id =
                     (select request_set_id
                        from fnd_request_sets_tl
                       where upper(user_request_set_name) = upper('&request_set_name')));

Find Block Session

select l1.sid, ' IS BLOCKING ', l2.sid  from v$lock l1, v$lock l2
 where l1.block =1 and l2.request > 0  and l1.id1=l2.id1  and l1.id2=l2.id2;


SELECT DECODE(request,0,'Holder: ','Waiter: ')||sid sess , id1, id2, lmode,request, type
FROM v$lock
WHERE (id1, id2, type) IN
(SELECT id1, id2, type FROM v$lock WHERE request>0)
ORDER BY id1, request;

How to Continue the Failed Patch Session in R12.1.3 ERP Application

sqlplus applsys/apps

create table fnd_Install_processes_bkp as select * from fnd_Install_processes;
select count(*) from fnd_Install_processes_back;
select count(*) from fnd_Install_processes;

create table AD_DEFERRED_JOBS_back as select * from AD_DEFERRED_JOBS;
select count(*) from AD_DEFERRED_JOBS_back;
select count(*) from AD_DEFERRED_JOBS;

3. Backup the .rf9 files located in $APPL_TOP/admin/restart directory. At this point, the
adpatch session should have ended and the cursor should be back at the UNIX prompt.
cd $APPL_TOP/admin/
mv restart restart_back
mkdir restart

4. Drop the FND_INSTALL_PROCESSES table and the AD_DEFFERED_JOBS table.
sqlplus applsys/apps
drop table FND_INSTALL_PROCESSES;
drop table AD_DEFERRED_JOBS;

Now apply the pre-requirement patch and then restore the above mentioned tables, files . Finally continue the patch session


Find Database Growth Monthly Wise

select to_char(creation_time, 'YYYY Month') "Month",
    sum(bytes)/1024/1024 "Growth in MB"
    from sys.v_$datafile
    where creation_time > SYSDATE-365
    group by to_char(creation_time, 'YYYY Month');

Find Custom Top Details in Oracle Apps

Select BASEPATH,PRODUCT_CODE,APPLICATION_SHORT_NAME
From fnd_application
Where application_Short_name like '%CUST_TOP_name%';

Find Current Login Users in Oracle Apps

select user_name,to_char(last_logon_date,'DD-MON-YYYY HH24:MI:SS') from apps.fnd_user where to_char(last_logon_date,'DD-MON-YYYY')=to_char(sysdate,'DD-MON-YYYY');

Find number of users connected to Oracle Apps in the last 15 minutes

select limit_time, limit_connects, to_char(last_connect, ‘DD-MON-RR HH:MI:SS’) “Last Connection time”, user_id, disabled_flag from icx_sessions where last_connect > sysdate – 1/96;

Find Number of users connected to Oracle Apps in the past 1 day

select count(distinct user_id) “users” from icx_sessions where last_connect > sysdate – 1 and user_id != ‘-1';

Find Number of users connected to Oracle Apps in the past 1 hour

select count(distinct user_id) "users" from icx_sessions where last_connect > sysdate - 1/24 and user_id != '-1';

Find number of concurrent_users connected to Oracle apps

select count(distinct d.user_name) from apps.fnd_logins a, v$session b, v$process c, apps.fnd_user d
where b.paddr = c.addr and a.pid=c.pid and a.spid = b.process and d.user_id = a.user_id
and (d.user_name = ‘USER_NAME’ OR 1=1)

Find the Concurrent Request By User Level

select
user_concurrent_program_name,
responsibility_name,
request_date,
argument_text,
request_id,
phase_code,
status_code,
logfile_name,
outfile_name,
output_file_type
FROM
fnd_concurrent_requests fcr,
fnd_concurrent_programs_tl fcp,
fnd_responsibility_tl fr,
fnd_user fu
WHERE
fcr.CONCURRENT_PROGRAM_ID = fcp.concurrent_program_id
and fcr.responsibility_id = fr.responsibility_id
and fcr.requested_by = fu.user_id
and user_name = upper(:user_name)
ORDER BY REQUEST_DATE DESC;

Find the User Name from Concurrent Request ID

select a.request_id,b.user_name from fnd_concurrent_requests a,fnd_user b where a.requested_by=b.user_id and a.request_id='&requestid';

How to Kill Long Running Concurrent Request

SELECT a.request_id, d.sid, d.serial#, a.requested_start_date
FROM apps.fnd_concurrent_requests a,
apps.fnd_concurrent_processes b,
v$process c,
v$session d
--v$sql e
WHERE a.controlling_manager = b.concurrent_process_id
AND c.pid = b.oracle_process_id
AND d.paddr = c.addr
--AND d.sql_address = e.address
AND a.request_id = 13165515
AND a.phase_code = 'R'

ALTER SYSTEM KILL SESSION '732,1643';

Still concurrent Request running, update the table using below query

UPDATE fnd_concurrent_requests SET phase_code = ‘C’, status_code = ‘X’ WHERE request_ID = 13165515;

Find Request ID from SID

SELECT   vp.spid,
         vs.sid,
         fcr.request_id
  FROM   v$process vp,
         v$session vs,
         fnd_Concurrent_requests fcr
 WHERE   vs.paddr              = vp.addr
   AND   fcr.oracle_process_id = vp.spid
   AND   vs.sid                = :l_sid

Find Concurrent Manager Lock Session

SELECT v$access.sid, v$session.serial#
FROM v$session,v$access
WHERE v$access.sid = v$session.sid and v$access.object = ‘FND_CP_FNDSM’
GROUP BY v$access.sid, v$session.serial#;


alter system kill session ‘2000,1000’;

Find Affected Modules By Patch

select distinct aprb.application_short_name as "Affected Modules"
from ad_applied_patches aap,
ad_patch_drivers apd,
ad_patch_runs apr,
ad_patch_run_bugs aprb
where aap.applied_patch_id = apd.applied_patch_id
and apd.patch_driver_id = apr.patch_driver_id
and apr.patch_run_id = aprb.patch_run_id
and aprb.applied_flag = 'Y'
and aap.patch_name = '&PatchName';

Identify the PIDs of NodeManager, AdminServer, and all Managed servers in EBS R12.2

ps -ef | grep "NodeManager"
ps -ef | grep "weblogic.Name=AdminServer"
ps -ef | grep "weblogic.Name=forms-c4ws_server"
ps -ef | grep "weblogic.Name=forms_server"
ps -ef | grep "weblogic.Name=oafm_server"
ps -ef | grep "weblogic.Name=oacore_server"

ERROR - CLONE-20365 Error in executing WebLogic script

While doing the rapid clone in R12.2.4 application we have faced the below issue

RcloneApplyAppsTier.log:


START: Creating new WLS domain. 
Running /u01/app/oracle/TST/fs1/FMW_Home/oracle_common/bin/pasteConfig.sh -javaHome /u01/app/
oracle/TST/fs1/EBSapps/comn/util/jdk64 -al /u01/app/oracle/TST/fs1/EBSapps/comn/clone/FMW/WLS/EBSdomain.jar -tdl /u01/app/oracle/TSTX/fs1/FMW_Home/user_projects/domains/EBS_domain_TST -tmw /u01/app/oracle/TST/fs1/FMW_Home -mpl /u01/app/oracle/TST/fs1/EBSapps/comn/clone/FMW/WLS/plan/moveplan.xml -ldl /u01/app/oracle/TST/fs1/inst/apps/TST_oracle/admin/log/clone/run/wlsT2PApply -silent true -debug true -domainAdminPassword /u01/app/oracle/TST/fs1/EBSapps/comn/clone/FMW/tempinfo.txt 
Script Executed in 141503 milliseconds, returning status 255 
ERROR: Script failed, exit code 255 


In Clone_timestamp.log file:

Error: writeTemplate() failed. Do dumpStack() to see details.
Problem invoking WLST - Traceback (innermost last):
  File "/tmp/CLONINGCLIENT-1223456789/tmp123456789.py", line 239, in ?
  File "/tmp/WLSTOfflineIni123456789.py", line 74, in writeTemplate
at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:51)
at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:1538)
at com.oracle.cie.domain.script.jython.WLScriptContext.writeTemplate(WLScriptContext.java:831)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)


com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.ScriptException: java.io.IOException: No space left on device

Solution:

Increased the /tmp mount point size as much as and rerun the adcfgclone.pl 

RC-50014: Fatal: Execution of AutoConfig was failed in R12.2

While doing R12.2 cloning we have faced this issue.
[PROFILE PHASE]
AutoConfig could not successfully execute the following scripts:
Directory: /u01/oracle/TEST/apps/tech_st/10.1.3/perl/bin/perl -I /u01/oracle/TEST/apps/tech_st/10.1.3/perl/lib/5.8.3 -I /u01/oracle/TEST/apps/tech_st/10.1.3/perl/lib/site_perl/5.8.3 -I /u01/oracle/TEST/apps/apps_st/appl/au/12.0.0/perl -I /u01/oracle/TEST/apps/tech_st/10.1.3/Apache/Apache/mod_perl/lib/site_perl/5.8.3/i686-linux-thread-multi /u01/oracle/TEST/inst/apps/TEST_kumar/admin/scripts/adexecsql.pl sqlfile=/u01/oracle/TEST/inst/apps/TEST_kumar/admin/install
afwebprf.sql            INSTE8_PRF         1
amscmprf.sql            INSTE8_PRF         1
amswebprf.sql           INSTE8_PRF         1
bisadmprf.sql           INSTE8_PRF         1
bisdblrp.sql            INSTE8_PRF         1
clnadmprf.sql           INSTE8_PRF         1
cncmprf.sql             INSTE8_PRF         1
cseadmprf.sql           INSTE8_PRF         1
csfadmprf.sql           INSTE8_PRF         1
csiadmprf.sql           INSTE8_PRF         1
eamadmprf.sql           INSTE8_PRF         1
fteadmprf.sql           INSTE8_PRF         1
icxwebprf.sql           INSTE8_PRF         1
oksfrmprf.sql           INSTE8_PRF         1
wshadmprf.sql           INSTE8_PRF         1
[APPLY PHASE]
AutoConfig could not successfully execute the following scripts:
Directory: /u01/oracle/TEST/apps/tech_st/10.1.3/perl/bin/perl -I /u01/oracle/TEST/apps/tech_st/10.1.3/perl/lib/5.8.3 -I /u01/oracle/TEST/apps/tech_st/10.1.3/perl/lib/site_perl/5.8.3 -I /u01/oracle/TEST/apps/apps_st/appl/au/12.0.0/perl -I /u01/oracle/TEST/apps/tech_st/10.1.3/Apache/Apache/mod_perl/lib/site_perl/5.8.3/i686-linux-thread-multi /u01/oracle/TEST/inst/apps/TEST_kumar/admin/install
adadmat.pl              INSTE8_APPLY       1

[APPLY PHASE]
AutoConfig could not successfully execute the following scripts:
Directory: /u01/oracle/TEST/apps/tech_st/10.1.3/perl/bin/perl -I /u01/oracle/TEST/apps/tech_st/10.1.3/perl/lib/5.8.3 -I /u01/oracle/TEST/apps/tech_st/10.1.3/perl/lib/site_perl/5.8.3 -I /u01/oracle/TEST/apps/apps_st/appl/au/12.0.0/perl -I /u01/oracle/TEST/apps/tech_st/10.1.3/Apache/Apache/mod_perl/lib/site_perl/5.8.3/i686-linux-thread-multi /u01/oracle/TEST/inst/apps/TEST_kumar/admin/install
adadmat.pl              INSTE8_APPLY       1
AutoConfig is exiting with status 16
RC-50014: Fatal: Execution of AutoConfig was failed
Raised by oracle.apps.ad.clone.ApplyApplTop
ERROR: AutoConfig completed with errors. Check logfile at /u01/oracle/TEST/inst/apps/TEST_kumar/admin/log/ApplyAppsTier_10071110.log for details.
ApplyApplTop Completed Successfully.
# Checking the status of AutoConfig run of ApplyApplTop
Warning : AutoConfig has completed with  errors .
Please review the AutoConfig section in the logfile. If required, you can re-run AutoConfig from command line  after fixing the problem


Cause:

NLS_LANG parameter was already set on server.
To check $env|grep NLS
Solution:
unset NLS_LANG and then run adcfgclone.pl

Java was blocked because it is out of date and needs to be updated IE Warnings with Oracle EBS

While opening the ebs form we may get this below mentioned issue.

Java was blocked because it is out of date and needs to be updated

Solution:

Add the ebs url in trusted sites and retry the issue.

Navigation : IE Settings > Internet Options > Security > Trusted Sites > Sites > Add


Monday, May 29, 2017

Find the size of the SCHEMA/USER?

select sum(bytes/1024/1024)"size" from dba_segments where owner='&owner';

Find the log file for active workflow mailer and workflow agent listener Container

select fl.meaning,fcp.process_status_code,
decode(fcq.concurrent_queue_name,’WFMLRSVC’,’maile r container’,’WFALSNRSVC’,’listener container’,fcq.concurrent_queue_name),
fcp.concurrent_process_id,os_process_id, fcp.logfile_name
from fnd_concurrent_queues fcq, fnd_concurrent_processes fcp , fnd_lookups fl
where fcq.concurrent_queue_id=fcp.concurrent_queue_id and fcp.process_status_code=’A’
and fl.lookup_type=’CP_PROCESS_STATUS_CODE’ and
fl.lookup_code=fcp.process_status_code
and concurrent_queue_name in(‘WFMLRSVC’,’WFALSNRSVC’)
order by fcp.logfile_name;

Start/Stop Individual Components in Opmn



./opmnctl startproc ias-component=coreapplication_obis1

./opmnctl stopproc ias-component=coreapplication_obis1

Thursday, May 25, 2017

Rolling back an Autoconfig session

Each execution of Autoconfig creates a rollback script in case you need to revert to previous configuration settings.

Tier                                       Directory
Application    $APPL_TOP/admin/<CONTEXT_NAME>/out/<MMDDhhmm>
Database       $ORACLE_HOME/appsutil/out/<CONTEXT_NAME>/<MMDDhhmm>


To roll back an autoconfig session, run: restore.sh script

Database User Create/Alter

Create User:

SQL> CREATE USER <username>
IDENTIFIED BY <password>
DEFAULT TABLESPACE <tablespace name>
TEMPORARY TABLESPACE <tablespace name>
QUOTA <quota amount> ON <tablespace name>;

You then need to grant appropriate roles to the user for example, session, connect, resource:

SQL> grant connect,resource to <username>;

Change Password:

SQL> alter user <username> identified by <newpassword>;

Unlock User:

SQL> alter user <username> account unlock;



Add tablespace / datafile

Increase the size of the datafile:

SQL> alter database datafile '/ebiz/oracle/test/db/apps_st/data/system04.dbf' autoextend on maxsize 1G;

SQL> alter database datafile '/ebiz/oracle/test/db/apps_st/data/system04.dbf' resize 3G;

Add an additional datafile:

SQL> alter tablespace system add datafile '/ebiz/oracle/test/db/apps_st/data/system05.dbf' size 2G;

Find Users connected to the Database

To find how many users are on the database issue the following:

SQL> SELECT username FROM v$session;

Show what users are running:

SQL> SELECT a.sid
, a.serial#
, b.sql_text
FROM v$session a
, v$sqlarea b
WHERE a.sql_address=b.address AND a.username = '<username>';


Find Database Users with DBA Privilege


 If you wish to know which users have been granted the dba role then you need to query the dba_role_privs in the SYS schema.


SQL> desc dba_role_privs
Name         Null?    Type
------------ -------- ------------
GRANTEE               VARCHAR2(30)
GRANTED_ROLE NOT NULL VARCHAR2(30)
ADMIN_OPTION          VARCHAR2(3)
DEFAULT_ROLE          VARCHAR2(3)

To find a list of all users with DBA privilege execute the following code:

SQL> select * from dba_role_privs where granted_role='DBA';
GRANTEE   GRANTED_ROLE ADM DEF
--------- ------------ --- ---
SYS       DBA          YES YES
SYSTEM    DBA          YES YES

Find Tablespace size including Autoextend Values

Using this below sql query, you can find the tablespace size including autoextend values which is enabled for datafiles.

WITH my_ddf AS
    (
        SELECT file_id, tablespace_name, file_name,
               DECODE (autoextensible,
                       'YES', GREATEST (BYTES, maxbytes),
                       BYTES
                      ) mysize,
              DECODE (autoextensible,
                      'YES', CASE
                         WHEN (maxbytes > BYTES)
                            THEN (maxbytes - BYTES)
                         ELSE 0
                      END,
                      0
                     ) growth
         FROM dba_data_files)
SELECT   my_ddf.tablespace_name,
         ROUND (SUM (my_ddf.mysize) / (1024 * 1024)) totsize,
         ROUND (SUM (growth) / (1024 * 1024)) growth,
         ROUND ((SUM (NVL (freebytes, 0))) / (1024 * 1024)) dfs,
         ROUND ((SUM (NVL (freebytes, 0)) + SUM (growth)) / (1024 * 1024)
               ) totfree,
         ROUND (  (SUM (NVL (freebytes, 0)) + SUM (growth))
                 / SUM (my_ddf.mysize)
                 * 100
               ) perc
    FROM my_ddf, (SELECT   file_id, SUM (BYTES) freebytes
                      FROM dba_free_space
                  GROUP BY file_id) dfs
   WHERE my_ddf.file_id = dfs.file_id(+)
         AND my_ddf.tablespace_name NOT LIKE '%UNDOTB%'
GROUP BY my_ddf.tablespace_name
ORDER BY 6 DESC