Friday, November 25, 2011

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired ORA-06512: at "APPS.WF_NOTIFICATION"

Approval Workflow Notification Mailer Error :

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired ORA-06512: at "APPS.WF_NOTIFICATION", line 5130 ORA-06512: at line 1

Solution:

Sql> Select do.owner, do.object_name, do.object_type, dl.session_id, vs.serial#, vs.program, vs.machine, vs.osuser
from dba_locks dl, dba_objects do,v$session vs
where do.object_name ='WF_NOTIFICATIONS' and do.object_type='TABLE' and dl.lock_id1 =do.object_id and vs.sid = dl.session_id;

Issue the command Alter system kill sessions 'Sid, serial#' immediate;

Troubleshooting Workflow Notification Mailer Issues

Find Workflow Notification Mailer is up and Running?

SELECT component_name, component_status
FROM fnd_svc_components
WHERE component_type = 'WF_MAILER';

Workflow log’s: FNDCPGSC*.txt under $APPLCSF/$APPLOG directory

Find the Failed One’s?

Select NOTIFICATION_ID, MESSAGE_TYPE, MESSAGE_NAME, STATUS, MAIL_STATUS, FROM_USER, TO_USER from wf_notifications where MAIL_STATUS='FAILED';

Check pending e-mail notification that was pending for process.

Sql> SELECT COUNT(*), message_name FROM wf_notifications
WHERE STATUS='OPEN'
AND mail_status = 'MAIL'
GROUP BY message_name;

Sql> SELECT * FROM wf_notifications
WHERE STATUS='OPEN'
AND mail_status = 'SENT'
ORDER BY begin_date DESC


Check the Workflow notification has been sent or not?

select mail_status, status from wf_notifications where notification_id=<notification_id>

--If mail_status is MAIL, it means the email delivery is pending for workflow mailer to send the notification
--If mail_status is SENT, its means mailer has sent email
--If mail_status is Null & status is OPEN, its means that no need to send email as notification preference of user is "Don't send email"
--Notification preference of user can be set by user by logging in application + click on preference + the notification preference

1. Verify whether the message is processed in WF_DEFERRED queue

select * from applsys.aq$wf_deferred a where a.user_data.getEventKey()= '<nid>'
<nid> - notification id

2. If the message is processed successfully message will be enqueued to WF_NOTIFICATION_OUT queue, if it errored out it will be enqueued to WF_ERROR queue

select wf.user_data.event_name Event_Name, wf.user_data.event_key Event_Key,
wf.user_data.error_stack Error_Stack, wf.user_data.error_message Error_Msg
from wf_error wf where wf.user_data.event_key = '<nid'>
To check what all mails have went and which all failed ?

Select from_user,to_user,notification_id, status, mail_status, begin_date
from WF_NOTIFICATIONS where status = 'OPEN';

Select from_user, to_user, notification_id, status, mail_status,begin_date,USER_KEY,ITEM_KEY,MESSAGE_TYPE,MESSAGE_NAME begin_date
from WF_NOTIFICATIONS where status = 'OPEN';


 Users complain that notifications are stuck ?

Use the following query to check to see whatever the users are saying is correct

SQL> select message_type, count(1) from wf_notifications
where status='OPEN' and mail_status='MAIL' group by message_type;

E.g o/p of query -

MESSAGE_Type      COUNT(1)
--------        ----------
POAPPRV                     11           --- 11 mails of Po Approval not sent ---
INVTROAP                    12
REQAPPRV                  9
WFERROR                     45             --- 45 mails have error


If Mail not received by User ?

select Name,DISPLAY_NAME,EMAIL_ADDRESS,NOTIFICATION_PREFERENCE,STATUS
from wf_users where DISPLAY_NAME=’xxx,yyy’ ;

Status – Active
Notification_preference-> Mailtext
Email Address should not be null

Notification not sent waiting to be mailed ?

SQL> select notification_id, status, mail_status, begin_date from WF_NOTIFICATIONS
where status = ‘OPEN’ and mail_status = ‘MAIL’;
To debug the notification id ?

$FND_TOP/sql
run wfmlrdbg.sql






Change Mail Preferences for all Application Users (FND USERS)

How to mass change Mail Preferences for FND USERS [ID 451929.1]
Solution :

Using sqlplus as the apps user:
1st Method:

 1.

update wf_local_roles
set notification_preference = 'MAILHTML'
where user_flag='Y'

2.

update fnd_user_preferences
set preference_value = 'MAILHTML'
where module_name = 'WF'
and preference_name = 'MAILTYPE'

commit;

2nd method:

Navigation: Connect to Applications as Sysadmin user and select responsibility

 Workflow Administrator  Web Applications --> Administration --> Global  Preferences


Temp Tablespace Usage/Free

TEMP Usage per session ?

SELECT   S.sid || ',' || S.serial# sid_serial, S.username, S.osuser, P.spid, S.module,
         S.program, SUM (T.blocks) * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,
         COUNT(*) sort_ops
FROM     v$sort_usage T, v$session S, dba_tablespaces TBS, v$process P
WHERE    T.session_addr = S.saddr
AND      S.paddr = P.addr
AND      T.tablespace = TBS.tablespace_name
GROUP BY S.sid, S.serial#, S.username, S.osuser, P.spid, S.module,
         S.program, TBS.block_size, T.tablespace
ORDER BY sid_serial;

Temp Space used/free?

select tablespace_name, bytes_used/1024/1024, bytes_free/1024/1024 from v$temp_space_header;

Users Using Temp tablespace?

select b.tablespace, (b.blocks*p.value)/1024/1024 , a.sid, a.username from sys.v_$session a, sys.v_$sort_usage b, sys.v_$parameter p
where p.name=b.session_addr;

To get which user is using temp tablespace ?

select username,tablespace,extents from v$sort_usage;

Free and Used Space in Temp Tablespace ?

SELECT   A.tablespace_name tablespace, D.mb_total,
         SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,
         D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free
FROM     v$sort_segment A,
         (
         SELECT   B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total
         FROM     v$tablespace B, v$tempfile C
         WHERE    B.ts#= C.ts#
         GROUP BY B.name, C.block_size
         ) D
WHERE    A.tablespace_name = D.name
GROUP by A.tablespace_name, D.mb_total;

Temp Usage By statement ?

SELECT   S.sid || ',' || S.serial# sid_serial, S.username,
         T.blocks * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,
         T.sqladdr address, Q.hash_value, Q.sql_text
FROM     v$sort_usage T, v$session S, v$sqlarea Q, dba_tablespaces TBS
WHERE    T.session_addr = S.saddr
AND      T.sqladdr = Q.address (+)
AND      T.tablespace = TBS.tablespace_name
ORDER BY S.sid;

Friday, August 26, 2011

Target node/queue unavailable or Concurrent Manager Issue’s after cloning or DB-Refresh


Target node/queue unavailable or Concurrent Manager Issue’s after cloning or DB-Refresh

Concurrent Processing - After Cloning All the Concurrent Managers Do Not Start for the Clone [ID 555081.1]

Conflict Resolution Manager Shows Target Node/Queue Unavailable [ID 732709.1]

Concurrent Managers Do Not Start After Cloning Nodes Not Updated In Conc_queues [ID 466532.1]


EXEC FND_CONC_CLONE.TARGET_CLEAN;

Run autoconfig on dbtier then appsTier.

Run cmclean.sql script  Non destructive script this can also be tried-->>

Start all application services and check whether managers are up.

Apply this solution in last when the above one doesnt work.

select node_name,target_node,control_code from fnd_concurrent_queues;

update apps.fnd_concurrent_queues set node_name = 'Node NAME' where node_name='Existing Node Name'; 

select NODE_NAME,NODE_MODE,STATUS from fnd_nodes;

desc fnd_concurrent_queues

select control_code,target_node,node_name,CONCURRENT_QUEUE_NAME from fnd_concurrent_queues;

UPDATE fnd_concurrent_queues set control_code = null;

UPDATE fnd_concurrent_queues set target_node = 'Node Name';

UPDATE fnd_concurrent_queues set node_name = 'Node Name';

update FND_CONCURRENT_QUEUES set control_code = null where concurrent_queue_name = 'OAMGCS_NODENAME'; -- supply the node name..(Ur Existing Node Name)

Commit;

select control_code,target_node,node_name,CONCURRENT_QUEUE_NAME from fnd_concurrent_queues;


Create defaults file for adPatch or adpatch defaultsfile


adpatch defaultsfile=$APPL_TOP/admin/PRODMAX/defaults.txt


Using Defaults file with adpatch (Non Interactive)

How to create defaults file ?

adpatch defaultsfile=$APPL_TOP/admin/$SID/defaults.txt ( You can keep this txt file in any location of your choice)

Now abort autopatch section at point where it asks for patch directory by ctrl +c or ctrl+d

Now check if this file exists

You have to do above steps only once in an environment to create defaults file.


How to apply patches in future ?

adpatch defaultsfile=$APPL_TOP/admin/$SID/defaults.txt

Now any future patches you apply non interactive using defaults file like

adpatch defaultsfile=$APPL_TOP/admin/$SID/defaults.txt logfile=654321.log patchtop=/patches/654321 driver=u654321.drv interactive=no

You will see that it will apply patch by itself using defaults file , adpatch will pick APP_TOP, ORACLE_HOME information, system password and apps password from defaults file.

