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 > Turn On Logs Archieving

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-30-10, 12:40
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Turn On Logs Archieving

Hello,

On one of DB2 V9.5.5 on Win2k3 systems I need to turn log archieve on.
That will be used to replicate logs to DRP server.

I understand that I need to update db cfg for the database with DISK:H:\archieves value.

Anything else needed to be taken care of. This is our production server and I am doing this first time.

Please advise, I have tested on spare server where it seems to have turned on, but could not see a log archieved, may be because of no activity.

Regards

DBFinder
Reply With Quote
  #2 (permalink)  
Old 03-30-10, 13:17
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Yes, you need activity for a log to be archived. How much depends on the size of the log files.

After you set LOGARCHMETH1, you will need to bounce the database. You may have to do an offline backup also.

ANdy
Reply With Quote
  #3 (permalink)  
Old 03-30-10, 13:40
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Alright, I agree.

Well, may be it will ask for Restart and/or OFFLINE backup, but with my test system it did not require any restart or offline.

Could this be beacuse it is not heavily used (test system). I was expecting need to restart DB2. But change was adapted without a requirement !

Any body may have a condradicting experience ??

Thanks Winner,

Regards
Reply With Quote
  #4 (permalink)  
Old 03-30-10, 14:06
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Winner,

I might be missing some other setting. The test database where I have set up archieving does not seem to be acrcieving.

Regards
Reply With Quote
  #5 (permalink)  
Old 03-30-10, 14:24
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
  1. Connect to the database.
  2. do: "db2 get db cfg show details". Look to see whether it has taken affect or is still pending.

You will need to take a backup before you can have full use of the database. The change to logarchmeth1 takes place when the database is deactivated (no connections to the database), and then do a backup after that.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 03-30-10, 16:14
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Yes,
I had checked, the value had changed. So I assume that we do not need to take offline backup. Because I need to plan this for production, I must confirm this. On test database, I have restarted db2, still archieving did not show started.

Still surprised

regards
Reply With Quote
  #7 (permalink)  
Old 03-30-10, 16:20
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
What do you mean that "archiving did not show started"?

When you turn on archiving, DB2 needs a reference point to begin the rollforward capabilities for the DB. It needs an offline backup for this.

Since turning it on, have you tried doing anything to the DB? It should be in a backup pending state.


Andy
Reply With Quote
  #8 (permalink)  
Old 03-30-10, 16:38
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Not Really,

I tested, even took offline backup. Did not work.

Then I used Logging wizard. This turned logging on effectively, without having to anything, restart or backup.

I compared the CFGs , the only difference is user exit for logging. The wizard had set user exit for logging to YES.

Can some one explain me what user exit for logging is meant for.Basically I did not understand it. How do I change this setting.

Thanks a lot for help

Regards
Reply With Quote
  #9 (permalink)  
Old 03-30-10, 16:43
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Quote:
Originally Posted by ARWinner View Post
What do you mean that "archiving did not show started"?


Since turning it on, have you tried doing anything to the DB? It should be in a backup pending state.


Andy
Archieving did not start means that logs were not transfered to specified folder automatically !!

Since turning it on, I am trying doing everything with it. I mean this is my test system, I can make it work hard with any simple script. For instance, I created a test table and inserted about 5 million rows and deleted the same.


Since now it is on, it takes few thousand rows to show archieveing in action. I can see the Logs being archieved to target.

Regards


PS: DB was not in backup pending state

Last edited by DBFinder; 03-30-10 at 16:46. Reason: PS: DB was not in backup pending state
Reply With Quote
  #10 (permalink)  
Old 03-30-10, 16:49
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Quote:
Originally Posted by DBFinder View Post
Archieving did not start means that logs were not transfered to specified folder automatically !!
Check you db2diag.log file. Whenever an attempt to archive a log is performed, there is usually an entry in there about it. So if you had it turned on properly, you should have gotten the messages.

Andy
Reply With Quote
  #11 (permalink)  
Old 03-30-10, 17:08
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
I had checked. Update was logged in but nothing other than that.

Because currently it is on, I am trying to figure out why. I am trying to replicate the problem, so that if this happens with production, I should be able to handle it.

Thanks for you time anyway,

regards
Reply With Quote
  #12 (permalink)  
Old 03-30-10, 17:28
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Issue
ARCHIVE LOG FOR DATABASE
command.. this will close the log file and archive it to the defined directoyr
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #13 (permalink)  
Old 03-30-10, 17:28
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Was this db using circular logging to begin with?

If you modify logging from circular to archival (via logarchmeth/userexit/logretain), the db will be placed in backup pending state. Try creating a new db and then enable archival logging - db will be in backup pending state after you restart it.

In prod, modify logarchmeth1 using command line, terminate all connections and then perform an offline db backup.
Reply With Quote
  #14 (permalink)  
Old 03-30-10, 21:16
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Thanks everyone, I have completed the test study.

Exactly as Bella said, Switching from circular to archival will need OFFLINE BACKUP.

Because the subject database is already configured for LOGRETAIN , online backups are done everyday, we won't be required to perform OFFLINE backup.

Also, tested , DB2 does not require recycle when we change logarchmeth to DISK:. This sets userexit to ON.

Thousands of thanks for time,

DBFinder
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