Re: Blocking sessions related to client process

From: Igor Racic <igor.racic_at_gmail.com>
Date: Thu, 30 Sep 2010 18:53:16 +0200
Message-ID: <AANLkTikU68+nKU5kJH3PpNPiwwxqR89YVjxNFrjV2ssf_at_mail.gmail.com>



Hi,

Java developer can provide value in code (if code change is an option) using Java Properties when creating JDBC connection:

         prop.put("v$session.process", clientProcess);
         prop.put("v$session.program", programName);

There is note 147413.1 on Metalink.

Regards,
Igor

> 2010/9/29 Niall Litchfield <niall.litchfield_at_gmail.com>
>
> Didn't know about that Magic Number - thanks Tanel. I believe that
>> client_info can be set using JDBC thin though right so maybe the application
>> developers could help out if they are available. I can't imagine this would
>> be the only time knowing who is doing what is helpful - not sure how that
>> works with connection pools either..
>>
>> On Wed, Sep 29, 2010 at 2:07 PM, Tanel Poder <tanel_at_poderc.com> wrote:
>>
>>> JDBC Thin drivers always set the client process to 1234 as thin drivers,
>>> being fully contained within JVM, don't have a way to find out the PID of
>>> the JVM process itself. Someone JDBC developer in the java world figured
>>> that a good number for specifying "unknown" value is 1234, instead of 0 or
>>> -1.
>>>
>>> In such case you can identify the SPID of the database process, run lsof
>>> (or pfiles if on solaris) on the process to see to which IP/port combo it's
>>> talking to. Then log on to that IP and run lsof there to see which process
>>> uses that peer port... this won't work well with connection pools though...
>>>
>>>
>>> --
>>> Tanel Poder
>>> http://tech.e2sn.com
>>> http://blog.tanelpoder.com
>>>
>>>
>>>
>>>
>>> On Wed, Sep 29, 2010 at 3:06 PM, <Joel.Patterson_at_crowley.com> wrote:
>>>
>>>> Any help would be appreciated.
>>>>
>>>> I respect and appreciate every ones time. If this is considered to
>>>> basic a question, then perhaps pointing me to the right place would be
>>>> helpful because I can’t find the right docs or get to the bottom of
>>>> this. It should be more of a clarification as I have been doing this a
>>>> long time, so I figure I’m missing something.
>>>>
>>>> The person asking me was using EM, and saw 4 blocking locks, (in the
>>>> blocking sessions section), and in the client section he sees OS
>>>> process 1234 but cannot grep for this process on the client machine.
>>>> He wants to go from the blocking sessions in the database (jaxlawdw), and
>>>> link to the corresponding process on the client machine.
>>>>
>>>> The person says that it is always client process 1234 as indicated in
>>>> enterprise manager ‘blocking sessions’ , ‘session details’, ‘Client’, ‘OS
>>>> Process ID’. The person believes it is a ‘fake’ or phantom process.
>>>>
>>>> How do I help, as I may not be giving the correct explanation, else we
>>>> should see the process on the client machine?
>>>>
>>>> Example of first row when combining v$session and v$process, shows s.sid
>>>> 486, p.pid 47, p.spid 8105, and s.process 1234.
>>>>
>>>> Note when querying these two tables for s.process 1234 it returned 58
>>>> rows, (but this was done then next day and not live when the blocking
>>>> sessions where happening).
>>>>
>>>> Session Process p.pid p.spid Session
>>>>
>>>> SID Serial# Serial# Ora ProcID OS ProcID Process Session
>>>> Username OS Username STATUS MACHINE Process Program
>>>>
>>>> ------ ------- ------- ---------- ------------ ------------
>>>> -------------------- ------------ -------- --------- ----------------------
>>>>
>>>> 486 36738 136 47 8105 1234
>>>> GENTRAN b2badmin INACTIVE jaxb2bprd oracleGISPROD_at_jaxlawdw
>>>>
>>>> Joel Patterson
>>>> Database Administrator
>>>> 904 727-2546
>>>>
>>>>
>>>
>>
>>
>> --
>> Niall Litchfield
>> Oracle DBA
>> http://www.orawin.info
>>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Sep 30 2010 - 11:53:16 CDT

Original text of this message