This will save lot of time & you can reduce your patch timing usign defaults file

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired ORA-06512: at "APPS.WF_NOTIFICATION", line 5130 ORA-06512: at line 1


Appove Workflow Notification Mailer --

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired ORA-06512: at "APPS.WF_NOTIFICATION", line 5130 ORA-06512: at line 1

Solution :

select do.owner,do.object_name,do.object_type,dl.session_id,vs.serial#, vs.program,vs.machine,vs.osuser
from dba_locks dl,dba_objects do,v$session vs
where do.object_name ='WF_NOTIFICATIONS' and do.object_type='TABLE' and dl.lock_id1 =do.object_id and vs.sid = dl.session_id;

Issue the command

sql > alter system kill sessions 'sid,serial#' immediate;

Load Balancing in R12


Using Load-Balancers with Oracle E-Business Suite Release 12 [ID 380489.1]


Implementing Load Balancing On Oracle E-Business Suite -
Documentation For Specific Load Balancer Hardware [ID 727171.1]


Sharing The Application Tier File System in Oracle E-Business Suite Release 12 [ID 384248.1]
Add new node to application ---- 384248.1

TEMP Usuage

TEMP Space Used

select tablespace_name, bytes_used/1024/1024, bytes_free/1024/1024 from v$temp_space_header;

USERS Using the tablespace

select b.tablespace, (b.blocks*p.value)/1024/1024 , a.sid, a.username from sys.v_$session a, sys.v_$sort_usage b, sys.v_$parameter p
where p.name=b.session_addr;

To get which user is using temp tablespace

select username,tablespace,extents from v$sort_usage;

TEMP Usuage per session

SELECT   S.sid || ',' || S.serial# sid_serial, S.username, S.osuser, P.spid, S.module,
         S.program, SUM (T.blocks) * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,
         COUNT(*) sort_ops
FROM     v$sort_usage T, v$session S, dba_tablespaces TBS, v$process P
WHERE    T.session_addr = S.saddr
AND      S.paddr = P.addr
AND      T.tablespace = TBS.tablespace_name
GROUP BY S.sid, S.serial#, S.username, S.osuser, P.spid, S.module,
         S.program, TBS.block_size, T.tablespace
ORDER BY sid_serial;

Free and Used Space in Temp Tablespace :

SELECT   A.tablespace_name tablespace, D.mb_total,
         SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,
         D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free
FROM     v$sort_segment A,
         (
         SELECT   B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total
         FROM     v$tablespace B, v$tempfile C
         WHERE    B.ts#= C.ts#
         GROUP BY B.name, C.block_size
         ) D
WHERE    A.tablespace_name = D.name
GROUP by A.tablespace_name, D.mb_total;

By statement --

SELECT   S.sid || ',' || S.serial# sid_serial, S.username,
         T.blocks * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,
         T.sqladdr address, Q.hash_value, Q.sql_text
FROM     v$sort_usage T, v$session S, v$sqlarea Q, dba_tablespaces TBS
WHERE    T.session_addr = S.saddr
AND      T.sqladdr = Q.address (+)
AND      T.tablespace = TBS.tablespace_name
ORDER BY S.sid;



SID AND SERIAL# OF APPLICATION USER :

lOGIN TO SYSADMIN NAVIGATE TO :
SECURITY USER -- MONITOR --
CHECK ORACLE PROCESS-ID

IF UNABLE TO SEE USERS -- SET PROFILE OPTION SIGN ON AUDIT TO FORM LEVEL
SAVe


SELECT SUBSTR(d.user_name,1,30) "User Name",a.pid,b.sid,b.serial#
FROM v$process a, v$session b, fnd_logins c, fnd_user d
WHERE a.pid = c.pid
AND c.pid = &PID
AND d.user_name = UPPER('&USER_NAME')
AND TO_DATE(c.start_time) = TO_DATE('&START_DATE')
AND d.user_id = c.user_id
AND a.addr = b.paddr
AND c.end_time IS NULL;

2) When prompted for "PID" enter the value that appears under the Oracle Process column on the form.

3) When prompted for "USER_NAME" enter the value that appears under the User Name column on the form.

4) When prompted for "START_DATE" enter the Date that the user started the session.


Another way to get this info is through OAM:

- Login to OAM
- Navigate to Site Map > Monitoring > Forms Sessions
- Click on "Session Details"






Tuesday, June 21, 2011

Request Warning Message : The Report will be submitted with default or preexisting values for request parameter

When I run any concurrent Request e.g active users I am getting warning when I click on Submit button

Warning : The Report will be submitted with default or preexisting values for request parameters,
completion options and report language.Press Ok to proceed with request submission
Press cancel to change the default request parameter values , to specify completion
options or to specify report language.


Solution : Note ID - 180092.1


