Sie sind auf Seite 1von 8

IBM's DB2 QUESTIONNAIRE

Q.1 What is DB2 (IBM Database 2)?


A DB2 is a subsystem of the MVS operating system. It is a Database Management System
(DBMS) for that operating system.

Q.2 What is an access path?


A The path that is used to get to data specified in SQL statements.

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.

Q.5 What is a DB2 bind?


A A bind is a process that builds "access paths" to DB2 tables. A bind uses Database

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.

Q.7 What is meant by attachment facility?


A The attachment facility is an interface between DB2 and TSO, IMS/VS, CICS or batch
IN

address spaces. It allows application programs to access DB2.

Q.8 What is meant by AUTO COMMIT?


A AUTO COMMIT is a SPUFI option that commits the effects of SQL statements
A

automatically if they are successfully executed.


M

Q.9 What is a base table?


A A base table is a "real" table-a table that physically exists, in that there are physical
stored records.
M

Q.10 What is the function of Buffer Manager?


A The Buffer Manager is the DB2 component responsible for physically transferring data
IB

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).

Q.11 What is a buffer pool?


A A buffer pool is main storage that is reserved to satisfy the buffering requirements for
one or more tablespaces or indexes and is made up of either 4K or 32K pages.

Q.12 How many buffer pools are there in DB2?


A There are four buffer pools namely : BPO, BPI, BP2, and BP32.
Q.13 On the create tablespace, what does the CLOSE parameter do?
A CLOSE physically closes the tablespace when no one is working on the object. DB2
(Release 2.3) will logically close tiblespaces.

Q.14 What is a clustering index?


A It is a type index that :
• locates table rows
• Determines how rows are grouped together in the tablespace

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.

Q.16 What is meant by concurrency?

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

Q.18 What is the function of the Data Manager?


A The Data Manager is a DB2 component that manages the physical databases). It
invokes other system components as necessary to perform detailed functions such as
IN

locking, logging and physical I/O operations (such as search, retrieval, update, and
index maintenance).

Q.19 What is a Database Request Module (DBRM)?


A

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.

Q.20 What is a data page?


M

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

Q.21 What are data types?


A They are attributes of columns, literal and host variables. The data types are SMALLINT,
INTEGER, FLOAT, DECIMAL, CHAR, VARCHAR, DATE and TIME.

Q.22 What is a Declarations Generator (DCLGEN)?


A DCLGEN is a facility that is used to generate SQL statements that describe a table or
view. These table or view descriptions are then used to check the validity of other SQL
statements at precompile time. The table or view declare are used by the DB2I utility
DCLGEN to build a host language structure which is used by the DB2 precompiler to
verify that correct column names and data types have been specified in SQL statement.

Q.23 What does DSNDB07 database do?


A DSNDB07 is where DB2 does its sorting. It includes DB2's sort workarea and external
storage.

Q.24 What is meant by dynamic SQL?


A Dynamic SQL are SQL statements that are prepared and executed within a program

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).

Q.26 What is meant by entity integrity?

M
A. Entity integrity is when the primary key is in fact unique and not null.

Q.27 What will the EXPLAIN do?


A
A EXPLAIN obtains information (which indexes are used, whether sorting is necessary,
which level of locking is applied) about how SQL statements in the DBRM will be
FR
executed, inserting this information into "X".PLAN_TABLE where "X" is the authorization
ID of owner of the plan.

Q.28 What is a foreign key?


IN

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.

Q.29 What will the FREE command do to a plan?


A

A It will drop (delete) that existing plan.


M

Q.30 What will the GRANT option do?


A It will grant privileges to a list of one or more users. If the GRANT option is used in
conjunction with the "PUBLIC" option, then all users are granted privileges. Also, you
M

can grant privileges by objects and types.

Q.31 What does the term "grant privileges" mean?


IB

A Grant privileges means giving access/authority to DB2 users.

Q.32 What is a host variable?


A This is a data item that is used in an SQL statement to receive a value or to supply a
value. It must be preceded by a colon (:) to tell DB2 that the variable is not a column
name.

Q.33 What is an image copy?


A It is an exact reproduction of all or part of a tablespace. DB2 provides utility programs to
make full-image copies (to copy the entire tablespace) or incremental image copies to
copy only those pages that have been modified since the last image copy.

Q.34 What is meant by an index?


