Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1

    Unanswered: lock level in tables

    Hi Colleagues,

    Somebody can tell me how to view the lock level in tables. por example page or row. what in the command to display this information and how to define this lock level in table.


    Thank you for you help.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    The default behavior is to do row level locking. If too many row locks are held DB2 will escalate the locks to a table level lock. The only control you have is to issue "LOCK TABLE" statement--see the manual. Use the snapshot monitor to view the locks currently being held.

    Andy

  3. #3
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Hi ARWinner, thank you for you quick answer. I am DBA Informix and some activities DB2. at informix when create a table exist the statement lock mode (page or row) then you can modify this lock level if you it prefers. also you can view the lock level for any table in specific.

    Greetings.

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Well this is not Informix. This is DB2. It works the way I stated.

    Andy

  5. #5
    Join Date
    May 2010
    Location
    India
    Posts
    84
    Provided Answers: 2
    Hi,

    You can use locksize column in syscat.tables to view current lock size for the table.


    To change lock size use alter table command

    example:
    alter table <table name> locksize TABLE
    alter table <table name> locksize Row


    Satya

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by stiruvee View Post
    Hi,

    You can use locksize column in syscat.tables to view current lock size for the table.


    To change lock size use alter table command

    example:
    alter table <table name> locksize TABLE
    alter table <table name> locksize Row


    Satya
    Well, I learned something new today.

    Andy

  7. #7
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Hi All,

    In my database there are a table lock in lock mode Z, ¿Anybody can tell me an procedure for detect what process or application is locking this table in DB2?

    The version DB2 is the 9.5 and the system operation is Linux Suse 11.

    thank you for you help.

  8. #8
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Sure

    Code:
    select a.* 
    from sysibmadm.snaplock as l 
    inner join sysibm.snapappl_info as a on (l.agent_id = a.agent_id) 
    where l.tabschema = MyTableSchema and l.tabname = MyTableName and 
    l.lock_mode = 'Z'
    Andy
    Last edited by ARWinner; 05-20-10 at 11:21.

  9. #9
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Thank you for you quick answer, ¿in db2 exist an sequence of command for monitoring lock en tables? and any method for look the statement is executing in database?, what applications is generating the locks and what user?

    Greetings.

  10. #10
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You can use the snapshot monitor or the administrative views (AS I gave you an inkling already). Look in the manual for more information.

    Andy

Posting Permissions

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