Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2003
    Posts
    23

    Angry Unanswered: IDS 9.3 Row lock ... Find and kill process

    I'm using IDs 9.3 on AIX 5.2.

    Has ayone a script that will return the process ID of the user who has a row locked or table locked.

  2. #2
    Join Date
    Aug 2003
    Location
    Allentown pa
    Posts
    41

    Re: IDS 9.3 Row lock ... Find and kill process

    Originally posted by kelvinpuk
    I'm using IDs 9.3 on AIX 5.2.

    Has ayone a script that will return the process ID of the user who has a row locked or table locked.
    nstat -u | awk '{print "onstat -g ses "$3}' > ses.out

    view ses.out and revove the following lines
    nstat -g ses
    onstat -g ses Dynamic
    onstat -g ses
    onstat -g ses
    onstat -g ses sessid

    Just keep the onstat with the session numbers

    Run ses.out > who.out

    view who.out and do a find for the table that the row is locked. To unlock onmode -z session id
    Jeff Wain

  3. #3
    Join Date
    Aug 2003
    Location
    Allentown pa
    Posts
    41
    Sorry thats onstat -u | awk '{print "onstat -g ses "$3}' > ses.out
    Jeff Wain

  4. #4
    Join Date
    Aug 2003
    Posts
    68
    database sysmaster;
    select dbsname, b.tabname, rowidr, keynum, e.txt type, d.sid owner,
    g.username ownername, f.sid waiter, h.username waitname
    from syslcktab a, systabnames b, systxptab c, sysrstcb d, sysscblst g,
    flags_text e, outer (sysrstcb f , sysscblst h)
    where a.partnum = b.partnum
    and a.owner = c.address
    and c.owner = d.address
    and a.wtlist = f.address
    and d.sid = g.sid
    and e.tabname = 'syslcktab'
    and e.flags = a.type
    and f.sid = h.sid
    into temp tmplocks with no log;

    select dbsname,
    tabname,
    rowidr,
    type[1,4],
    owner,
    ownername
    from tmplocks
    order by dbsname, tabname, owner;
    drop table tmplocks;

  5. #5
    Join Date
    Nov 2003
    Location
    Mumbai, India
    Posts
    92
    Hi,

    select unique
    dbsname db,
    tabname table,
    case
    when type="S" then "shared lock"
    when type="IS" then "intent shared lock"
    when type="SIX" then "shared intent excl lock"
    when type="XS" then "shared key value by RR"
    when type="IX" then "intent excl lock"
    when type="X" then "exclusive lock"
    when type="XR" then "excl key value by RR"
    when type="U" then "update lock"
    when type="B" then "byte lock"
    else
    "unknown lock type"
    end lock_type,
    lpad(owner,5) ses_id,
    lpad(waiter,5) wait_id
    from sysmaster:syslocks
    where tabname != 'sysdatabases';

    Regards,
    Shriyan

  6. #6
    Join Date
    Aug 2003
    Location
    Allentown pa
    Posts
    41

    Re: IDS 9.3 Row lock ... Find and kill process

    Redirect the output of this to a file and then do a find on the table that you think is locked. Note the session ID then perform onmode -z session ID Our dam developers lock tables here all the Time. Make sure that the code does dirty reads.

    dbaccess sysmaster <<!
    select * from sysprofile;
    select * from syslocks;
    !


    Originally posted by kelvinpuk
    I'm using IDs 9.3 on AIX 5.2.

    Has ayone a script that will return the process ID of the user who has a row locked or table locked.
    Jeff Wain

  7. #7
    Join Date
    Aug 2003
    Location
    Allentown pa
    Posts
    41

    Re: IDS 9.3 Row lock ... Find and kill process

    Redirect the output of this to a file and then do a find on the table that you think is locked. Note the session ID then perform onmode -z session ID Our dam developers lock tables here all the Time. Make sure that the code does dirty reads.

    dbaccess sysmaster <<!
    select * from sysprofile;
    select * from syslocks;
    !


    Originally posted by kelvinpuk
    I'm using IDs 9.3 on AIX 5.2.

    Has ayone a script that will return the process ID of the user who has a row locked or table locked.
    Jeff Wain

  8. #8
    Join Date
    Aug 2003
    Location
    Allentown pa
    Posts
    41
    dbaccess sysmaster <<!
    select * from sysprofile;
    select * from syslocks;
    !

    Returns all table that have row or table locks. Displays the user with the lock run onmode -z session number to kill the process
    Jeff Wain

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •