If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 Logs and LRSN ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-17-09, 02:20
denisvenis denisvenis is offline
Registered User
 
Join Date: Dec 2008
Posts: 29
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?
Reply With Quote
  #2 (permalink)  
Old 01-17-09, 06:13
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #3 (permalink)  
Old 01-18-09, 23:33
denisvenis denisvenis is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 01-19-09, 03:53
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #5 (permalink)  
Old 01-20-09, 03:06
denisvenis denisvenis is offline
Registered User
 
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.
Reply With Quote
  #6 (permalink)  
Old 01-20-09, 07:00
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #7 (permalink)  
Old 01-22-09, 08:44
denisvenis denisvenis is offline
Registered User
 
Join Date: Dec 2008
Posts: 29
I think you didnt get me proprely.

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On