This is an enchancement to alert the user that they are about to submit a request
with all the default values.

To fix this issue :

Turn off profile option -- CONCURRENT:VALIDATE REQUEST SUBMISSION to No

Now you will not get any warning message..


Friday, June 17, 2011

Create OraInventory.

Steps are described below:

Create the oraInst.loc File

If you plan to install Oracle products using the Installer in silent or suppressed mode, you must manually create the oraInst.loc file if it does not already exist. This file specifies the location of the Oracle Inventory directory where the Installer creates the inventory of Oracle products installed on the system.
Note:
If Oracle software has been installed previously on the system, the oraInst.loc file might already exist. If the file does exist, you do not need to create a new file.
To create the oraInst.loc file, follow these steps:

  1. Switch user to root:
         $su - root
  1. On HP-UX, Solaris, Tru64 UNIX, and zSeries Linux, create the /var/opt/oracle directory if it does not exist:
# mkdir -p /var/opt/oracle
  1. Change directory as follows, depending on your operating system:
             AIX, Linux x86, or Linux Itanium:
·         # cd /etc
             Other operating systems:
·         # cd /var/opt/oracle

  1.  Use a text editor to create the oraInst.loc file, containing the following lines:
e.g vi oraInst.loc
inventory_loc=ORACLE_BASE/oraInventory
inst_group=groupname e.g dba

In this example, ORACLE_BASE is the path of the Oracle base directory, for example, /u01/app/oracle.

  1. Enter the following commands to set the appropriate owner, group, and permissions on the oraInst.loc file:
E.g
# chown oracle: dba oraInst.loc
# chmod 664 oraInst.loc

Tuesday, June 14, 2011

Adpatch Fails due to Pre-req patch..

If Adpatch Fails due to pre-requisite Patch or for some other reason and (for e.g) 60 % of the applied has been applied and it took around 1 hour. Instead of applying this patch from begining you need to do the followong steps in order to save the time you spend while applying the patch.

1. Using the adctrl utility, shutdown the workers.
    a. adctrl
    b. Select option 3 “Tell worker to shutdown/quit”
  2. Backup the FND_INSTALL_PROCESSES table which is owned by the APPLSYS schema
    a. sqlplus applsys/<password>
    b. create table fnd_Install_processes_back
       as select * from fnd_Install_processes;
    c. The 2 tables should have the same number of records.
       select count(*) from fnd_Install_processes_back;
       select count(*) from fnd_Install_processes;
3.  Backup the AD_DEFERRED_JOBS table.
    a. sqlplus applsys/<password>
    b. create table AD_DEFERRED_JOBS_back
       as select * from AD_DEFERRED_JOBS;
    c. The 2 tables should have the same number of records.
       select count(*) from AD_DEFERRED_JOBS_back;
       select count(*) from AD_DEFERRED_JOBS;
4.  Backup the .rf9 files located in $APPL_TOP/admin/<SID>/restart directory.
    At this point, the adpatch session should have ended and the cursor should
    be back at the Unix prompt.
    a. cd $APPL_TOP/admin/<SID>
    b. mv restart restart_back
    c. mkdir restart
5.  Drop the FND_INSTALL_PROCESSES table and the AD_DEFERRED_JOBS table.
    a. sqlplus applsys/<password>
    b. drop table FND_INSTALL_PROCESSES;
    c. drop table AD_DEFERRED_JOBS;
6.  Apply the new patch ( say pre-req patch).
      Once this Pre-req Patch is applied successfully.
7.  Restore the .rf9 files located in $APPL_TOP/admin/<SID>/restart_back
    directory.
    a. cd $APPL_TOP/admin/<SID>
    b. mv restart restart_<patchnumber>
    c. mv restart_back restart
8. Restore the FND_INSTALL_PROCESSES table which is owned by the APPLSYS
    schema.
    a. sqlplus applsys/<password>
    b. create table fnd_Install_processes
       as select * from fnd_Install_processes_back;
    c. The 2 tables should have the same number of records.
       select count(*) from fnd_Install_processes;
       select count(*) from fnd_Install_processes_back;
9. Restore the AD_DEFERRED_JOBS table.
    a. sqlplus applsys/<password>
    b. create table AD_DEFERRED_JOBS
       as select * from AD_DEFERRED_JOBS_back;
    c. The 2 tables should have the same number of records.
       select count(*) from AD_DEFERRED_JOBS_back;
       select count(*) from AD_DEFERRED_JOBS;
10. Re-create synonyms
    a. sqlplus apps/apps
    b. create synonym AD_DEFERRED_JOBS for APPLSYS.AD_DEFERRED_JOBS;
    c. create synonym FND_INSTALL_PROCESSES FOR APPLSYS.FND_INSTALL_PROCESSES;
11. Start adpatch, it will resume where it stopped previously.