A An index is a set of row identifiers (RIDS) or pointers that are logically ordered by the
values of a column that has been specified as being an index. Indexes provide faster
access to data and can enforce uniqueness on the row in a 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

Q.40 What is a “nonleaf” page?


A This is a page that contains keys and page numbers of other pages in the index.
Nonleaf pages never point to actual data.
A

Q.41 What is meant by null?


M

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

Q.42 What is an object?


A An object is anything that is managed by DB2 (that is, databases, tablespaces, tables,
views, indexes, or synonyms), but not the data itself.
IB

Q.43 What will the DB2 optimizer do?


A The optimizer is a DB2 component that processes SQL statements and selects the
access paths.

Q.44 What is a page?


A This is the unit of storage within a tablespace or indexspace that is accessed by DB2.

Q.45 What is a pagespace?


A Pagespace refers either to an unpartitioned table to an index space, or to a single
partition of a partitioned table of index space.

Q.46 What is a predicate?


A A predicate is an element of a search condition that expresses or implies a comparison
operation.

Q.47 Describe a primary key?


A A primary key is a key that is unique, nonnull and is part of the definition of a table. A

m
table must have a primary key to be defined as parent.

Q.48 What is a recovery log?

.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.

Q.49 What is a Resource Control Table (RCT)? Describe its characteristics.

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

Q.52 What is meant by a repeatable read?


A When an application program executes with repeatable read protection, rows referenced
by the program cannot be changed by other programs until the program reaches a
commit point.
A

Q.53 What is a row?


M

A A row is a single occurrence of columns (of data) described by the table definition.
M
IB

Q.54 Describe what a storage group (STOGROUP) is?


A A STOGROUP is a named collection of DASD volumes to be used by tablespace and
index space of databases. The volumes of a STOGROUP must be of the same device
type.

Q.55 What is meant by synonym?


A A synonym is an alternate name for a table or view which is stored in the
SYSIBM.SYSSYNONYMS table.

Q.56 Describe what a table is?


A A table is a DB2 structure in which column names are used to specify the information
that is being stored by row.

Q.57 What is a tablespace?


A A tablespace is a VSAM dataset which is used to store one or more tables. The physical
page can consist of 4K or 32K pages.

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.

Q.59 What is the format (internal layout) of 'TIMESTAMP'?

ES
A This is a seven-part value that consists of a date (yymmdd) and time (hhmmss and
microseconds).

Q.60 What is a unique index?

M
A An index specified as unique is an index for which no duplicates are allowed.

Q.61 What is meant by a unit of recovery?


A
A This is a sequence of operations within a unit of work (i.e., work done between commit
points).
FR

Q.62 What is a view?


A A view is an alternative representation of data contained in one or more tables. A view
can include all or some of the columns contained in the table or tables.
IN

Q.63 What does a view do?


A A view restricts access to specific columns and rows.
A

Q.64 What is a data model?


A A data model is a way of representing entities, attributes and relationships.
M

Q.65 When a transaction issues a commit, to what is the commit writing?


A A commit triggers a write to a log record.
M

Q.66 Can DASD types assigned to storage groups by intermixed (i.e., 3350s and 3380s)?
A No.
IB

Q.67 What type of information is contained on the BSDS?


A The BSDS contains information about active and archive logs, their dataset names and
volumes on which they reside.

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.71 What is the maximum number of partitions allowed in a partitioned tablespace?


A The maximum is 64.

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.

Q.4 What information is contained in a SYSCOPY "entry"?


A It includes the name of database, tablespace name, and the image copy type (full,
IN

incremental, etc.), as well as the date and time each copy was made.

Q.5 What information can you find in SYSIBM.SYSLINKS table?


A The SYSIBM.SYSLINKS table contains information about the links between tables
A

created by referential constraints.


M

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

A This information can be found in SYSIBM.SYSINDEXES.

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.

Q.2 What will the LOAD utility do?


A The LOAD utility can load data into one or more tables in a tablespace or partition. The
LOAD can also replace contents of a single partition or an entire tablespace.

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.

Q.4 What will the RECOVER utility do?

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

Q.7 What will the RUNSTATS utility do?


A RUNSTATS will scan tablespaces or indexes gathering information about utilization of
space and efficiency of indexes. The information is stored in the DB2 catalog and is
used by SQL optimizer to select access paths to data during the bind.
A

Q.8 What will the STOSPACE utility do?


M

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

Das könnte Ihnen auch gefallen