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 > "Backup .. include logs" requires archived logs ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-20-09, 03:52
vilius vilius is offline
Registered User
 
Join Date: Nov 2007
Posts: 55
"Backup .. include logs" requires archived logs ?

Hello,

Yesterday I tried to make online backup using "include logs" option and got this:
Code:
SQL2428N  The BACKUP did not complete because one or more of the requested log files could not be retrieved.
Our systems archiving:
1. Userexit archives logs from log_dir to log_archive.
2. Cron job moves logs from log_archive elswhere.
(so log retrieval using userexit is not possible)

I always thought that "include logs" option adds active log files(at the moment backup is started) to backup image. Here is some log entries from db2diag.log (backup start time 20:31):
Code:
2009-05-19-20.00.51.651769+180 I6482618A360       LEVEL: Warning
PID     : 282694               TID  : 1           PROC : db2logmgr (DBP) 0
INSTANCE: db2dbp               NODE : 000
FUNCTION: DB2 UDB, data protection, sqlpgArchiveLogFile, probe:3170
MESSAGE : Completed archive for log file S0063621.LOG to USEREXIT from
          /db2/DBP/log_dir/NODE0000/.
----------------------------------------------------------------------------------------------------
2009-05-19-20.55.37.675820+180 E6493117A491       LEVEL: Error
PID     : 266446               TID  : 1           PROC : db2bm.598144.4 0
INSTANCE: db2dbp               NODE : 000         DB   : DBP
INSTANCE: db2dbp               NODE : 000
FUNCTION: DB2 UDB, data protection, sqlpgRetrieveLogFile, probe:4165
MESSAGE : ADM1847W  Failed retrieve for log file "S0063621.LOG" on chain "0"
          from "/db2/DBP/log_dir/NODE0000/".
----------------------------------------------------------------------------------------------------
2009-05-19-20.55.37.675820+180 E6493117A491       LEVEL: Error
PID     : 266446               TID  : 1           PROC : db2bm.598144.4 0
INSTANCE: db2dbp               NODE : 000         DB   : DBP
APPHDL  : 0-808                APPID: *LOCAL.db2dbp.090519173110
FUNCTION: DB2 UDB, database utilities, sqlubProcessLogExtent, probe:1917
MESSAGE : ADM8010E  Backup was unable to copy requested log file "S0063621.LOG"
          for inclusion in the backup image. The backup has been aborted.
So S0063621.LOG was archived 20:00, then 20:31 backup was started, then 20:55 db2 tried to retrieve S0063621.LOG(which do not exist - see above ) and failed.

Do db2 backup with "include logs" option realy needs logs which are archived even before backup is started ?
If yes why ?

thanks
Vilius
Reply With Quote
  #2 (permalink)  
Old 05-20-09, 04:30
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
when the backup is started, the log file name is retained
while running the backup log files can get closed and archived
at end of backup logs need to be included in image and log file has been archived; at that time we retrieve a log from archive location. if log file has been renamed in mean time by other procedure, the log file is not available anymore and backup will fail
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 05-20-09, 04:52
vilius vilius is offline
Registered User
 
Join Date: Nov 2007
Posts: 55
Hi,
Code:
while running the backup log files can get closed and archived
Yes I understand that - but my example shows that db2 tried to retrieve log file which was archived half an hour before backup started ?

V
Reply With Quote
  #4 (permalink)  
Old 05-20-09, 05:10
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Quote:
Originally Posted by vilius
Our systems archiving:
1. Userexit archives logs from log_dir to log_archive.
2. Cron job moves logs from log_archive elswhere.
(so log retrieval using userexit is not possible)
No delay in the cron procedure? You got guts!
My experions:
on v9.5 the "include logs" work fine, the database can be re-created on another server using the log-files which were included.
Recently we needed te re-create an old database (13 months ago) and that was still v8.2 We did not succeed to restore/rollforeward based upon the included logs. Extra restore of old logs was required.
So it seems that IBM did some work on that area and now (v9.5) it works as designed.
Hope this helps....
Reply With Quote
  #5 (permalink)  
