"Dummy" View consuming a lot of CPU
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...
1