Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

High Availability and Diagnostics

High Availability and Diagnostics

Question 33The correct answer is B. The name of the current active log file (also referred to as the first active log file) can be obtained by executing the GET DATABASE CONFIGURATION command and examining the contents of the loghead database configuration parameter. (This will appear as “First active log file” in the list of information returned by the GET DATABASE CONFIGURATION command.). Other log-related information returned by the GET DATABASE CONFIGURATION command includes:

  • Log buffer size (4KB)

logbufsz
  • Log file size (4KB)

logfilsiz
  • Number of primary log files

logprimary
  • Number of secondary log files

logsecond
  • Path to log files

logpath
  • Overflow log path

overflowlogpath
  • Mirror log path

mirrorlogpath
  • Block log on disk full

blk_log_dsk_ful
  • Percent max primary log space by transaction

max_log
  • Num. of active log files for 1 active UOW

num_log_span
  • First log archive method

logarchmethl
  • Options for logarchmeth1

logarchoptl
  • Second log archive method

logarchmeth2
  • Options for logarchmeth2

logarchopt2
  • Failover log archive path

failarchpath
  • Number of log archive retries on error

numarchretry
  • Log archive retry Delay (secs)

archretrydelay


Question 34The correct answer is D. The DB2 Check Backup utility can be used to test the integrity of a backup image, or multiple parts of a backup image, and to determine whether or not the image can be used to restore a damaged or corrupted database. It can also be used to display the metadata stored in the backup header (such as log path used, instance name, type of backup image, etc.).

The DB2 Check Backup utility is invoked by executing the db2ckbkp command. The syntax for this command is:

db2ckbkp
[ <-a>
  <-c>
  <-d>
  <-e>
  <-h>
  <-l>
  <-n>
  <-o>
  <-p>
  <-s>
  <-t>
  <-cl [DecompressLib]>
  <-co [DecompressOpts]> ,... ]
[FileName,...]

or

db2ckbkp –H [FileName,...]

or

db2ckbkp –S [FileName,...]

or

db2ckbkp –T [FileName,...]

where:

DecompressLibSpecifies the library, by name, that is to be used to decompress the backup image. (If this parameter is not specified, DB2 will attempt to use the library stored in the image. If the backup image was not compressed, the value of this parameter will be ignored; if the backup image was compressed and the specified library cannot be loaded, the operation will fail.)
DecompressOptsDescribes a block of binary data that will be passed to the initialization routine in the decompression library. DB2 will pass this string directly from the client to the server, so any issues of byte reversal or code page conversion will have to be handled by the decompression library. If the first character of the data block is ‘@’, the remainder of the data will be interpreted by DB2 as the name of a file residing on the server. DB2 will then replace the contents of the string with the contents of that file and will pass this new value to the initialization routine instead.
FileNameIdentifies, by name, one or more backup image files that are to be analyzed. When checking multiple parts of a backup image, the first backup image object (.001) must be specified first.


All other options shown with this command are described in Table F.1.

Table F.1. db2ckbkp Command Options
OptionMeaning
-aSpecifies that all information available about the backup image is to be collected and displayed.
-cSpecifies that checkbit and checksum information is to be collected and displayed.
-dSpecifies that information stored in the headers of DMS table space data pages is to be collected and displayed.
-eSpecifies that pages are to be extracted from the backup image and written to a file. To extract pages, you need an input file and an output file. The default input file is called extractPage.in and the default output file is called extractPage.out. You can override the default input file name using the DB2LISTFILE environment variable; you can override the default output file name using the DB2EXTRACTFILE environment variable.
-hSpecifies that media header information, including the name and path of the backup image, is to be collected and displayed.
-lSpecifies that log file header (LFH) and mirror log file header (MFH) information is to be collected and displayed.
-nIndicates that the user is to be prompted whenever a tape needs to be mounted. (Assumes one tape per device.)
-oSpecifies that object header information is to be collected and displayed.
-pSpecifies that information about the number of pages of each object type found in the backup image is to be collected and displayed. This option will not show the number of pages for all different object types if the backup was done for DMS table space data—instead, it will show the total of all pages; LOB data pages and long data pages will not be returned.
-sSpecifies that information about the automatic storage paths used is to be collected and displayed.
-tDisplays table space details, including container information, for all table spaces in the backup image.
-HSpecifies that only the 4K media header information stored at the beginning of the backup image is to be collected and displayed; does not validate the image. This option cannot be used in combination with any other options.
-SSpecifies that information about the automatic storage paths used is to be collected and displayed; does not validate the image. This option cannot be used in combination with any other options.
-TDisplays table space details, including container information, for all table spaces in the backup image; does not validate the image. This option cannot be used in combination with any other options.


Thus, if you wanted to display only the media header information for an existing backup image named TEST.0.DB2.NODE0000.CATN0000.20081215130904.001, you could do so by executing a db2ckbkp command that looks something like this:

db2ckbkp –H TEST.0.DB2.NODE0000.CATN0000.20081215130904.001

(The –h option tells the tool to display header information along with other information; the –H options tells the tool to display ONLY header information.)

Question 35The correct answer is B. When incremental (cumulative) backup images are taken, database recovery involves restoring the database using the most recent full backup image available and applying the most recent incremental backup image produced. On the other hand, when incremental delta backup images are taken, database recovery involves restoring the database using the most recent full backup image available and applying each delta backup image produced since the full backup image used was made, in the order in which they were created.
Question 36The correct answer is C. The RESTORE DATABASE command can be used to create an entirely new database from a full database backup image, effectively cloning an existing database. For example, you could create a new database named PAYROLL2 that is an exact duplicate of a database named PAYROLL, using a backup image stored in a directory named BACKUPS by executing a RESTORE DATABASE command that looks something like this:
RESTORE DATABASE payroll
FROM /backups
INTO payroll2

If the PAYROLL database was created using automatic storage, the restore operation will maintain the storage path definitions used. So simply restoring the database will not alter the storage paths used; if you want to change the storage path definitions, you must do so explicitly when restoring the database.

(The RECOVER DATABASE command cannot be used to create an entirely new database.)

Question 37The correct answer is C. Once an HADR environment has been established, the following operations will be replicated automatically in the standby database whenever they are performed on the primary database:
  • Execution of Data Definition Language (DDL) statements (CREATE, ALTER, DROP)

  • Execution of Data Manipulation Language (DML) statements (INSERT, UPDATE, DELETE)

  • Buffer pool operations

  • Table space operations (as well as storage-related operations performed on automatic storage databases)

  • Online reorganization

  • Offline reorganization

  • Changes to metadata (system catalog information) for stored procedures and user-defined functions (UDFs)

HADR does not replicate stored procedure and UDF object and library files. If this type of replication is needed, you must physically create the files on identical paths on both the primary and standby databases. (If the standby database cannot find the referenced object or library file, the stored procedure or UDF invocation will fail on the standby database.)

Additionally, non-logged operations, such as changes to database configuration parameters and to the recovery history file, are not replicated to the standby database.

Question 38The correct answers are B and C. if you wanted to obtain a list of applications that are currently connected to a database named PAYROLL, you could do so by executing the LIST APPLICATIONS command from the DB2 Command Line Processor, or by executing a db2pd command that looks something like this:
db2pd –applications –db payroll

You could obtain information about connected applications using the DB2 snapshot monitor, but the query used to do so would look like this:

SELECT * FROM TABLE(SNAP_GET_APPL('payroll',-1)) AS applications

It is important to note that if the DB2 server is not responding and appears to be hung, the ONLY way to obtain a list of applications that are currently connected to the database is by using the db2pd utility.

Question 39The correct answer is D. Because table space TBSP1 has 160 useable pages and 156 of them have already been used, there are only 4 free pages remaining. Therefore, table space TBSP1 is about to run out of storage space.

Table space SYSCATSPACE is a resizable DMS table space, however, it has NOT been resized yet; table space IBMDB2SAMPLEREL is an autoresizing DMS table space; and the state of table space USERSPACE1 is “Normal” – not “Roll-forward pending”.

Question 40The correct answer is A. When a DB2 9 database is configured to support roll-forward recovery, DB2 can call a special program, known as a user exit program, to move archived log files from the active log directory/device to a specific storage location when they are no longer needed to support transaction logging. So just what is a user exit program? Essentially, a user exit program is a user-supplied application that is invoked by DB2 whenever an open log file is closed, a database is closed (i.e., all connections to the database are terminated), or the ROLLFORWARD DATABASE command/API is executed (to perform a roll-forward recovery operation on a DB2 9 database).

Once the source code file for a user exit program has been compiled and linked to produce an executable program, two actions must be performed before it can actually be used: the executable form of the user exit program must be copied to a specific location and the logarcmeth1 or logarcmeth2 database configuration parameter for the appropriate database(s) must be assigned the value USEREXIT.

It is important to note that IBM is recommending users move away from user exit programs. An easier method for moving log files from the active log directory to an archive log storage location is to assign the value DISK:, followed by the desired location path to the logarchmeth1 database configuration parameter.

Question 41The correct answer is C. If you wanted to determine whether or not an existing backup image for a database named TEST was created using the INCLUDE LOGS option of the BACKUP DATABASE command, you could do so by executing a db2ckbkp command that looks something like this (assuming the name of the backup image created is TEST.0.DB2. NODE0000.CATN0000.20081215131853.001):
db2ckbkp –h TEST.0.DB2.NODE0000.CATN0000.20081215131853.001

The results produced should look something like this:

=====================
MEDIA HEADER REACHED:
=====================
        Server Database Name           -- TEST
        Server Database Alias          -- TEST
        Client Database Alias          -- TEST
        Timestamp                      -- 20081215131853
        Database Partition Number      -- 0
        Instance                       -- DB2
        Sequence Number                -- 1
        Release ID                     -- B00
        Database Seed                  -- 4773F9E6
        DB Comment's Codepage (Volume) -- 2020
        DB Comment (Volume)            --
        DB Comment's Codepage (System) -- 2020
        DB Comment (System)            --
        Authentication Value           -- 32
        Backup Mode                    -- 0
        Includes Logs                  -- 0
        Compression                    -- 1
        Backup Type                    -- 0
        Backup Gran.                   -- 0
        Status Flags                   -- 1
        System Cats inc                -- 1
        Catalog Partition Number       -- 0
        DB Codeset                     -- IBM-1252
        DB Territory                   --
        LogID                          -- 1197742728
        LogPath                        -- C:\LOGS\NODE0000\
        Backup Buffer Size             -- 16777216
        Number of Sessions             -- 1
        Platform                       -- 5

The proper image file name would be:
     TEST.0.DB2.NODE0000.CATN0000.20081215131853.001

[1] Buffers processed:  ####

Image Verification Complete - successful.

					  

(In this case, because the “Include Logs” attribute is set to 0, the INCLUDE LOGS option of the BACKUP DATABASE command was NOT specified when the backup image was created.)

The LIST HISTORY command will tell you what type of backup image was created (F = Offline, N = Online, I = Incremental offline, O = Incremental online, D = Delta offline, E = Delta online, R = Rebuild), when the backup image was created, where the backup image was stored, and the earliest log and current log files used. However, it will not tell you if the log files were included in the backup image.

Question 42The correct answer is D. When invalid table space containers are encountered, they can be redefined at the beginning of the recovery process by performing what is known as a redirected restore. (A redirected restore operation can also be used to restore a backup image to a target machine that is different than the source machine, or to store table space data into a different physical location.)

The steps used to perform a redirected restore operation are as follows:

  1. Start the redirected restore operation by executing the RESTORE DATABASE command with the REDIRECT option specified. (When this option is specified, each invalid table space container encountered is flagged, and all table spaces that reference invalid table space containers are placed in the “Restore Pending” state. A list of all table spaces affected can be obtained by executing the LIST TABLESPACES command.) At some point, you should see a message that looks something like this:

    SQL1277N Restore has detected that one or more table space containers are
    inaccessible, or has set their state to 'storage must be defined'.
    DB20000I The RESTORE DATABASE command completed successfully.

  2. Specify new table space containers for each table space placed in “Restore Pending” state by executing a SET TABLESPACE CONTAINERS command for each appropriate table space. (Keep in mind that SMS table spaces can only use PATH containers, while DMS table spaces can only use FILE or DEVICE containers.)

  3. Complete the redirected restore operation by executing the RESTORE DATABASE command again with the CONTINUE option specified.

    To simplify things, all of these steps can be coded in a UNIX shell script or Windows batch file, which can then be executed from a system prompt. Such a file would look something like this:

    db2 "RESTORE DATABASE sample FROM C:\backups TO D:\DB_DIR INTO
    sample_2 REDIRECT"
    
    db2 "SET TABLESPACE CONTAINERS FOR 0 USING
    (PATH 'D:\DB_DIR\SYSTEM')"
    
    db2 "SET TABLESPACE CONTAINERS FOR 1 USING
    (PATH 'D:\DB_DIR\TEMP')"
    
    db2 "SET TABLESPACE CONTAINERS FOR 2 USING
    (PATH 'D:\DB_DIR\USER')"
    
    db2 "RESTORE DATABASE sample CONTINUE"

