Sunday, April 23, 2017

DB2 Frequently Asked Questions and Answers:Part 2(b)

DB2 Frequently Asked Questions and Answers:Part 2(b)


What is an intent lock?
An intent lock is at the table level for a segmented table space or at the table space level for a non segmented table space They indicate at the table or table space level the kinds of locks at lower levels.

What is the difference between Static and Dynamic SQL?
Static SQL is hard-coded in a program when the programmer knows the statements to be executed For dynamic SQL the program must dynamically allocate memory to receive the query results.

What is cursor stability?
Cursor stability means that DB2 takes a lock on the page the cursor is accessing and releases the lock when the cursor moves to another page.

What is the significance of the CURSOR WITH HOLD clause in a cursor declaration?
The clause avoids closing the cursor and repositioning it to the last row processed when the cursor is reopened.

What is the SQL Communications Area and what are some of its key fields?
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.

What is the purpose of the WHENEVER statement?
The WHENEVER statement is coded once in the host program to control program actions depending on the SQL-CODE returned by each SQL statement within the program.

What is DCLGEN?
A DCLGEN stands for declarations generator; it is a facility to generate DB2 SQL data structures in COBOL or PL/1 programs.

What is the FREE command?
The FREE command can be used to delete plans and/or packages no longer Needed.

DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join Explain the differences.
A merge join requires that the tables being joined be in a sequence; the rows are retrieved with a high cluster ratio index or are sorted by DB2 A nested join does not require a sequence and works best on joining a small number of rows DB2 reads the outer table values and each time scans the inner table for matches The hybrid join is a nested join that requires the outer table be in sequence.

Compare a sub select to a join.
Any sub select can be rewritten as a join, but not vice versa Joins are usually more efficient as join rows can be returned immediately, sub selects require a temporary work area for inner selects results while processing the outer select.

What is the difference between IN sub selects and EXISTS sub select?
If there is an index on the attributes tested an IN is more efficient since DB2 uses the index for the IN (IN for index is the mnemonic).

What is a Cartesian product?
A Cartesian product results from a faulty query It is a row in the results for every combination in the join tables.

What is the difference between a package and a plan?
How does one bind 2 versions of a CICS transaction with the same module name in two different CICS regions that share the same DB2 subsystem?
Package and plan are usually used synonymously as in this site Both contain optimized code for SQL statements - a package for a single program, module or subroutine contained in the data base request module (DBRM) library A plan may contain multiple packages and pointers to packages The one CICS module would then exist in a package that could be referenced in two different plans.

What is an asychronous write?
It is a write to disk that may occur before or long after a commit The write is controlled by the buffer manager.

What is a lock?
A lock is the mechanism that controls access to data pages and table spaces.

What is meant by isolation level?
This is a key concept for any relational database Isolation level is the manner in which locks are applied and released during a transaction For DB2 a 'repeatable read' holds all locks until the Transaction completes or a sync point is issued. For transactions using 'cursor stability' the page lock releases are issued as the cursor 'moves', ie as the transaction releases address ability to the records.

Jobs in india

IT / Software Jobs,Core Technical Jobs, Government Jobs,Defence Jobs,Research Jobs,BPO Jobs,Bank Jobs, Tech Support Jobs,Health Care Job...