Saturday, 9 June 2012


How to Count Total Number of Users Connected to ORACLE Application [ID 295206.1]

 Modified 04-OCT-2008     Type HOWTO     Status MODERATED 

In this Document
  Goal
  Solution
  References

.
This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.

Applies to:

Oracle Application Object Library - Version: 11.5.9
Information in this document applies to any platform.

Goal

Want to determine how many users are connected to Oracle apps 11i,V$session does not give the true picture as mostly there are more than 1 oracle session for the same forms connection depending on how many forms the user has opened up.

Solution

1:- Can use this SQL statement to count concurrent_users in 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)

2:- In the Oracle Applications Manager, go to the site map, and select the "Applications Usage"
option in the Activity region. There you will be able to report on many usage questions, such as:

Products Installed
Application Users Per Module Summary
Applications Usage Reports
Suppliers
Purchase Line Items Processed - Internet Supplier Portal
Purchase Line Items Processed - Purchasing Intelligence
Order Entry Lines Processed - Ordering Application
Purchase Line Items Processed - iProcurement
Expense Reports Processed - Internet Expense
Invoice Line Items Processed - Accounts Receivables

Note the Application Users per module summary is based on the number of users that have Active responsibilities for the Application module. I am not aware of there being any check on last usage date for the responsibility.

3:- Also if you are using responsibilities connected to a custom-application, which is standard Consulting practice in some countries, those users will be counted as users of the custom-application and not users of the actual Application-module for the screens they are accessing.
4:- Run the following queries:-
    This will give the number of users on the system in the past 1 hour.
     select count(distinct user_id) "users" from icx_sessions where  last_connect > sysdate - 1/24 and user_id != '-1';

    This will give the number of users on the system in the past 1 day.
    select count(distinct user_id) "users" from icx_sessions where  last_connect > sysdate - 1 and user_id != '-1';

    This will show the activity 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;

5:-  Check the Note:233871.1 which will list users logged into Self Service Web Application, users logged into forms, and users running concurrent programs.

Surely this will affect the performance but how it affects is based on the number of users logged in and accessing the forms.

Factoring in System Overhead
========================

In planning your organization€™ Sign€“On Audit implementation, you should consider the additional system overhead required to precisely User and Data Auditing monitor and audit your users as they access Oracle Applications. The more users you audit and the higher the level of auditing, the greater the likelihood of incurring additional system overhead.

References

NOTE:233871.1 - Oracle Application Object Library Active Users Data Collection Test

Oracle Application Object Library Active Users Data Collection Test [ID 233871.1]



This test may already be available within your E-Business suite!

To execute the test, do the following:
  1. Login to Oracle E-Business Suite
  2. Select the responsibility "Oracle Diagnostics Tool" (see Note 358831.1 for details)
  3. Select application "Oracle Application Object Library" from the "Application" list of values
  4. Click the "Advanced" tab
  5. Scroll down to group "Data Collection"
  6. Select test name "Active Users"
  7. Input Parameters (* required)
      Responsibility Id (LOV) *  
  8. Output contains
    • Product Installation Status and Patchset Level
      Parameters
      Key Profile Options
      Self Service Web Application Users
      Forms-Based Products Users
      Concurrent Programs Users
      References

This test is available in Oracle Diagnostics 2.5 which introduces a new security model for test execution. See Note 409141.1 for more details. 
If this test is not available or any of the above steps fail, click on the "Installation Guide" link in the "Reference & Resource Menu". 

SQL Query To List Running Concurrent Requests:





col user_name format a20 word_wrapped
col ProgName format a25 word_wrapped
col requestId format 99999999
col StartDate format a20 word_Wrapped
col OS_PROCESS_ID format a6
col ETime format 99999999 word_Wrapped
col sid format 99999 word_Wrapped
set lines 200
select
sess.sid,sess.serial#,
oracle_process_id OS_PROCESS_ID,
fusr.description user_name ,
fcp.user_concurrent_program_name progName,
to_char(actual_Start_date,’DD-MON-YYYY HH24:MI:SS’) StartDate,
request_id RequestId,
(sysdate – actual_start_date)*24*60*60 ETime
from
fnd_concurrent_requests fcr,
fnd_concurrent_programs_tl fcp,
fnd_user fusr,
v$session sess
where
fcp.concurrent_program_id = fcr.concurrent_program_id
and fcr.program_application_id = fcp.application_id
and fcp.language = ‘US’
and fcr.phase_code = ‘R’
and fcr.status_code = ‘R’
and fcr.requested_by = fusr.user_id
and fcr.oracle_session_id = sess.audsid (+)
order by 5 DESC
/

1. Use this Script to get current sql statement that is running in the background for a given concurrent request.
2. Get all the sql statements that are being executed by a user.
3. Get all the blocking sessions
-- GET THE CURRENT SQL STATEMENT RUNNING FOR A 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;
 
 
--SQL STATEMENTS RUNNING BY A USER   
SELECT A.SID, A.SERIAL#, B.SQL_TEXT
  FROM V$SESSION A, V$SQLAREA B
 WHERE A.SQL_ADDRESS = B.ADDRESS AND A.USERNAME = 'APPS';
 
 
-- GET THE BLOCKING SESSIONS    
SELECT   BLOCKING_SESSION, SID, SERIAL#, WAIT_CLASS, SECONDS_IN_WAIT
    FROM V$SESSION
   WHERE BLOCKING_SESSION IS NOT NULL
ORDER BY BLOCKING_SESSION;