Question 43The correct answer is A. The hadr_syncmode database configuration parameter is used to specify the synchronization mode to use for HADR. The value assigned to this parameter determines how primary log writes are synchronized with the standby database when the systems are in peer state. Valid values for this configuration parameter are:
  • SYNC (Synchronous) This mode provides the greatest protection against transaction loss, and using it results in the longest transaction response time among the three modes. In this mode, log writes are considered successful only when log records have been written to log files on the primary database and when the primary database has received acknowledgement from the standby database that the log records have also been written to log files on the standby database. The log data is guaranteed to be stored at both sites.

  • NEARSYNC (Near Synchronous) Although this mode has a shorter transaction response time than synchronous mode, it also provides slightly less protection against transaction loss. In this mode, log writes are considered successful only when log records have been written to the log files on the primary database and when the primary database has received acknowledgement from the standby system that the log records have also been written to main memory on the standby system. Loss of data occurs only if both sites fail simultaneously and if the target site has not transferred all of the log data that it has received to nonvolatile storage.

  • ASYNC (Asynchronous) This mode has the highest chance of transaction loss if the primary system fails. It also has the shortest transaction response time among the three modes. In this mode, log writes are considered successful only when log records have been written to the log files on the primary database and have been delivered to the TCP layer of the primary system’s host machine. Because the primary system does not wait for acknowledgement from the standby system, transactions might be considered committed when they are still on their way to the standby system.

Question 44The correct answer is D. The DB2 memory tracker utility is used to produce a complete report of memory status for instances, databases, and agents. This utility provides the following information about memory pool allocation:
  • Current size

  • Maximum size (hard limit)

  • Largest size (high water mark)

  • Type (identifier indicating function for which memory will be used)

  • Agent who allocated pool (only if the pool is private)

(This information is also available from the snapshot monitor.)

The DB2 memory tracker is invoked by executing the db2mtrk command. The syntax for this command is:

db2mtrk
<-i>
<-d>
<-p
<-m | -w>
<-r [Interval] <Count>>
<-v>
<-h>

where:

IntervalIdentifies the number of seconds to wait between subsequent calls to the DB2 memory tracker.
CountIdentifies the number of times to repeat calls to the DB2 memory tracker.


All other options shown with this command are described in Table F.2.

Table F.2. db2mtrk Command Options
OptionMeaning
-iSpecifies that information about instance level memory is to be collected and displayed.
-dSpecifies that information about database level memory is to be collected and displayed.
-pSpecifies that information about private memory is to be collected and displayed.
-mSpecifies that maximum values for each memory pool is to be collected and displayed.
-wSpecifies that high watermark values for each memory pool are to be collected and displayed.
-vIndicates that verbose output is to be returned.
-hDisplays help information. When this option is specified, all other options are ignored, and only the help information is displayed.


Thus, if you wanted to see how memory is utilized by the active databases on a system, and you wanted to capture and view this information ten times, updating it every five minutes, you could do so by executing a db2mtrk command that looks something like this:

db2mtrk –d –r 300 10

(The –d option tells db2mtrk to collect and display information for all databases; the –r 300 10 option tells db2mtrk to collect the information every 300 seconds – which is 5 minutes – a total of 10 times.)

Question 45The correct answer is C. If you are concerned about running out of log space, and you want to avoid allocating a large number of secondary log files, you can configure a database to use what is known as infinite logging. To enable infinite logging for a database, you simply set the logsecond database configuration parameter to -1. However, in order to use infinite logging, a database must be configured to use archival logging. This is done by assigning the value LOGRETAIN to the logarcmeth1 or logarcmeth2 database configuration parameter.
Question 46The correct answers are B and D. To enable log file mirroring, you simply assign the fully qualified name of the mirror log location (path) to the mirrorlogpath database configuration parameter. Alternately, on UNIX systems, you can assign the value 1 to the DB2_ NEWLOGPATH registry variable - in this case, the name of the mirror log location is generated by appending the character “2” to the current value of the logpath database configuration parameter. Ideally, the mirror log path used should refer a physical location (disk) that does not see a large amount of disk I/O and that is separate from the physical location used to store primary log files.
Question 47The correct answer is C. The max_log configuration parameter is used to control the maximum percentage of the total active log space available that any one transaction can consume. This configuration parameter prevents transactions from consuming all of the available active log space, thereby preventing other applications from running. By default, if a running transaction exceeds this threshold, the offending transaction is rolled back and the application that the transaction is running under will be forced to terminate. (This behavior can be overridden by setting the DB2_FORCE_APP_ON_MAX_LOG registry variable to FALSE; if this registry variable is set to FALSE, only work performed by the current statement will be rolled back—the application can still commit the work completed by previous statements in the transaction, or it can roll back the work completed to undo the effects of the transaction.)

The num_log_span configuration parameter is used to set a limit on the number of log files any single running transaction can span. When a transaction is started, a record is written to the current active log file and as DB2 processes the transaction (as well as other transactions) log files are filled and closed. If the number of log files filled exceeds the limit established before the transaction is committed or rolled back, then by default the transaction is rolled back and the application the transaction was running under will be terminated. This behavior can also be overridden by setting the DB2_FORCE_APP_ON_MAX_ LOG registry variable to FALSE.

Question 48The correct answer is C. A backup image of a DB2 database, or a table space within a DB2 database, can be created by executing the BACKUP DATABASE command. The basic syntax for this command is:
BACKUP [DATABASE | DB] [DatabaseAlias]
<USER [UserName] <USING [Password]>>
<TABLESPACE ([TS_Name],...)
<ONLINE>
<INCREMENTAL <DELTA>>
<TO [Location] |
    USE TSM <OPTIONS [TSMOptions]>
    <OPEN [NumSessions] SESSIONS>>
<WITH [NumBuffers] BUFFERS>
<BUFFER [BufferSize]>
<PARALLELISM [ParallelNum]>
<UTIL_IMPACT_PRIORITY [Priority]>
<EXCLUDE LOGS | INCLUDE LOGS>
<WITHOUT PROMPTING>

where:

DatabaseAliasIdentifies the alias assigned to the database for which a backup image is to be created.
UserNameIdentifies the name assigned to a specific user under whose authority the backup operation is to be performed.
PasswordIdentifies the password that corresponds to the name of the user under whom the backup operation is to be performed.
TS_NameIdentifies the name assigned to one or more specific table spaces for which backup images are to be created.
LocationIdentifies the directory or device where the backup image created is to be stored.
TSMOptionsIdentifies options that are to be used by Tivoli Storage Manager (TSM) during the backup operation.
NumSessionsSpecifies the number of I/O sessions to be created between DB2 and TSM. (This parameter has no effect when backing up to tape, disk, or another local device.)
NumBuffersIdentifies the number of buffers that are to be used to perform the backup operation. (By default, two buffers are used if this option is not specified.)
BufferSizeIdentifies the size, in pages, that each buffer used to perform the backup operation will be. (By default, the size of each buffer used by the Backup utility is determined by the value of the backbufsz DB2 Database Manager configuration parameter.)
ParallelNumIdentifies the number of table spaces that can be read in parallel during the backup operation.
PriorityIndicates that the Backup utility is to be throttled such that it executes at a specific rate so that its effect on concurrent database activity can be controlled. This parameter can be assigned a numerical value within the range of 1 to 100, with 100 representing the highest priority and 1 representing the lowest.


Thus, if you wanted to backup a database named ACCOUNTING to a TSM server, using four concurrent TSM client sessions and eight buffers, you could do so by executing a BACKUP DATABASE command that looks something like this:

BACKUP DATABASE accounting
USER db2admin USING ibmdb2
USE TSM OPEN 4 SESSIONS WITH 8 BUFFERS

Question 49The correct answer is B. In a partitioned database environment, database partitions are backed up (and restored) individually—backup operations are local to the database partition server upon which the Backup utility is invoked. However, by using the db2_all command, you can create backup images for multiple partitions (which you identify by node number) from a single database partition server. (The LIST NODES command can be used to identify the nodes, or database partition servers, that have user tables on them.) For example, if you wanted to create a set of online incremental backup images for every partition on which a database named SAMPLE is stored, you could do so by executing a db2_all command that looks something like this:
db2_all "db2 BACKUP DATABASE sample ONLINE INCREMENTAL"

In this example, the BACKUP DATABASE command was executed on every partition. However, there may be times when you only want to perform a backup or recovery operation on one or more specific database partitions. Because of this, the db2_all command has two prefix sequences that can be used to limit the execution of specified operations to individual database partition servers. These prefix sequences are:

  • <<-nnn<

    The operation is to be performed on all database partition servers identified in the db2nodes.cfg file except the database partition server whose node number is nnn.

  • <<+nnn<

    The operation is only to be performed on the database partition server in the db2nodes.cfg file whose database partition number is nnn.

