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 > Using Log files for database Restore

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-01-08, 07:14
faisalb faisalb is offline
Registered User
 
Join Date: Mar 2008
Posts: 7
Using Log files for database Restore

Hi Everybody,

I am working in a bank that has independent databases at 80+ branches.
Every location takes an offline backup every day.

At last date of every month, the branches dispatch me the months last day backup.

I restore the databases (Version recovery) from the recieved backups and consolidate a few tables from each locations restored db in a central database using Import/Export for reporting purposes.

My problem is that I have to unzip backup images of 80 branches and have to change the timestamps in batch files, that is too boring.

My question is that if I switch to ARCHIVAL LOGGING at all the locations, would it be possible that I just use logs for updating changes to restored database at the consolidation server.

That is I just restore the databases once on the consolidation server (version recovery) and after that just collect the log files, place them in the restored databases logs directory and restore to End of Logs.


Pleas help me in this regard as its becoming very difficult for me to restore all the databases and month end.
Reply With Quote
  #2 (permalink)  
Old 04-01-08, 09:10
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by faisalb

My question is that if I switch to ARCHIVAL LOGGING at all the locations, would it be possible that I just use logs for updating changes to restored database at the consolidation server.

That is I just restore the databases once on the consolidation server (version recovery) and after that just collect the log files, place them in the restored databases logs directory and restore to End of Logs.

Yes, but you can do it only once. After you have recovered a database by rolling it forward, you cannot do it again until you do a new RESTORE.
Reply With Quote
  #3 (permalink)  
Old 04-01-08, 09:18
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
or leave the db in rollforward state for next run - but db is not accessible when in rollforward state
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #4 (permalink)  
Old 04-02-08, 00:50
faisalb faisalb is offline
Registered User
 
Join Date: Mar 2008
Posts: 7
Quote:
Originally Posted by n_i
Yes, but you can do it only once. After you have recovered a database by rolling it forward, you cannot do it again until you do a new RESTORE.

That means that I have to do a version recovery every month end by using the recieved timestamps,
and the advantage of archival logging is just point in time recovery.

The issue is that every month, I have to restore a lot of db2 databases on my head office consolidation server. I use the month end backup timestamps for that by unzipping the timestamps and making changes to batch files.

Isn't there any better solution instead of the method I am using.




Thnaks
Reply With Quote
  #5 (permalink)  
Old 04-02-08, 00:58
faisalb faisalb is offline
Registered User
 
Join Date: Mar 2008
Posts: 7
Quote:
Originally Posted by guyprzytula
or leave the db in rollforward state for next run - but db is not accessible when in rollforward state

I have to use the databases for month end consolidation (there is a program that exports latest data from some tables and then loads them in to a central database that I use for reporting).

How can I leave it in rollforward state
Reply With Quote
  #6 (permalink)  
Old 04-02-08, 05:06
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
If you can identify the "latest data" in the tables, you can use a simple EXPORT at the sources and then LOAD at the server.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #7 (permalink)  
Old 04-02-08, 05:30
faisalb faisalb is offline
Registered User
 
Join Date: Mar 2008
Posts: 7
Quote:
Originally Posted by stolze
If you can identify the "latest data" in the tables, you can use a simple EXPORT at the sources and then LOAD at the server.


Yes I can identify the transactions date in some tables but in a number of tables same rows are update, like for customer balances table there is only one row for each customer and new balance is updated in the same row.
Reply With Quote
  #8 (permalink)  
Old 04-02-08, 05:55
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
For those update scenarios, you could add a "last updated" column to your table. DB2 LUW V9.5 has a clause "FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP" for this.

Another idea would be to use the Capture part of Replication and just extract the data changes and apply them at your target system. In fact, maybe you can even use a regular replication setup...
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #9 (permalink)  
Old 04-02-08, 06:19
faisalb faisalb is offline
Registered User
 
Join Date: Mar 2008
Posts: 7
Adding a "last update" columns would be a major change to the databases structure for which I dont want to go and we are using version 8.2
I will look in to this
clause "FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP".

Our future plan is to go for db2 replication as each server will be allotted a Live IP address and we will switch to online replication using capture and apply.

Meanwhile I will do what I am doing, or I will ask the branches to send the export files of tables and make a program at the consolidation server or a batch file that will use the export files and load data in to central db.

Thanks a lot stolze for your time and help.

Any ones else comments are appreciated
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