count the actual number of users

In this forum Oracle Applications DBA's, System Administrators & Developers can share their knowledge/issues.
Post Reply
mckoy2404
Posts: 24
Joined: Mon Mar 19, 2007 1:19 am
Location: Cayman Islands

count the actual number of users

Post by mckoy2404 »

Is there any way to count the actual number of users current logged in to the applications?
ahmadbilal
Posts: 615
Joined: Mon Sep 18, 2006 1:32 am
Location: United Arab Emirates
Contact:

Post by ahmadbilal »

if you are talking about database then run below query u will get result

SELECT s.osuser, p.spid
|| ' '
|| DECODE (s.machine,
NULL, 'Lan:',
s.machine || ':'
)
|| s.osuser
|| '<'
|| DECODE (s.terminal, NULL, 'Batch/Det', s.terminal)
|| '>'
|| DECODE (s.username, s.osuser, NULL, s.username) IDEN,
DECODE (s.command,
1, 'CRE TAB',
2, 'INSERT',
3, 'SELECT',
4, 'CRE CLUSTER',
5, 'ALT CLUSTER',
6, 'UPDATE',
7, 'DELETE',
8, 'DRP CLUSTER',
9, 'CRE INDEX',
10, 'DROP INDEX',
11, 'ALT INDEX',
12, 'DROP TABLE',
13, 'CRE SEQ',
14, 'ALT SEQ',
15, 'ALT TABLE',
16, 'DROP SEQ',
17, 'GRANT',
18, 'REVOKE',
19, 'CRE SYN',
20, 'DROP SYN',
21, 'CRE VIEW',
22, 'DROP VIEW',
23, 'VAL INDEX',
24, 'CRE PROC',
25, 'ALT PROC',
26, 'LOCK TABLE',
28, 'RENAME',
29, 'COMMENT',
30, 'AUDIT',
31, 'NOAUDIT',
32, 'CRE DBLINK',
33, 'DROP DBLINK',
34, 'CRE DB',
35, 'ALTER DB',
36, 'CRE RBS',
37, 'ALT RBS',
38, 'DROP RBS',
39, 'CRE TBLSPC',
40, 'ALT TBLSPC',
41, 'DROP TBLSPC',
42, 'ALT SESSION',
43, 'ALT USER',
44, 'COMMIT',
45, 'ROLLBACK',
46, 'SAVEPOINT',
47, 'PL/SQL EXEC',
48, 'SET XACTN',
49, 'SWITCH LOG',
50, 'EXPLAIN',
51, 'CRE USER',
52, 'CRE ROLE',
53, 'DROP USER',
54, 'DROP ROLE',
55, 'SET ROLE',
56, 'CRE SCHEMA',
57, 'CRE CTLFILE',
58, 'ALTER TRACING',
59, 'CRE TRIGGER',
60, 'ALT TRIGGER',
61, 'DRP TRIGGER',
62, 'ANALYZE TAB',
63, 'ANALYZE IX',
64, 'ANALYZE CLUS',
65, 'CRE PROFILE',
66, 'DRP PROFILE',
67, 'ALT PROFILE',
68, 'DRP PROC',
69, 'DRP PROC',
70, 'ALT RESOURCE',
71, 'CRE SNPLOG',
72, 'ALT SNPLOG',
73, 'DROP SNPLOG',
74, 'CREATE SNAP',
75, 'ALT SNAP',
76, 'DROP SNAP',
79, 'ALTER ROLE',
79, 'ALTER ROLE',
85, 'TRUNC TAB',
86, 'TRUNC CLUST',
88, 'ALT VIEW',
91, 'CRE FUNC',
92, 'ALT FUNC',
93, 'DROP FUNC',
94, 'CRE PKG',
95, 'ALT PKG',
96, 'DROP PKG',
97, 'CRE PKG BODY',
98, 'ALT PKG BODY',
99, 'DRP PKG BODY',
TO_CHAR (s.command)
) command,
SUBSTR (s.program,
INSTR (s.program, ']', -1) + 1,
DECODE ( INSTR (s.program, '.', -1)
- INSTR (s.program, ']', -1)
- 1,
-1, 99,
INSTR (s.program, '.', -1)
- INSTR (s.program, ']', -1)
- 1
)
) program
FROM v$session s, v$process p
WHERE s.TYPE <> 'BACKGROUND' AND s.paddr = p.addr ORDER BY s.osuser
/



as far as application concern
application use application user name not database schema name so the session open between apps and db tier is by database username u cant get currently connected user from application to DB.
ahmadbilal
Posts: 615
Joined: Mon Sep 18, 2006 1:32 am
Location: United Arab Emirates
Contact:

Post by ahmadbilal »

For Better Understanding "What happens when you login to Apps"

read this blog by Anil Passi Specialy

<b>Some notes on advanced info (beginners may ignore this):</b>

http://getappstraining.blogspot.com/200 ... -apps.html
admin
Posts: 2096
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Post by admin »

SELECT COUNT (*)
FROM v$session
WHERE schemaname = 'APPS' AND osuser = 'oracle'
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests