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