Old 05-20-09, 07:12
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
yes because some luw has started long time ago and is still present
to find the complete luw we need the older log files and the current files, to have it all
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #6 (permalink)  
Old 05-20-09, 08:06
vilius vilius is offline
Registered User
 
Join Date: Nov 2007
Posts: 55
I've done one mistake I thought that log is archived when it is inactive, but:
Userexit archives logs as soon as they are full, even if they are still active. So S0063621.LOG probably was active at the time backup started. The only explanation is that it became inactive during backup time.
Quote:
yes because some luw has started long time ago and is still present
I don't agree with that - if log contains transaction entries which is not commited, even log is full - it should stay in log_dir.

V

Last edited by vilius; 05-20-09 at 08:10.
Reply With Quote
  #7 (permalink)  
Old 11-03-09, 10:14
JamesTJr JamesTJr is offline
Registered User
 
Join Date: Nov 2009
Location: Harrisburg, PA
Posts: 5
I'm using db2 9 on AIX and have the same problem. Is there a way to find the LSN the database is expecting to see what the oldest log file the backup will need to include? Or some other way to find all the log files a backup neededs to include before it starts?
Reply With Quote
  #8 (permalink)  
Old 11-03-09, 11:04
koganti koganti is offline
Registered User
 
Join Date: Jul 2002
Location: ATL
Posts: 170
Run the command Archive logs before the backup.
Logs will be truncated and then you may not need archived logs
Reply With Quote
  #9 (permalink)  
Old 11-03-09, 11:22
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Quote:
Originally Posted by JamesTJr View Post
I'm using db2 9 on AIX and have the same problem. Is there a way to find the LSN the database is expecting to see what the oldest log file the backup will need to include? Or some other way to find all the log files a backup neededs to include before it starts?

db2 will include all logs that were active (some of them may be already archived/reused and some not) from the time backup started and until it ended. You can get the "First active log file" from db cfg.

Last edited by db2girl; 11-03-09 at 11:27.
Reply With Quote
  #10 (permalink)  
Old 11-03-09, 11:29
JamesTJr JamesTJr is offline
Registered User
 
Join Date: Nov 2009
Location: Harrisburg, PA
Posts: 5
I have tried 'archive log' command before backup and still get the error. Also, the log file identified in the diaglog needed to be retrieved is the one before the 'first active log'.
Reply With Quote
  #11 (permalink)  
Old 11-03-09, 11:34
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Do you move the logs from the archived location somewhere else?
Reply With Quote
  #12 (permalink)  
Old 11-03-09, 11:40
koganti koganti is offline
Registered User
 
Join Date: Jul 2002
Location: ATL
Posts: 170
Looks like you are running into a bug. May want to open a PMR with IBM
Backup command should have the ability to grab any logs that is required when you use "InCLUDE LOGS" option
Reply With Quote
  #13 (permalink)  
Old 11-03-09, 11:45
JamesTJr JamesTJr is offline
Registered User
 
Join Date: Nov 2009
Location: Harrisburg, PA
Posts: 5
Db backup runs daily at 9.30pm for several hours. Daily at 5am sysadms backup archive log path and clean it out. Log backup is never running while db backup is. There are once in a blue moon times where the db has no update activity and the backup is looking for an archived log that was cleaned-out 16 1/2 hours earlier.
Reply With Quote
  #14 (permalink)  
Old 11-03-09, 13:18
db2dummy1 db2dummy1 is offline
Registered User
 
Join Date: Feb 2009
Posts: 114
Logs to be included in the backup include those active at the start of the oldest in-flight uncommitted transaction running at the start of backup
Reply With Quote
  #15 (permalink)  
Old 11-03-09, 14:20
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Quote:
Originally Posted by JamesTJr View Post
the log file identified in the diaglog needed to be retrieved is the one before the 'first active log'.
This doesn't sound the way DB2 should work - it should not look for any logs prior to the 'first active log'.


Try to disable the manual cleanup of archived logs for a few days and see if the problem reoccurs. If it does, then follow koganti's advice and open a pmr.
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