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

Home -> Community -> Usenet -> c.d.o.tools -> Re: v$lock

Re: v$lock

From: Mark D Powell <mark.powell_at_eds.com>
Date: 27 Jun 2001 13:00:21 -0700
Message-ID: <178d2795.0106271200.53bf19af@posting.google.com>

"Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote in message news:<993633506.12696.0.nnrp-13.9e984b29_at_news.demon.co.uk>...
> It's not normal -
> have a look at v$session_wait for the calling
> session when the query hangs.
>
> the 15 or so locks for SID = 2 are the Media Recovery
> locks - one per file.
>
> I would consider enhancing your strategy by only
> considering blocking transactions (V$LOCK.BLOCK=1),
> and then only if their CTIME was more than a few seconds
> and the thing they were block had also recorded a few
> seconds.
>
> I would also be a little cautious about killing blocking
> sessions if this would result in a large rollback - see
> v$transaction.used_urec
>
>
> --
> Jonathan Lewis
>
 

> Michael B. Allen wrote in message ...
> >If I do:
> >
> >select v$session.sid, v$session.username
> > from v$session, v$lock
> > where v$session.sid = v$lock.sid;
> >
> >the query returns about 15 entries with sid == 2 but then just hangs. Is
> >this normal?
> >
> >I want to write two cgi scripts; one that produces a list of sessions
> >holding locked records with username, machine, program, etc with a link
> >to the second cgi script which will kill the session with alter system
> >kill ...
> >
> >What's the best way to do this?
> >
> >Thanks,
> >Mike

Mike, I am asking this just to be sure as your post did not mention other code that determines that the sessions you intend to kill are in fact either blocking other sessions or are runaways. You do not need to reply if you, as is likely, have covered this.

Received on Wed Jun 27 2001 - 15:00:21 CDT

Original text of this message

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