Section 13.14. Summary


13.14. Summary

In this chapter you have learned the concepts of unit of work, (UOW), logging methods, and different recovery strategies.

A unit of work (UOW) is composed of one or more statements and completed by a COMMIT or ROLLBACK. If the UOW is interrupted in the middle, all statements executed up to that point will be rolled back. This ensures data integrity.

When a database is connected for the first time, DB2 allocates a number of primary logs, based on the setting in the LOGPRIMARY database configuration parameter. When there are not enough primary logs, DB2 allocates secondary logs, one at a time. When the maximum number of secondary logs is reached, specified by the LOGSECOND database parameter, DB2 encounters a log full condition. At this point, any uncommitted transactions are rolled back.

There are three types of database recoveries: crash, version, and roll forward recovery. Crash recovery and version recovery are the defaults. To enable roll forward recovery, you have to enable archival logging.

There are three logging methods in DB2: circular, archival, and infinite active logging. Circular logging is the default logging method. However, it does not support roll forward recovery.

Archival logging is enabled by setting the LOGARCHMETH1 database configuration parameter. Both archival logging and infinite active logging support roll forward recovery.

In DB2 Version 8.2, the new command RECOVER DATABASE combines both the RESTORE and ROLLFORWARD commands into one easy step. No backup image needs to be specified; the RECOVER DATABASE command will choose the best backup image possible to complete the recovery task.

Write suspend (aka suspended I/O) support offers a much faster way to perform database backups. This is achieved by taking an instantaneous disk copy of the primary database while it is in a write-suspend mode. During this time, all write operations on the database are suspended; however, other database functions still function normally. After the split mirror is completed, the database is returned to its normal state. No restore operation is needed to restore the split mirror into a new database. Instead, you use the db2inidb command to initialize the split mirrored database. There are three ways you can initialize the split mirror: as a clone database, a standby database, or a backup image of the primary database.

A new high-availability feature is introduced in Version 8.2: the High Availability Disaster Recovery (HADR) feature. The HADR setup requires both a primary server and a secondary server. The log pages that are flushed to the log file on disk at the primary database are constantly shipped and applied to the secondary database. When a failure occurs on the primary database, a takeover operation is initiated on the secondary database, which then becomes the new primary. Since the secondary database is already online, failover can be accomplished very quickly, resulting in minimal downtime.

DB2 provides two tools to inspect your database. The db2dart tool is an offline database analysis and reporting tool. In addition to inspecting a database, it can be used to mark an index invalid so it can be rebuilt. If your database is a 24x7 database, an inspection by db2dart is impossible. In that case use the INSPECT tool, which can be used while the database is online.



Understanding DB2(R. Learning Visually with Examples)
Understanding DB2: Learning Visually with Examples (2nd Edition)
ISBN: 0131580183
EAN: 2147483647
Year: 2004
Pages: 313

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net