| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| I am using DB2 8.2 and i've setup Archive logging on a database with the Active Log directory and Archive Log directory in different locations. I've also specified "use db2 to automatically archive the logs" and this is working fine. What i'm wondering is when does DB2 actually decide that an "active" or "online archive" log is no longer required in the Active Log directory and moves it to the Archive Log directory. I know it does this when the database is stopped but the database i've setup it up on is active all the time and I haven't enabled any User Exit scripts. |
|
#2
|
| Your logs get moved from the current logpath to the arhive log path whenever the log file fills up, and this is irrespective of the state of any transactions. If you deactivate the Database normally, there will be no connections and all transactions will be terminated. The last acive log, also called the current active log is "chopped" and archived. If the archive log path becomes unaccessible, the logs are marked "to be archived" and DB2 will wait until the archive path becomes available. Meantime, the logs are kept in current log path. HTH, Pierre. -- Pierre Saint-Jacques SES Consultants Inc. 514-737-4515 826461419.1136475464004.JavaMail.was... 7.sby.ibm.com... >I am using DB2 8.2 and i've setup Archive logging on a database with the >Active Log directory and Archive Log directory in different locations. I've >also specified "use db2 to automatically archive the logs" and this is >working fine. > > What i'm wondering is when does DB2 actually decide that an "active" or > "online archive" log is no longer required in the Active Log directory and > moves it to the Archive Log directory. I know it does this when the > database is stopped but the database i've setup it up on is active all the > time and I haven't enabled any User Exit scripts. |
|
#3
|
| Hi Pete, In 8.2 DB2 will archive the log either when it fills or when the last connection to the database is closed, even if the log isn't full. If by "active all the time" you mean there is always at least one connection to the database, then you're only going to get logs archived when they fill. Cheers, Julian. news:826461419.1136475464004.JavaMail.wassrvr-at-ltsg was007.sby.ibm.com... >I am using DB2 8.2 and i've setup Archive logging on a database with the >Active Log directory and Archive Log directory in different locations. I've >also specified "use db2 to automatically archive the logs" and this is >working fine. > > What i'm wondering is when does DB2 actually decide that an "active" or > "online archive" log is no longer required in the Active Log directory and > moves it to the Archive Log directory. I know it does this when the > database is stopped but the database i've setup it up on is active all the > time and I haven't enabled any User Exit scripts. |
|
#4
|
| The other option is to periodically issue the "archive log" command which forces the closure of the "not full" active log. Neil. nntp://news.software.ibm.com/ibm.software.db2.udb/ Hi Pete, In 8.2 DB2 will archive the log either when it fills or when the last connection to the database is closed, even if the log isn't full. If by "active all the time" you mean there is always at least one connection to the database, then you're only going to get logs archived when they fill. Cheers, Julian. news:826461419.1136475464004.JavaMail.wassrvr-at-ltsg was007.sby.ibm.com... >I am using DB2 8.2 and i've setup Archive logging on a database with the >Active Log directory and Archive Log directory in different locations. I've >also specified "use db2 to automatically archive the logs" and this is >working fine. > > What i'm wondering is when does DB2 actually decide that an "active" or > "online archive" log is no longer required in the Active Log directory and > moves it to the Archive Log directory. I know it does this when the > database is stopped but the database i've setup it up on is active all the > time and I haven't enabled any User Exit scripts. [ibm.software.db2.udb] |
|
#5
|
| Thanks for your help with this, it's what I thought happened but I couldn't find it mentioned anywhere. Do you know how HADR works with Archive Logs? My question is to do with how HADR will re-sync the database if it's been offline for a couple of hours. Does it use the Archive Logs to perform this sync? |
|
#6
|
| When an HADR standby is restarted, it will go through two distinct phases of "catch up" processing. 1. Local catchup In this phase, the standby restarts log replay. The restart location is chosen much like it would be for a regular database restart / crash recovery, i.e., far enough back so that (a) any updates that were only in buffer pool cache and not yet on disk will be replayed over again, and (b) meta data for the set of existing transactions can be rebuilt. Any log files directly accessible to the HADR standby may be used in this phase. This will include log files in the configured log paths on the standby (whether left over from prior operation of the system or manually placed there by the user) as well as any log files the standby can retrieve from an archive (based on the log archiving configuration of the standby). If the HADR pair happens to use a shared device (shared disk, storage manager, etc.) it is possible that the standby will be able to directly restore from archive log files that were generated on the primary while the standby was offline. After the HADR standby has processed all accessible log files in local catchup phase, it will move into "remote catchup pending" state. At this time the HADR standby will wait until it can establish a connection to the HADR primary, if such a connection has not already been made during local catchup phase. 2. Remote catchup Once the HADR pair has a connection established, and after local catchup completes on the HADR standby, the standby will request that log shipping begin from its current log position. The HADR primary will now have the responsibility to provide log data to the standby. In order to do so, the HADR primary may access any log files available to it, either from the configured log paths or by restoring log files from archive according to its configuration. In this way, any log files that the HADR primary generated while the standby was offline, and which the standby could not otherwise access, will be read by the primary and shipped over the comm connection to the standby. At the standby, the log data is written out to recreate the log files and also replayed against the database, i.e., normal HADR standby processing. Once the HADR standby catches up to the current log position of the primary, it will transition to Peer state where new log data is shipped from memory as it is flushed on the primary, rather than being read back from existing log files. Regards, - Steve P. ----------------------------------------- Steve Pearson IBM DB2 UDB for LUW Development Portland, OR, USA |
|
#7
|
| Thanks for the info, explains everything. |
![]() |
| Thread Tools | |
| Display Modes | |