Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2008
    Posts
    29

    Unanswered: DB2 Logs and LRSN ?

    As any changes made to any DB2 objects, the changes are logged in datasets
    and all applications running simulteneously used the same log file.So from reading log in dataset how would DB2 came to know that this particular log is for this object abd for this row?
    I want through information about DB2 logs.Please help me regarding this.

    In data sharing concept call LRSN comes to picture.Is here nybody having idea on it?

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    A log record is written for any changes made to the database system (except for some operations like LOAD that are not logged fully). The log record contains information like:
    • which component in DB2 wrote the log record (e.g. data manager, index manager, LOB manager, ...)
    • which operation was performed
    • which database object was affected (OBID)
    • which tablespace and which page was affected
    • which exact changes were made, e.g. before/after images of inserted/deleted rows
    • in which transaction did the change occur (internal transaction ID)
      DB2 can simply read and interpret the log record and, thus, knows which operation was done. So it can redo the operation or undo it (by compensating it, for example running a delete to compensate an insert).


    In DB2 z/OS data sharing mode, DB2 does not use RBA (relative byte addresses) into the log file but LRSN (log record sequence number). The basic idea is the same: LRSNs are synchronized across data sharing members using the sysplex timer. That guarantees that all log records are written in the proper sequence.

    Logs are used for the following purposes:
    1. track changes for recovery and rollforward (hopefully you will never need it, but if you do need it, you won't do without logging)
    2. rollback transactions - if a transaction abends or is rolled back explicitly, all changes made so far in the transaction have to be undone. In order to figure out what has done, DB2 scans backwards through the logs to find all log records for the transaction. Then it analyzes each log record and compensates it.
    3. replication - data changes are written to the log and the Capture process of replication reads the logs asynchronously to find all changes made to the system and extract the changes for committed transactions so that those changes can be applied to another database system.


    This is just a very basic description of logging. If you have any specific questions, feel free to ask. I don't want to go into more details because this is a rather broad topic.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Dec 2008
    Posts
    29
    Hi,

    As I have no hands on experience in DB2 I am struggling with basics.
    I want to enforce on logging concepts and its various scenarios.
    If you are having any articles for that please post me it on denisvenis@gmail.com.

    Thanks-
    Denis.

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The basic concepts of logging are independent of DB2. DB2 realizes those concepts, of course, but what logging is good for and how it is typically implemented can be found in pretty much any serious database administration book or course material at universities.

    Regarding articles, I would first like to point you to the DB2 manuals: IBM DB2 9.5 Information Center for Linux, UNIX, and Windows If you have questions on what is written there, let's discuss.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Dec 2008
    Posts
    29
    Hi Stolze,

    The link you provided is contains whole DB2 information.
    I want specific material for DB2 logs, even i search on net i didnt get any satisfactory information.Rather from you i come to know some new things.
    Without clearing all doubts of DB2 logs i can not go on advanced concepts.
    If u are having some material onm logs please forword me on
    denisvenis@gmail.com


    Thanks-
    Denis.

  6. #6
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Have you considered using the "Search" option that is available on the site for which I provided the link? If you search for "log record", you will find a lot of information.

    Also, you say you want to know some new things - without saying what you are looking for. It's hard to give you good answers...
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  7. #7
    Join Date
    Dec 2008
    Posts
    29
    I think you didnt get me proprely.

    I said from you i come to know some new things.

Posting Permissions

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