IBM DB2 Interview Questions & Answers

  1. Question 1. What Is Db2 (ibm Database 2)?

    Answer :

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

  2. Question 2. What Is An Access Path?

    Answer :

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

  3. IBM Websphere Interview Questions

  4. Question 3. What Is An Alias?

    Answer :

    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.

  5. Question 4. Explain What A Plan Is?

    Answer :

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

  6. IBM Websphere Tutorial

  7. Question 5. What Is A Db2 Bind?

    Answer :

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

  8. IBM-REXX Interview Questions

  9. Question 6. What Information Is Used As Input To The Bind Process?

    Answer :

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

  10. Question 7. What Is Meant By The Attachment Facility?

    Answer :

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

  11. IBM-REXX Tutorial
    IBM Cognos Interview Questions

  12. Question 8. What Is Meant By Auto Commit?

    Answer :

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

  13. Question 9. What Is A Base Table?

    Answer :

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

  14. J2EE Interview Questions

  15. Question 10. What Is The Function Of Buffer Manager?

    Answer :

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

  16. IBM Cognos Tutorial

  17. Question 11. What Is A Buffer Pool?

    Answer :

    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.

  18. COBOL Interview Questions

  19. Question 12. How Many Buffer Pools Are There In Db2?

    Answer :

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

  20. IBM Websphere Interview Questions

  21. Question 13. On The Create Tablespace, What Does The Close Parameter Do?

    Answer :

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

  22. IBM DB2 Tutorial

  23. Question 14. What Is A Clustering Index?

    Answer :

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

  24. Question 15. What Will The Commit Accomplish?

    Answer :

    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.

  25. IBM-JCL Interview Questions

  26. Question 16. What Is Meant By Concurrency?

    Answer :

    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.

  27. J2EE Tutorial

  28. Question 17. What Is Cursor Stability?

    Answer :

    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.

  29. DB2 Using SQL Interview Questions

  30. Question 18. What Is The Function Of The Data Manager?

    Answer :

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

  31. IBM-REXX Interview Questions

  32. Question 19. What Is A Database Request Module(dbrm)?

    Answer :

    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.

  33. COBOL Tutorial

  34. Question 20. What Is A Data Page?

    Answer :

    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.

  35. IBM WAS Administration Interview Questions

  36. Question 21. What Is Declaration Generator(dclgen)?

    Answer :

    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.

  37. Question 22. What Does Dsndb07 Database Do?

    Answer :

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

  38. IBM-JCL Tutorial

  39. Question 23. What Will The Free Command Do To A Plan?

    Answer :

    It will drop(delete) that existing plan.

  40. IBM WebSphere Administration Interview Questions

  41. Question 24. What Is A Host Variable?

    Answer :

    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.

  42. IBM Cognos Interview Questions

  43. Question 25. What Will The Db2 Optimizer Do?

    Answer :

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

  44. DB2 Using SQL Tutorial

  45. Question 26. What Is A Page?

    Answer :

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

  46. Database Administration Interview Questions

  47. Question 27. What Is Pagespace?

    Answer :

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

  48. J2EE Interview Questions

  49. Question 28. What Is A Predicate?

    Answer :

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

  50. Question 29. What Is A Resource Control Table(rct)? Describe Its Characteristics.

    Answer :

    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 andplan ID(CICS attachment facility).

  51. DB2 SQL Programming Interview Questions

  52. Question 30. Where Are Plans Stored?

    Answer :

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

  53. Question 31. What Is Meant By Repeatable Read?

    Answer :

    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.

  54. Question 32. Describe What A Storage Group(stogroup) Is?

    Answer :

    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.

  55. Mainframe DB2 Interview Questions

  56. Question 33. What Is The Format (internal Layout) Of “timestamp”?

    Answer :

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

  57. COBOL Interview Questions

  58. Question 34. What Is Meant By A Unit Of Recovery?

    Answer :

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

  59. Question 35. Can Dasd Types Assigned To Storage Groups Be Intermixed(i.e., 3350s And 3380s)?

    Answer :

    No

  60. Question 36. What Are The Three Types Of Page Locks That Can Be Held?

    Answer :

    Exclusive, update, and share.

  61. IBM-JCL Interview Questions

  62. Question 37. Can Db2 Be Accessed By Tso Users? If Yes, Which Command Is Used To Invoke Db2?

    Answer :

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

  63. Question 38. How Are Write I/os From The Buffer Pool Executed?

    Answer :

    Asynchronously.

  64. Question 39. What Is A Db2 Catalog?

    Answer :

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

  65. Question 40. In Which Column Of Which Db2 Catalog Would You Find The Length Of The Rows For All
    Tables?

    Answer :

    In the RECLENGTH column of SYSIBM.SYSTABLES

  66. DB2 Using SQL Interview Questions

  67. Question 41. What Information Is Held In Sysibm.syscopy?

    Answer :

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

  68. Question 42. What Information Is Contained In A Syscopy Entry?

    Answer :

    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.

  69. IBM WAS Administration Interview Questions

  70. Question 43. What Information Can You Find In Sysibm.syslinks Table?

    Answer :

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

  71. Question 44. Where Would You Find Information About The Type Of Database Authority Held By The User?

    Answer :

    SYSIBM.SYSDBAUTH.

  72. Question 45. Where Could You Look If You Had A Question About Whether A Column Has Been Defined As An Index?

    Answer :

    This information can be found in SYSIBM.SYSINDEXES.

  73. Question 46. Once You Create A View, Where Would Information About The View Be Stored?

    Answer :

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

  74. Question 47. What Is The Sql Communications Area And What Are Some Of Its Key Fields?

    Answer :

    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.

  75. Question 48. Maxx Number Of Columns In A Db2 Table?

    Answer :

    224

  76. Question 49. Explain The Use Of The Where Clause?

    Answer :

    It directs DB2 to extract data from rows where the value of the column is the same as the current value of the host variable.

  77. Question 50. What Is A Foreign Key?

    Answer :

    It identifies a releated row in another table and establishes a logical relationship between rows in two tables.

  78. Question 51. What Technique Is Used To Retrieve Data From More Than One Table In A Single Sql Statement?

    Answer :

    The Join statement combines data from more that two tables.

  79. Question 52. What Is The Maximum Number Of Tables That Can Be Joined ?

    Answer :

    fifteen

  80. Question 53. What Are The Max. & Min. No. Of Partitions Allowed In A Partition Tablespace?

    Answer :

    minimum is 4.maximum is 64.

  81. Question 54. Name The Different Types Of Table Spaces?

    Answer :

    1. Simple Table Space2. Segmented Table Space and3. Partitioned Table Space

  82. Question 55. What Is The Maximum Number Of Tables That Can Be Stored On A Partitioned Table Space ?

    Answer :

    ONE

  83. Question 56. How Do You Declare A Host Variable (in Cobol) For An Attribute Named Emp-name Of Type Varchar(25) ?

    Answer :

    01 EMP-GRP. 49 E-LEN PIC S9(4) COMP. 49 E-NAME PIC X(25).

  84. Question 57. How To See The Structure Of Db2 Table?

    Answer :

    Using QMF.

  85. Question 58. What Is The Difference Between Where And Having Clause?

    Answer :

    WHERE is for Rows and HAVING is for Groups

  86. Question 59. What Does Dml Stand For And What Are Some Examples Of It?

    Answer :

    Data Manipulation Language. Some examples are SELECT, INSERT, DELETE, REPLACE.

  87. Question 60. In A Db2-cics Program Which Is Acts As Co-ordinator And Which Is Participant?

    Answer :

    DB2 – participant CICS- coordinator

  88. Question 61. How Do U Achieve Record Level Locking In Db2 Versions When Record Level Locking Is Not Allowed?

    Answer :

    By having the length of the record greater than that of a page!

  89. Question 62. What Are The Levels Of Isolation Available With Db2v4?

    Answer :

    CS RR UR( added new for DB2V4 which stands for uncommited read which allows to retreive records from the space which has exclusive locks also but data integrity will be affected if this option is used )The best available option for data integrity & data concurrency is CS.

  90. Question 63. What Is The Difference Between Type 1 Index & Type 2 Index?

    Answer :

    TYPE 1 & TYPE 2 are specified when an index is created on the table. TYPE 2 index is the option which comes with DB2V4. With TYPE 2 index data can be retreived faster as only the data pages are locked and not the index pages. Hence TYPE 2 index is recommended.

  91. Question 64. What Does Currentdata Option In Bind Indicate?

    Answer :

    CURRENTDATA option ensures block fetch while selecting rows from a table. In DB2V4 the default has been changed to NO. Therefore it is necessary to change all the bind cards with CURRENTDATA(YES) which is default in DB2V3 & earlier to CURRENTDATA(NO).

  92. Question 65. When Does The Sql Statement Gets Executed When You Use Cursor In The Application Programming ?

    Answer :

    sql statement gets executed when we open cursor.

  93. Question 66. What’s The Maximum Number Of Volumes That Can Be Added To A Stogroup?

    Answer :

    The answer is 133.Usually it will be difficult monitor more than 3 or 4 volumes to a Stogroup.

  94. Question 67. Can You Define An Index If The Table Size Less Than 10 Pages?

    Answer :

    NO

  95. Question 68. What’s The Percentage Free Space ?

    Answer :

    ZERO

  96. Question 69. What’s The Error Code For Unique Index Voilation?

    Answer :

    -803

  97. Question 70. What’s The Best Locksize That You Could Use When You Create A Tablespace?

    Answer :

    The answer is Locksize = ANY.Unless you are Sure what’s the Purpose of tablespace ie.,Read-only or R/W.If you use lock size =any, Db2 would automatically determine what type of locks it should use.

  98. Question 71. What Is The Size Of A Data Page?

    Answer :

    4K to 8K

  99. Question 72. Can All Users Have The Privilage To Use The Sql Statement Select * (dml)?

    Answer :

    NO THE USER SHOULD BE GRANTED PRIVILAGE TO USE IT.

  100. Question 73. The Only Place Of Vsam Ksds In Db2 Is?

    Answer :

    BSDS is a VSAM KSDS.

  101. Question 74. Max. No Of Rows Per Page?

    Answer :

    127

  102. Question 75. What Are The Functions Of Bind?

    Answer :

    BIND mainly performs two things syntax checking and authorization checking.It binds together all packages into an application plan hence the name BIND.Apart from this bind has optimiser as a subcomponent.Its function is to determine the optimum access strategy.

  103. Question 76. What Is A Corelated Subquerry?

    Answer :

    In a subquerry, if the outer querry reffers back to the outcome of innerquerry it is called corelated subquerry. That’s why the outer querry is evaluated first unlike an ordinary subquerry.

  104. Question 77. What Is The Difference Between Join And Union?

    Answer :

    join is used to retrive data from different tables using a single sql statement.union is used to combine the results of two or more sql querries.

  105. Question 78. When Can You Be Sure That A Query Will Return Only One Row?

    Answer :

    When you use the primary key and only the primary key in the where clause.

  106. Question 79. What Is The Name Of The Default Db2 Catalog Database?

    Answer :

    DSNDB06

  107. Question 80. What Should Be Specified Along With A Cursor In Order To Continue Updating Process After Commit?

    Answer :

    With Hold option.

  108. Question 81. What Is The Command Used By Tso Users To Invoke Db2?

    Answer :

    DSN RUN

  109. Question 82. B37 Abend During Spufi?

    Answer :

    The b37 abend in the spufi is because of space requirements , the query has resulted in so many rows that the spufi.out file is not large enough to handle it, increase the space allocation of spufi.out file.

  110. Question 83. How Many Bufferpools Are There In Db2 And What Are They?

    Answer :

    There are 4 Bufferpools.They are BP0,BP1,BP2 and BP32.

  111. Question 84. What Is Join And Different Types Of Join?

    Answer :

    The ability to join rows and combaine data from two or more tables is one of the most powerful features of relational system.Three type of joins:

    1. Equi-join
    2. Non-equijoin
    3. self-join.
  112. Question 85. How Many Subqueries Can You Combine Together ?

    Answer :

    Total 16 queries and subqueries are 15