Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
| Question 33 | The 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:
| ||||||||||||||||||||||||||||||||||||
| Question 34 | The 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:
All other options shown with this command are described in Table F.1.
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 35 | The 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 36 | The 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 37 | The 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:
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 38 | The 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 applicationsIt 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 39 | The 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 40 | The 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 41 | The 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:
Code View:
Scroll
/
Show All =====================
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 42 | The 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:
| ||||||||||||||||||||||||||||||||||||
| Question 43 | The 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:
| ||||||||||||||||||||||||||||||||||||
| Question 44 | The 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:
(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:
All other options shown with this command are described in Table F.2.
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 45 | The 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 46 | The 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 47 | The 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 48 | The 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:
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 49 | The 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:
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 50 | The 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 51 | The 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 52 | The 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:
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 53 | The 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 54 | The 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 55 | The 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 56 | The 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 |