Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: CPU monthly consumption per user

Re: CPU monthly consumption per user

From: Jeremiah Wilton <jeremiah_at_wolfenet.com>
Date: 1997/12/16
Message-ID: <Pine.OSF.3.95.971216094116.7855B-100000@gonzo.wolfenet.com>#1/1

On Wed, 10 Dec 1997, Daniel Pinol wrote:
>
> I'd need ANY way to count how much CPU each of the users of my database
> has spent over a month. I've thought about 3 ways, but none is
> satisfying:
>
> -SQL TRACE: I could parse the generated files, but they are too big and
> represent too much overhead.
> -AUDIT: It cannot count CPU usage.
> -v$sesstat: Since the SIDs are reused, I cannot count the consumption
> by user.

How about this: Drop sys.aud$, create a table in the SYSTEM tablespace called AUD$, and create a synonym to it for the SYS user. That way, you have the auditing stuff writing to a normal table.

Audit sessions, and place a before insert trigger on the aud$ table, that senses if the audit line is a logout. If the audit is a logout, insert the username and v$sesstat CPU statistic for the session being audited into a separate historical table. This will record CPU used for each session. Later, you can tally up the total for each user by month.

--
Jeremiah Wilton      http://www.wolfenet.com/~jeremiah
Received on Tue Dec 16 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US