DB2 Questionnaire
DB2 Questionnaire
DB2 Questionnaire
m
Q.3 What is an alias?
A It is an alternate name that can be used in SQL statements to refer to a table or view in
the same or a remote DB2 subsystem.
.co
Q.4 Explain what a plan is?
A A plan is a DB2 object (produced during the bind process) that associates one or more
ES
database request modules with a plan name.
M
Request Modules (DBRMs) from the DB2 precompile step as input and produces an
application plan. It also checks user's authority and validates the SQL statements in
DBRMs.
A
Q.6 What information is used as input to the bind process?
A 1. The database request model produced during the precompile.
FR
2. The SYSIBM.SYSSTMT table of the DB2 catalog.
between an external medium and (virtual) storage (performs the actual I/O operations).
It minimizes the amount of physical I/O actually performed with sophisticated buffering
techniques (i.e., read-ahead buffering and look-aside buffering).
m
Q.15 What will the COMMIT accomplish?
A COMMIT will allow data changes to be permanent. This then permits the data to be
.co
accessed by other units of work. When a COMMIT occurs, locks are freed so that other
applications can reference the just-committed data.
ES
A Concurrency is what allows more than one DB2 application process to access the same
data at essentially the same time. Problems may occur, such as lost updates, access to
uncommitted data and unrepeatable reads.
M
Q.17 What is cursor stability?
A It is cursor stability that "tells" DB2 that database values read by this application are
protected only while they are being used. (Changed values are protected until this
A
application reaches a commit point.) As soon as a program moves from one row to
another, other programs may read or change the first row.
FR
locking, logging and physical I/O operations (such as search, retrieval, update, and
index maintenance).
A A DBRM is a DB2 component created by the DB2 precompiler containing the SQL
source statements extracted from the application program. DBRMs are input to the bind
M
process.
A A data page is a unit of retrievable data, either 4K or 32K (depending on how the table is
defined) containing user or catalog information.
IB
m
while the program is executing. The SQL source is contained in host variables rather
than being "hard coded" into the program. The SQL statement may change from
execution to execution.
.co
Q.25 What is meant by embedded SQL?
A They are SQL statements that are embedded within an application program and are
prepared during program preparation process before the program is executed. After it is
ES
prepared, the statement itself does not change (although values of host variables
specified within the statement might change).
M
A. Entity integrity is when the primary key is in fact unique and not null.
A A foreign key is a column (or combination of columns) in a table whose values are
required to match those of the primary key in some other table.
m
Q.35 What is an index key?
A It is a column or set of columns in a table used to determine the order of index entries.
.co
Q.36 What is meant by an index scan?
A. When an entire index (or a portion thereof) is scanned to locate rows, we call this an
index scan. This type of access can be used, for example, to select rows of a table in
some order and avoid sort for a query.
ES
Q.37 What is meant by indicator variable?
A An indicator variable is an integer variable used to show whether its associated host
variable has been assigned a null value.
Q.38
A
What is a join?
M
A join is a relational operation that allows retrieval of data from two or more tables based
A
on matching column values.
FR
Q.39 What is meant by locking?
A Locking is a process that is used to ensure integrity of data. It also prevents concurrent
users from accessing inconsistent data. The data (row) is locked until a commit is
executed to release the updated data.
IN
A This is a special value that indicates the absence of data in a column. This value is
indicated by a negative value, usually -1.
M
m
table must have a primary key to be defined as parent.
.co
A A recovery log is a collection of records that describes sequence of events that occur in
DB2. The information is needed for recovery in the event of a failure during execution.
ES
A The RCT is a table that is defined to a DB2/CICS region. It contains control
characteristics which are assembled via the DSNCRCT macros. The RCT matches the
CICS transaction ID to its associated DB2 authorization ID and plan ID (CICS
attachment facility).
Q.50
A
Where are plans stored?
M
Each plan is defined uniquely in the SYSIBM.SYSPLAN table to correspond to the
A
transactions that are to execute that plan.
FR
Q.51 Describe referential integrity?
A Referential integrity refers to a feature in DB2 that is used to ensure consistency of data
in the database.
IN
A A row is a single occurrence of columns (of data) described by the table definition.
M
IB
Q.58 How would you move a tablespace (using STOGROUP) to a different DASD volume
allocated to that tablespace?
m
A 1. If the tablespace used is only allocated to that STOGROUP :
• ALTER STOGROUP-add volume (new) delete volume (old)
• REORG TABLESPACE or RECOVER TABLESPACE
.co
2. Create a new stogroup that points to the new volume. ALTER the tablespace and
REORG or RECOVER the tablespace.
ES
A This is a seven-part value that consists of a date (yymmdd) and time (hhmmss and
microseconds).
M
A An index specified as unique is an index for which no duplicates are allowed.
Q.66 Can DASD types assigned to storage groups by intermixed (i.e., 3350s and 3380s)?
A No.
IB
Q.68 What are the three types of page locks that can be "held"?
A Exclusive, update, and share.
Q.69 Can DB2 be accessed by TSO users? If yes, which command is used to invoke DB2?
A DB2 can be invoked by TSO users by using the DSN RUN command.
Q.70 What are the names of the different types of DB2 tablespaces?
A Simple, segmented and partitioned.
Q.72 How are write I/Os from the buffer pool executed?
A Asynchronously.
m
Q.73 After a table has been recovered, which flag is turned on?
A The Copy Pending flag is turned on.
.co
Catalogs
ES
Q.1 What is the DB2 catalog?
A The DB2 catalog is a set of tables that contain information about all the DB2 objects
(tables, views, plans, etc.).
M
Q.2 In which column of which DB2 catalog would you find the length of rows for all tables?
A In the RECLENGTH column of SYSIBM.SYSTABLES.
A
Q.3 What information is held in SYSIBM.SYSCOPY?
A The SYSIBM.SYSCOPY table contains information about image copies made of the
FR
tablespaces.
incremental, etc.), as well as the date and time each copy was made.
Q.6 Where would you find information about the type of database authority held by a user?
A SYSIBM.SYSDBAUTH.
M
Q.7 Where could you look if you had a question about whether a column has been defined
as an index?
IB
Q.8 Once you create a view, where would information about the view be stored?
A When a view is created, system information about the view is stored in
SYSIBM.SYSVIEWS.
Utilities
Q.1 What will the copy utility do?
A The copy utility will create an image copy of a tablespace or a dataset within a
tablespace. There are two types of image copies : full and incremental. A full image copy
copies all pages in a tablespace or dataset. An incremental image copy copies only
pages that has been modified since the last use of the COPY utility.
m
Q.3 What can the MERGECOPY utility do?
A It can merge several incremental copies of a tablespace to make a single incremental
.co
copy and it can merge incremental copies with a full-image copy to make a new full-
image copy.
ES
A This utility recovers data to the current state or a previous state. The largest unit of data
recovery is the tablespace; the smallest is a page. Data is recovered from image copies
of a tablespace and database log change records.
M
Q.5 What will the REORG utility do?
A It will reorganize a tablespace to improve access performance and reorganize indexes
so that they are more efficiently clustered.
A
Q.6 What will the REPAIR utility do?
FR
A It will repair invalid data with valid data and/or reset status conditions. The data may be
your own data or data you would not normally access : space map pages and index
entries.
IN
A This utility updates DB2 catalog columns that tell how much space is allocated for
storage groups and related tablespace and indexes.
M
Q.9 While the Copy Pending flag is on, is the tablespace that is just recovered available for
use?
A No, it is not available.
IB