DATABASE 2(DB2)

 

DATABASE 2(DB2)

The questions and answers that follow are intended for those with a working knowledge of DB2 as a “self-test”.



Q1)  What is DB2 (IBM Database 2)?

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



Q2)  What is an access path?

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

Q3)  What is an alias?

A3)  It is an alternate name that can be used in SQL statements to refer to a table or view in the same or remote DB2 subsystem.

Q4)  Explain what a plan is?

A4)  Plan is a DB2 object (produced during the bind process) that associates one or more database request modules with a plan name.

Q5)  What is a DB2 bind?

A5)  Bind is a process  that builds “access paths” to DB2 tables. A bind uses the Database Request Modules(s) (DBRM(s)) from the DB2 pre-compile step as input and produces an application plan. It also checks the user’s authority and validates the SQL statements in the DBRM(s).

Q6)  What information is used as input to the bind process?

A6)  The database request module produced during the pre-compile. The SYSIBM.SYSSTMT table of the DB2 catalog.

Q7)  What is meant by the attachment facility?

A7)  The attachment facility is an interface between DB2 and TSO, IMS/VS, CICS, or batch address spaces. It allows application programs to access DB2.

Q8)  What is meant by AUTO COMMIT?

A8)  AUTO COMMIT is a SPUFI option that commits the effects of SQL statements automatically if they are successfully executed.

Q9)  What is a base table?

A9)  A base table is a real table -  a table that physically exists in that there are physical stored records.

Q10)    What is the function of buffer manager?

A10)           The buffer manager is the DB2 component responsible for physically transferring data 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).

Q11)    What is a buffer pool?

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

Q12)    How many buffer pools are there in DB2?

A12)           There are four buffer pools: BP0, BP1, BP2, and BP32.

Q13)    On the create tablespace, what does the CLOSE parameter do?

A13)           CLOSE physically closes the tablespace when no one is working on the object. DB2 (release 2.3) will logically close tablespaces.

Q14)    What is a clustering index?

A14)           It is a type of index that (1) locates table rows and (2) determines how rows are grouped together in the tablespace.

Q15)    What will the COMMIT accomplish?

A15)           COMMIT will allow data changes to be permanent. This then permits the data to be accessed by other units of work. When a COMMIT occurs, locks are freed so other applications can reference the just committed data.

Q16)    What is meant by concurrency?

A16)           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 un-repeatable reads.

Q17)    What is cursor stability?

A17)           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 application reaches the commit point). As soon as a program moves from one row to another, other programs may read or the first row.

Q18)    What is the function of the Data Manager?

A18)           The Data Manager is a DB2 component that manager the physical databases. It invokes other system components, as necessary, to perform detailed functions such as locking, logging, and physical I/O operations (such as search, retrieval, update, and index maintenance).

Q19)    What is a Database Request Module(DBRM)?

A19)           A DBRM is a DB2 component created by the DB2 pre-compiler containing the SQL source statements extracted from the application program. DBRMs are input to the bind process.

Q20)    What is a data page?

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

Q21)    What are data types?

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

Q22)    What is Declaration Generator(DCLGEN)?

A22)           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 declares 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 the SQL statement.

Q23)    What does DSNDB07 database do?

A23)           DSNDB07 is where DB2 does its sorting. It includes DB2’s sort work area and external storage.

Q24)    What will the FREE command do to  a  plan?

A24)           It will drop(delete) that existing plan.

Q25)    What is a host variable?

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

Q26)    What will the DB2 optimizer do?

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

Q27)    What is a page?

A27)           This is the unit of storage within a table space or indexspace that is accessed by DB2.

Q28)    What is pagespace?

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

Q29)    What is a predicate?

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

A30)           A recovery log is a collection of records that describes the sequence of events that occur in DB2. The information is needed for recovery in the event of a failure during execution.

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

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

Q32)    Where are plans stored?

A32)           Each plan is defined uniquely in the SYSIBM.SYSPLANS table to correspond to the transaction (s) that are to execute that plan.

Q33)    What is meant by repeatable read?

A33)           When an application program executes with repeatable read protection, rows referenced by the program can’t be changed by  other programs until the program reaches a commit point.

Q34)    Describe what a storage group(STOGROUP) is?

A34)           A STOGROUP is a named collection of DASD volumes to be used by tablespaces and index spaces of databases. The volumes of STOGROUP must be of the same device type.

Q35)    How would you move a tablespace (using STOGROUP) to a different DASD volume allocated to that tablespace?

A35)           If the tablespace used is only allocated to that STOGROUP:

                - ALTER STOGROUP - add volume (new) delete volume(old)

-          REORG TABLESPACE or RECOVER TABLESPACE

            Create a new STOGROUP that points to the new volume. ALTER the tablespace and REORG or RECOVER the

            tablespace.

Q36)    What is the format (internal layout) of “TIMESTAMP”?

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

Q37)    What is meant by a unit of recovery?

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

Q38)    Can DASD types assigned to storage groups be intermixed(i.e., 3350s and 3380s)?

A38)           No

Q39)    What are the three types of page locks that can be held?

A39)           Exclusive, update, and share.

Q40)    Can DB2 be accessed by TSO users? If yes, which command is used to invoke DB2?

A40)           DB2 can be invoked by TSO users by using the DSN RUN command.

Q41)    How are write I/Os from the buffer pool executed?

A41)           Asynchronously.

Q42)    What is a DB2 catalog?

A42)           The DB2 catalog is a set of tables that contain information about all of the DB2 objects(tables, views, plans etc.).

Q43)    In which column of which DB2 catalog would you find the length of the rows for all tables?

A43)           In the RECLENGTH column of SYSIBM.SYSTABLES

Q44)    What information is held in SYSIBM.SYSCOPY?

A44)           The SYSIBM.SYSCOPY table contains information about image copies made of the tablespaces.

Q45)    What information is contained in a SYSCOPY entry?

A45)           Included is the name of the database, the table space name, and the image copy type(full or incremental etc.,) as well as the date and time each copy was made.

Q46)    What information can you find in SYSIBM.SYSLINKS table?

A46)           The SYSIBM.SYSLINKS table contains information about the links between tables created by referential constraints.

Q47)    Where would you find information about the type of database authority held by the user?

A47)           SYSIBM.SYSDBAUTH.

Q48)    Where could you look if you had a question about whether a column has been defined as an index?

A48)           This information can be found in SYSIBM.SYSINDEXES.

Q49)    Once you create a view, where would information about the view be stored?

A49)           When a view is created, system information about the view is stored in SYSIBM.SYSVIEWS.

Q50)    What is the SQL Communications Area and what are some of its key fields?

A50)           It is a data structure that must be included in any host-language program using SQL.  It is used to pass feedback about the sql operations to the program.  Fields are return codes, error messages, handling codes and warnings.

 


Comments (0)

Post a Comment
* Your Name:
* Your Email:
(not publicly displayed)
Reply Notification:
Approval Notification:
Website:
* Security Image:
Security Image Generate new
Copy the numbers and letters from the security image:
* Message:

Email to Friend

Fill in the form below to send this article to a friend:

Email to Friend
* Your Name:
* Your Email:
* Friend's Name:
* Friend's Email:
* Security Image:
Security Image Generate new
Copy the numbers and letters from the security image
* Message: