473,692 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Restore online backup and roll forward just the logs stored in it.How?

aj
DB2 LUW v8.2 FP 14 RHAS 2.1

I have a DB2 online DB backup that was done w/ the INCLUDE LOGS
option. I am interested in restoring that backup, and rolling
forward ONLY the logs contained in the backup and no more, then
bringing the DB online.

I do not want to use a userexit to try and retrieve additional
logs - I only want to roll forward the logs in the backup. (In
case you haven't guessed, I am restoring a test version of my
prod DB).

I have some questions about the commands I would use to accomplish
this. Lets say my DB name and instance name are foo.

My DB backup file is FOO.0.foo.NODE0 000.CATN0000.20 070319020726.00 1

First, the restore:
db2 restore db foo taken at 20070319020726 logtarget /tmp

If I were to use the LOGS option after the DB name in the restore
command, ONLY the logs would be retrieved from the backup image and
placed in /tmp, and the DB restore would not take place. Correct?

By specifying LOGTARGET (and not using LOGS), this will cause the
DB image to be restored AND the logs in the image to be placed
in /tmp. Correct?

Now I'm interested in doing the roll-forward. I can't just
db2 rollforward db foo to end of logs and stop
because my userexit will come into play, and the rollforward is
not being informed about the logs in /tmp. I need a PIT.

I need the minimum PIT for the roll-forward. So, I can do this:
db2 rollforward db foo stop
SQL1276N Database "FOO" cannot be brought out of rollforward pending
state until roll-forward has passed a point in time greater than or
equal to "2007-03-19-06.30.35.000000 ", because node "0" contains
information later than the specified time.

Is there another way to establish the minimum PIT? I'm trying to
automate the process of restoring and rolling forward. IBM is
assuming that eyes and fingers are issuing these commands.

So, armed w/ my PIT, I do this:
db2 "rollforwar d db foo to 2007-03-19-06.30.35.000000 overflow log path
/tmp)"

What is the purpose of overflow log path? Is it to indicate where logs
should be written when/if they are retrieved? OR is it to indicate
where to look for logs that are needed for the roll forward?

After I try this, DB2 complains about being unable to retrieve a log
that is outside the range of those stored w/ my online backup, and I
scratch my head for a few more minutes.....

Would using RECOVER DATABASE be a better idea for what I am trying to do?

Any help appreciated.

thanks
aj
Mar 20 '07 #1
4 20483
aj wrote:
[...]
>
So, armed w/ my PIT, I do this:
db2 "rollforwar d db foo to 2007-03-19-06.30.35.000000 overflow log path
/tmp)"
I think it should be:

rollforward db foo to end of logs and stop overflow log path ( /tmp )

[...]
/Lennart
Mar 21 '07 #2
aj
OK - I'll give it a try.

The RESTORE command puts logs S0016355.LOG and S0016356.LOG in /tmp.
So apparently 16355 and 16356 are stored in the backup image.

db2 rollforward db foo to end of logs and stop overflow log path (/tmp)
SQL1268N Roll-forward recovery stopped due to error "1" while
retrieving log file "S0016357.L OG" for database "FOO" on node "0".

And the DB is still in rollforward pending mode...

WHY is it going after 16357?

Any other ideas?

thanks
aj

Lennart wrote:
aj wrote:
[...]
>>
So, armed w/ my PIT, I do this:
db2 "rollforwar d db foo to 2007-03-19-06.30.35.000000 overflow log path
/tmp)"

I think it should be:

rollforward db foo to end of logs and stop overflow log path ( /tmp )

[...]
/Lennart
Mar 21 '07 #3
aj
Maybe this will help the next guy. This pretty much explains it:
http://www-1.ibm.com/support/docview...id=swg21209404

They key is to specify the NORETRIEVE option of the ROLLFORWARD
DATABASE command. This will prevent DB2 UDB from trying to
obtain potentially missing transaction logs elsewhere.

aj

aj wrote:
OK - I'll give it a try.

The RESTORE command puts logs S0016355.LOG and S0016356.LOG in /tmp.
So apparently 16355 and 16356 are stored in the backup image.

db2 rollforward db foo to end of logs and stop overflow log path (/tmp)
SQL1268N Roll-forward recovery stopped due to error "1" while
retrieving log file "S0016357.L OG" for database "FOO" on node "0".

And the DB is still in rollforward pending mode...

WHY is it going after 16357?

Any other ideas?

thanks
aj

Lennart wrote:
>aj wrote:
[...]
>>>
So, armed w/ my PIT, I do this:
db2 "rollforwar d db foo to 2007-03-19-06.30.35.000000 overflow log path
/tmp)"

I think it should be:

rollforward db foo to end of logs and stop overflow log path ( /tmp )

[...]
/Lennart
Mar 21 '07 #4
I'm doing this every night (script and a reidrected restore)
restore db xxxx from yyyyy taken at zzzzzz to path into newdb
logtarget aaaa newlogpath aaaa REDIRECT WITHOUT PROMPTING;
set tablespace containers hhhh;
restore db bbbb continue;
rollforward db cccc to end of logs and stop overflow log path (/tmp);
so..I wonder why it doesn't work for you ? I'm running db2 udb v8 with
fixpak 10
/roger
Mar 22 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1935
by: Andre | last post by:
Hi, I have a database (or better: used to have) and backup consisting of - the initial (complete) database - all log files since then (or so I thought) After making a data entry error I wrote the log to the backup and tried a point of time restore. Unfortunately that failed with the message "The log in this backup set begins at LSN xxx, which is too late to apply to
1
3352
by: Grisha Golberg | last post by:
Hi all, I am trying to move a database from one machine to another. I backed up in offline mode, then I do a restore (without rolling forward), which finishes successfully but with warning 2529 (what's that?) After that db2syscs hogs pretty much all available memory on the machine whenever I attempt to connect to the database, with no end in sight.
1
3479
by: Jimmy Chen | last post by:
Recently I've done a db2 backup and restore/recovery, but the process for recovering the database was different than what I thought to be. here is what I did: DB2 is set in online mode - backup - * backup db2 in full * insert record
5
5432
by: Anurag | last post by:
Hello, I wish to find out the restore method for database that have been incrementally backed up and in the scenario where just the delta has been backed up. For example sake, let us assume the following 2 scenarios: (1) Delta Backup of database "delta_db" Full offline backup of database "delta_db" is taken on Dec 15 and then offline delta backup is taken every day till Dec 19. If "delta_db" crashes on Dec 20, what steps do I follow...
13
7287
by: Andy K | last post by:
Hi , I'm wondering what's going on with a restore I'm trying to do . My DB2 version is a 7.2 on a Linux RH ES 2.1 . I've copy a recent backup that was on NAS for a test on my machine . I then restore the backup without creating a database with the simple command line "db2 restore backup DBNAME".
6
11547
by: paul | last post by:
Hi, i made an attempt to restore a online backup made with include logs option. But when i rollforward the db, i can't pout it online because it always ned log file. I tried the option to rollforward to end of logs and to point in time. In the doc, it is said taht with 'include logs', i can restore without any log file. Someone know how can i stop the rollforward pending status ? regards
6
3671
by: Raj | last post by:
How can we do an online restore of a tablespace using the incremental backup's? we are on a partitioned database... Also, how could we use backup copy made by the load (using the copy to option in load) to revover the tablespace? Thanks, Raj
3
2509
by: Konstantin Andreev | last post by:
Hello, everybody. I've spent a lot of time reading "DB2 Information Center" and Raul Chong's book "Understanding DB2. Learning Visually with Examples", but still unable to answer this simple question. I need to perform the full database backup for at least these two goals: - to restore data onto developers' database system. - to ensure disaster recovery
3
22999
by: Bill E. | last post by:
I'm trying to restore a database backed up a production machine onto my development machine. I don't want to restore the transaction logs (there are two) because they are far too large and are unnecessary for what I'm doing. I would be happy to simply create one new log in my development environment. Therefore, I backed up the database using the No_Log option as in backup database CPTS to disk = 'd:\backups\cpts_backup_billeh.bak'...
0
8538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9083
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8961
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8800
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8801
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4324
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4557
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1957
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.