Solved

How to track down logins by username, machine, and schemaname in oracle 9i

Posted on 2007-03-23
3
297 Views
Last Modified: 2013-12-19
Experts,

disclamer: I am new to oracle support so be kind ;)
I need to find how often a specific user logs into the oracle 9i db and from where for a specific schema.

The only thing I have at this point is a sql query running every 5 minutes.
It looks like this:
select username, count(*) from gv\$session group by username order by 2 desc;
-- and --
select username, machine, count(*) from gv\$session group by username, machine order by username, 3 desc;

I have not been able to make the sql work with the schemaname table I receive an error:
sql: select schemaname, username, count(*) from gv$session group by username order by 2 desc;
"ORA-00979: not a GROUP BY expression" with schemaname highlighted
0
Comment
Question by:sugarfreeless
3 Comments
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 250 total points
ID: 18780873
but your simple error is in the group by you are missing the schemaname

select schemaname, username, count(*) from gv$session group by username order by 2 desc;
needs to be...
select schemaname, username, count(*) from gv$session group by schemaname,username order by 2 desc;
somebody in the oracle thread may be able to assist with the actual functioning of the query

0
 
LVL 3

Author Comment

by:sugarfreeless
ID: 18781120
Thanks!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question