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: locks

Re: locks

From: Jurij Modic <jurij.modic_at_mf.sigov.mail.si>
Date: Tue, 19 May 1998 13:52:01 GMT
Message-ID: <356187ff.25311220@www.sigov.si>


On Tue, 19 May 1998 13:19:53 GMT, jurij.modic_at_mf.sigov.mail.si (Jurij Modic) wrote:

>On 19 May 1998 07:11:42 GMT, elufker_at_swcp.com (Ed Lufker) wrote:
>>
>> ...[SNIP]...
>>
>Join your lock-identifying script with v$process on column
>v$process.pid and display column v$process.spid.
>
>For example, you can modify the utllockt.sql script like this:
>
>Original code:
>create table dba_locks_temp as select * from dba_locks;
>
>Modified code:
>CREATE TABLE dba_lock_temp AS
> SELECT dba_locks.*, v$process.spid FROM dba_locks l, v$process p
> WHERE l.session_id = p.spid;
>

Sorry about the previous message, when I hit the send button I knew I made a mistake.

You can get the OS PID from v$process, but you can't get oracle's session id from it. So you must join it to another v$ view, namely v$session. So the above modified code should be something like:

CREATE TABLE db_lock_temp AS
  SELECT dba_locks.*, p.spid
  FROM dba_locks l, v$process p, v$session s   WHERE l.session_id = s.sid
    AND s.paddr = p.addr;

Regards,


Jurij Modic                             Republic of Slovenia
jurij.modic_at_mf.sigov.mail.si		Ministry of Finance
============================================================
The above opinions are mine and do not represent any official standpoints of my employer Received on Tue May 19 1998 - 08:52:01 CDT

Original text of this message

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