When using the <<-nnn< and <<+nnn< prefix sequences, nnn can be any 1-, 2-, or 3-digit database partition number; however, the number specified must have a matching nodenum value in the db2nodes.cfg file.

Thus, if you wanted to perform an online table space-level backup of the table space USERSPACE1 (which is the default table space used to hold user tables) for a database named SALES that resides on partition number 5, you could do so by executing a db2_all command that looks something like this:

db2_all "<<+5< db2 BACKUP DATABASE sample
   TABLESPACE (userspace1) ONLINE TO /backup_dir".

Question 50The correct answer is C. No special authority is required to run the DB2 Check Backup (db2ckbkp) utility, however, in order to use this utility, you must have read permission on the backup image files that are to be analyzed.
Question 51The correct answer is D. When the RESTORE DATABASE command is executed, if the INCREMENTAL option is specified without additional parameters, a manual cumulative restore operation will be initiated—during a manual cumulative restore, the RESTORE DATABASE command must be executed for each backup image needed to restore the database. During such a recovery operation backup images must be restored in the following order: last full backup, last incremental, first delta, second delta, third delta, and so on up to and including the last delta backup image made.

If the INCREMENTAL AUTO or the INCREMENTAL AUTOMATIC option is specified, an automatic cumulative restore operation will be initiated and no user intervention will be required to apply incremental and delta restores.

Question 52The correct answer is B. The basic syntax for the RECOVER DATABASE command is:
RECOVER [DATABASE | DB] [DatabaseAlias]
<TO [PointInTime] <USING [UTC | LOCAL] TIME>>
<ON ALL DBPARTITIONNUMS>
<USER [UserName] <USING [Password]>>
<USING HISTORY FILE ([HistoryFile])>
<OVERFLOW LOG PATH ([LogDirectory] ,...)>
<RESTART>

or

RECOVER [DATABASE | DB] [DatabaseAlias]
<TO END OF LOGS
    <ON ALL DBPARTITIONNUMS |
     ON DBPARTITIONNUM<S> ([PartitionNum],...)>>
<USER [UserName] <USING [Password]>>
<USING HISTORY FILE ([HistoryFile])>
<OVERFLOW LOG PATH ([LogDirectory] ,...)>
<RESTART>

where:

DatabaseAliasIdentifies the alias assigned to the database associated with the backup image that is to be used to perform a version recovery operation.
PointInTimeIdentifies a specific point in time, identified by a timestamp value in the form yyyy-mm-dd-hh.mm.ss.nnnnnn(year, month, day, hour, minutes, seconds, microseconds), to which the database is to be rolled forward. (Only transactions that took place before and up to the date and time specified will be reapplied to the database.)
PartitionNumIdentifies, by number, one or more database partitions (identified in the db2nodes.cfg file) that transactions are to be rolled forward on. In a partitioned database environment, the Recover utility must be invoked from the catalog partition of the database.
UserNameIdentifies the name assigned to a specific user under whom the recovery operation is to be performed.
PasswordIdentifies the password that corresponds to the name of the user under whom the recovery operation is to be performed.
HistoryFileIdentifies the name assigned to the recovery history log file that is to be used by the Recovery utility.
LogDirectoryIdentifies the directory that contains offline archived log files that are to be used to perform the roll-forward portion of the recovery operation.


If the RESTART option is specified, any previous recover operations are ignored; the RESTART option forces the Recover utility to execute a fresh restore operation and then roll the database forward to the point in time specified.

It the Recover utility successfully restores a database, but for some reason fails while attempting to roll it forward, the Recover utility will attempt to continue the previous recover operation without redoing the restore phase. If you want to force the Recover utility to redo the restore phase, you need to execute the RECOVER DATABASE command with the RESTART option specified. There is no way to explicitly restart a recovery operation from a point of failure.

Question 53The correct answers are B and E. The hadr_timeout database configuration parameter is used to specify the time (in seconds) that the HADR process waits before considering a communication attempt to have failed. Therefore, when the hadr_timeout database configuration parameter on the primary server is set to 30, if the primary server does not receive acknowledgement of a log buffer write within 30 seconds it assumes there was a communications error and drops out of peer mode.

