Solved

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

Posted on 2007-03-23
3
300 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

680 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