View previous topic :: View next topic
|
Author |
Message |
Gurmeet
New User
Joined: 22 Feb 2006 Posts: 46 Location: Pune
|
|
|
|
Can any one please explain more about RBAs in DB2?
I am using Recover utility with TORBA clause to rollback some unrequired changes on the database but not very clear with RBAs.
~Gurmeet |
|
Back to top |
|
|
ragshere
New User
Joined: 20 Dec 2004 Posts: 70
|
|
|
|
Gurmeet,
RBA stands for Relative byte address . It signifies a position in the DB2 LOG.
Generally RBA will be mapped to a timestamp. I mean RBA is nothing but a timestamp. so that If we want to recover to a time which is in the past, we need to use the RBA of that time for recovery.
RBA is a hexa decimal number and DB2 will create it based on some timestamp. If we Quiesce on a tablespace, DB2 will put a enry in SYSCOPY with the RBA and a entry in DB2 directory. so that they will be used as recovery points if needed.
RBA is called as LRSN in data sharing environment. But concept of LRSN and RBA are same.
If we want to recover to a RBA (I mean TORBA) , DB2 will bring the latest full image copy of the object you are recovering which is nearer to that RBA and then applies the changes of the object saved in log until that RBA reaches. Here changes means SQL operations like UPDATE,INSERT ,DELETE etc...
Hope you got me...
Regards,
Rags |
|
Back to top |
|
|
Gurmeet
New User
Joined: 22 Feb 2006 Posts: 46 Location: Pune
|
|
|
|
Thanks Rags,
Yeah, things are clear now.
Just one more query, I have taken a image copy and am using the RBA of the image copy(from SYSIBM.SYSCOPY) in TORBA clause of the recover statement, this means that the DB will be recovered till a point when image copy was taken.
Now my question is how do we get the RBA of some time other than the image copy time. Say I have taken a image copy at 1500 hrs and at 1700 hrs i decide to rollback to a point in time (say 1600 hrs) using recover utility. Where shall i find the RBA corresponding to 1600 hrs.
Thanks for your help.
Regards,
~Gurmeet |
|
Back to top |
|
|
ragshere
New User
Joined: 20 Dec 2004 Posts: 70
|
|
|
|
Gurmeet,
here is the answers for your queries..
1. when we use TORBA clause in RECOVER utility, that means bring the tablespace to the state how it was at that RBA.
DB2 will use image copies which were created prior to that RBA . That means it will fetch the latest image copy as of RBA time and uses it for recovery.
There are scenarios where some changes happened after taking image copy and before Quiesce (which will create a RBA in log and SYSCOPY) .
In this case DB2 recover utility will apply the changes happened on the table by looking at the log. At last we will get the data as of that RBA.
We have to use RBA which is in SYSCOPY. to save a RBA , we use Quiesce.
2 . As i said, we need to use QUIESCE utility to put a RBA entry in the catalog and directory. But actually Quiesce will insert a consistent recovery point in the catalog.
so you recover to that recovery point if needed. But here is a condition.
You should have at least one full image copy before the RBA.Then only we can recover.
Its best practice to Quiesce or take a image copy before doing a load.
If the image copy available,quiesced the tablespace at 15:00 hrs and you want to recover the tablespace to 16:00 state, you have to do a litle research. and this is not recommendable.
You need to search SYSCOPY for the RBA (Type=Q) rows which were created at 16:00 hrs or a little earlier for any tablespace in the subsystem.
Take the RBA of that entry ,use it in TORBA clause for recovering your tablespace.
Regards
Rags |
|
Back to top |
|
|
Gurmeet
New User
Joined: 22 Feb 2006 Posts: 46 Location: Pune
|
|
|
|
Rags,
Thanks a lot.
Regards,
~Gurmeet |
|
Back to top |
|
|
|