Database Tuning (MOSC)

MOSC Banner

"Dummy" View consuming a lot of CPU

edited Mar 22, 2012 8:39PM in Database Tuning (MOSC) 7 commentsAnswered ✓
Hello all, 
I am facing a "strange" problem here : my application has a view that shows current locks held by other users : 

Here is the code of the view : 

CREATE VIEW "ORA_LOCKS" ("SID", "SERIAL", "TYPE",
  "USERNAME")
AS
  SELECT
    s.sid,
    serial# serial,
    s.type,
    username
  FROM
    sys.v_$session s,
    sys.v_$locked_object l
  WHERE
    s.sid = l.session_id;

I ran a ADDM report the other day on one of the databases, and I was very surprised that this view is consuming a lot of CPU time as all I'm doing is a SELECT * FROM ORA_LOCKS...

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center