Topic(s):   DB2 Certification

May 21, 2008

DB2 Certification: Restoring a database and understanding database privileges
Posted by Roger Sanders @ 12:40 AM ET | May 21, 2008

Brush up for certification by glancing through these sample questions. All questions are from the book DB2 9 for Linux, UNIX, and Windows Database Administration: Certification Study Guide, published by MC Press, and are reprinted with permission. Check back each week for more; browse past questions here.

QUESTION 35
Which of the following commands will restore a database using information found in the recovery history log file?

A. RESTART DATABASE
B. RESTORE DATABASE
C. RECOVER DATABASE
D. REBUILD DATABASE

QUESTION 36
Which of the following database privileges are NOT automatically granted to the group PUBLIC when a database is created?

A. CONNECT
B. BINDADD
C. IMPLICIT_SCHEMA
D. CREATE_EXTERNAL_ROUTINE

Answers

QUESTION 35
The correct answer is C. The Recover utility performs the restore and roll-forward opera-tions needed to recover a database to a specific point in time, based on information found in the recovery history file. The Recovery utility is invoked by executing the RECOVER DATABASE command. The basic syntax for this command is:

RECOVER [DATABASE | DB] [DatabaseAlias]
<TO [PointInTime] <USING [UTC | LOCAL] TIME> |
END OF LOGS>
<USER [UserName] <USING [Password]>>
<USING HISTORY FILE ([HistoryFile])>
<OVERFLOW LOG PATH ([LogDirectory] ,... )>
<RESTART>

where:

• DatabaseAlias identifies the alias assigned to the database associated with the backup image that is to be used to perform a version recovery operation.
• PointInTime identifies 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) that the database is to be rolled forward to. (Only transactions that took place before and up to the date and time specified will be reapplied to the database.)
• UserName identifies the name assigned to a specific user that the recovery operation is to be performed under.
• Password identifies the password that corresponds to the name of the user that the recovery operation is to be performed under.
• HistoryFile identifies the name assigned to the recovery history log file that is to be used by the Recovery utility.
• LogDirectory identifies the directory that contains offline archived log files that are to be used to perform the roll-forward portion of the re-covery operation.

Thus, if you wanted to perform a full recovery operation on a database named SAMPLE (which already exists) using information stored in the recovery history file, you could do so by executing a RECOVER DATABASE command that looks something like this:

RECOVER DATABASE sample
TO END OF LOGS

On the other hand, if you wanted to restore a database named SAMPLE and roll it forward to an extremely old point in time that is no longer contained in the current recovery history file, you could do so by executing a RECOVER DATABASE command that looks something like this (assuming you have a copy of an older recovery history file available):

RECOVER DATABASE sample
TO 2005-01-31-04.00.00
USING HISTORY FILE (/home/user/old2005files/db2rhist.asc)

It is important to note that if the Recover utility successfully restores a database, but for some reason fails while attempting to roll it forward, the entire recovery operation must be performed again. There is no way to restart a recovery operation from a point of failure.

QUESTION 36
The correct answer is D. To connect to and work with a particular database, a user must have the authorities and privileges needed to use that database. Therefore, whenever a new database is created, unless otherwise specified, the following authorities and privileges are automatically granted:
• Database Administrator (DBADM) authority, along with CONNECT, CREATETAB, BINDADD, CREATE_NOT_FENCED, IMPLICIT_SCHEMA, and LOAD privileges, are granted to the user who created the database.
• USE privilege on the table space USERSPACE1 is granted to the group PUBLIC.
• CONNECT, CREATETAB, BINDADD, and IMPLICIT_SCHEMA privileges are granted to the group PUBLIC.
• SELECT privilege on each system catalog table is granted to the group PUBLIC.
• EXECUTE privilege on all procedures found in the SYSIBM schema is granted to the group PUBLIC.
• EXECUTE WITH GRANT privilege on all functions found in the SYSFUN schema is granted to the group PUBLIC.
• BIND and EXECUTE privileges for each successfully bound utility are granted to the group PUBLIC.

« The Informix High Performance Loader – Part 1 | Main | DB2 LUW Performance: DB2 is ALIVE and WELL and IT’S NOT YOUR FAULT! »





This is a public forum. CMP Media and its affiliates are not responsible for and do not control what is posted herein. CMP Media makes no warranties or guarantees concerning any advice dispensed by its staff members or readers.

Community standards in this comment area do not permit hate language, excessive profanity, or other patently offensive language. Please be aware that all information posted to this comment area becomes the property of CMP Media LLC and may be edited and republished in print or electronic format as outlined in CMP Media's Terms of Service.

Important Note: This comment area is NOT intended for commercial messages or solicitations of business.



CAREER CENTER
Ready to take that job and shove it?
SEARCH JOBS
RECENT JOB POSTINGS
CAREER NEWS
10 Search Engines You Don't Know About
Go beyond Google and get vertical. These specialized search sites will help you find the business information you need -- fast.

Subscribe to the new digital version of IBM Database Magazine
New Digital Version

Sponsored links:



Subscribe to the IBM Database Magazine Newsletter

Email Address *
First Name
Last Name
HTML Preference
HTML Text
 

Fields with * are required.

 




Visit these other IBM and TechWeb Partner Sites: :
Maximizing ROI Through Business Process Management (BPM) and Service-Oriented Architecture (SOA)
Internet Evolution – The Macrosite for News, Analysis, & Opinion About the Future of the Internet
Business Innovation – Technology Strategies and Solutions for Driving Business Success