The value assigned to the hadr_timeout database parameter must be the same for both the primary and the standby database.

Question 54The correct answer is B. Both the primary and the standby database must be a single-partition database and they both must have the same database name; however, they do not have to be stored on the same database path.

IBM recommends that you use identical host computers for the HADR primary and standby databases. (If possible, they should be from the same vendor and have the same architecture.) Furthermore, the operating system on the primary and standby database servers should be the same version, including patch level. You can violate this rule for a short time during a rolling upgrade, but use extreme caution when doing so. A TCP/IP interface must also be available between the HADR host machines, and a high-speed, high-capacity network should be used to connect the two.

The DB2 software installed on both the primary and the standby database server must have the same bit size (32 or 64) and the version of DB2 used for the primary and standby databases must be identical; for example, both must be either version 8 or version 9. During rolling upgrades, the modification level (for example, the fix pack level) of the database system for the standby database can be later than that of the primary database for a short while. However, you should not keep this configuration for an extended period of time. The primary and standby databases will not connect to each other if the modification level of the database system for the primary database is later than that of the standby database. Therefore, fix packs must always be applied to the standby database system first.

The amount of storage space allocated for transaction log files should also be the same on both the primary and the standby database server; the use of raw devices for transaction logging is not supported. (Archival logging is only performed by the current primary database.) Table space properties such as table space name, table space type (DMS, SMS, or Automatic Storage), table space page size, table space size, container path, container size, and container type (raw device, file, or directory) must be identical on the primary and standby databases. When you issue a table space statement such as CREATE TABLESPACE, ALTER TABLESPACE, or DROP TABLESPACE on the primary database, it is replayed on the standby database. Therefore, you must ensure that the table space containers involved such statements exist on both systems before you issue the table space statement on the primary database. (If you create a table space on the primary database and log replay fails on the standby database because the containers are not available, the primary database does not receive an error message stating that the log replay failed.) Automatic storage databases are fully supported, including replication of ALTER DATABASE statements. Similar to table space containers, the storage paths specified must exist on both the primary and the standby server.

Question 55The correct answer is C. Automatic Client Reroute is a DB2 feature that allows client applications to recover from a loss of communication with the server so that the application can continue its work with minimal interruption. (If automatic client reroute is not enabled, client applications will receive an error message indicating that a connect attempt has failed due to a timeout and no further attempts will be made to establish a connection with the server.) However, rerouting is only possible when an alternate database location has been specified at the server and the TCP/IP protocol is used.

The automatic client reroute feature can be used with HADR to make client applications connect to the new primary database immediately after a takeover operation. In fact, if you set up HADR using the Set Up High Availability Disaster Recovery (HADR) Databases Wizard, automatic client reroute is enabled by default. If you set up HADR manually, you can enable the automatic client reroute feature by executing the UPDATE ALTERNATE SERVER FOR DATABASE command; automatic client reroute does not use the values stored in the hadr_remote_host and hadr_remote_svc database configuration parameters.

For example, suppose you have cataloged a database named SALES on a client workstation as being located at host named SVR1. Database SALES is the primary database in an HADR environment and its corresponding standby database, also named SALES, resides on a host named SVR2 and listens on port number 456. To enable automatic client reroute, you simply specify an alternate server for the SALES database stored on host SVR1 by executing the following command:

UPDATE ALTERNATE SERVER FOR DATABASE sales
USING HOSTNAME svr2 PORT 456

Once this command is executed, the client must connect to host SVR1 to obtain the alternate server information. Then, if a communication error occurs between the client and the SALES database at host SVR1, the client will first attempt to reconnect to the SALES database on host SVR1. If this fails, the client will then attempt to establish a connection with the standby SALES database located on host SVR2.

Question 56The correct answer is A. If you wanted to see how memory is utilized by the active databases on a system, you could do so by executing a db2mtrk command that looks something like this:
db2mtrk –d

Assuming a database named SAMPLE is active at the time the db2mtrk command is issued, the results produced should look something like this:

Tracking Memory on: 2008/05/21 at 14:00:38

Memory for database: SAMPLE
   utilh     pckcacheh catcacheh bph (1)   bph (S32K) bph (S16K) bph (S8K)
   64.0K     128.0K    64.0K     1.2M      704.0K     448.0K     320.0K

   bph (S4K) shsorth   lockh     dbh       other
   256.0K    0         320.0K    4.3M      128.0K


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial