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...
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.
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.