GeekInterview.com
Series: Subject: Topic:

DB2 Interview Questions

Showing Questions 1 - 20 of 206 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

What is the difference between package and plan?

Asked By: priya | Asked On: Jun 21st, 2007

Answered by: Mandar Dindorkar on: Jul 27th, 2012

the difference is that a Package is at a more granular level. If a module is bound to a Package, any change in module requires only the Package to be re-bound, without the necessity to re-bind the ent...

Answered by: sam117 on: Dec 25th, 2009

Package can be bound for single DBRM only. Plan can contain both DBRM and Packages. Packaqes can't be executed until they are bound into a plan. 

How do you improve db2 SQL performance?

Asked By: Anilsodadasi | Asked On: Apr 25th, 2007

Answered by: Mandar Dindorkar on: Jul 27th, 2012

a

Answered by: kalone on: Feb 1st, 2010

To improve the performance following are some of the tips :

1. Always use FOR UPDATE OF when updating with a cursor.
2. Use WHERE CURRENT OF to delete a single row.
3. Check the SQLCODE after each SQL statemnt.
4. Avoid using WHENEVER.

Db2 control structure

Asked By: radibioinfo | Asked On: Oct 4th, 2007

A control structure used by db2 to communicate with the application program isa.Address spaceb.Authidc.Threadd.Viewe.String thread

Answered by: Mandar Dindorkar on: Jul 27th, 2012

SQLCA or SQL Communication area (136 bytes) is used by DB2 to communicate with the Program

Answered by: yuvaevergreen on: Mar 26th, 2010

c. Thread

Difference between embedded SQL and dynamic SQL?

Asked By: krishna | Asked On: Jun 24th, 2006

Answered by: Mandar Dindorkar on: Jul 27th, 2012

Embedded SQL -> Access Path is generated during BIND time. also table authorizations are checked during BIND (if VALIDATE(BIND) is used).

Dynamic SQL => Access path is generated during Run-time. Table authorizations can only be checked during run-time.

Answered by: kalone on: Feb 1st, 2010

STATIC sql(embedded) : It is hardcoded in the program itself and the changeable                   &n...

Db2 cursor declaration

Asked By: radibioinfo | Asked On: Oct 4th, 2007

The cursor can be declared in working storage sectionlinkage sectioninput-output section. working storage section

Answered by: Mandar Dindorkar on: Jul 27th, 2012

Cursor Declaration can be done either in WORKING STORAGE SECTION in DATA DIVISION or in PROCEDURE DIVISION, the only rule is that it has to be coded before the OPEN CURSOR statement in the Procedure Division.

Answered by: kalone on: Jan 31st, 2010

Correct ans is WORKING STORAGE section

If SQL return -805 , what will user want to do

Asked By: sprabodhini | Asked On: May 7th, 2008

Answered by: Mandar Dindorkar on: Jul 27th, 2012

-805 will never occur if a DBRM is directly bound to a PLAN. -805 occurs when 1) Source Program is changed and per-compiled and new LOAD Module created as a result of change is used at Run time, but ...

Answered by: jzmoonrock56 on: Aug 31st, 2011

Rebind the plan.

What is a db2 access path?

Asked By: Interview Candidate | Asked On: Oct 13th, 2004

An access path is the method used to access data specified in db2 SQL statements.

Answered by: Mandar Dindorkar on: Jul 27th, 2012

DB2 Access path is (in most cases) the path which results in the most optimized execution of an SQL query. Whenever any Static SQL (Embedded SQL) is bound to a package/plan, the DB2 optimizer creates...

Answered by: jzmoonrock56 on: Aug 31st, 2011

The access path is determined by DB2 during the bind process. This determines what indexes will be used.

What is check pending and copy pending status in db2, how do you resolve it?

Asked By: Shivanand madhabavi | Asked On: Sep 14th, 2006

Answered by: Mandar Dindorkar on: Jul 27th, 2012

Check Pending is when you have data added to the table using either insert or LOAD utility which violate table check constraints. The IBM DB2 LOAD UTILITY has ENFORCE CONSTRAINTS and similar options w...

Answered by: Mohit on: May 28th, 2012

SET INTEGRITY Option....please read IBM libraries before using this.

Bind parameters

Asked By: bhima123 | Asked On: Oct 28th, 2010

What are the important bind parameters to be used in bind card? What is the significance of each parameter?

Answered by: Mandar Dindorkar on: Jul 27th, 2012

I will say the Answer Depends barring a few parameters which are mostly used. 1) ISOLATION -> Isolation Level to decide level of locking used along with LOCK parameters on the DB2 objects. 2) ACQUI...

Answered by: jzmoonrock56 on: Aug 31st, 2011

The bind parameters are generally generic the most important is isolation level which is always CS and sometimes UR if you want to rock right thru.

What is lock contention?

Asked By: Interview Candidate | Asked On: Oct 13th, 2004

To maintain the integrity of db2 objects the dbd permits access to only on object at a time. Lock contention happens if several objects are required by contending application processes simultaneously.

Answered by: Sandhya.Kishan on: Jul 9th, 2012

Lock contention are used for maintaining concurrency in the DB2® environment.There are several types of contention situations that degrade DB2 performance, including suspension, timeout, and deadlock.
Begin program-specific programming interface information.

What is the self-referencing constraint?

Asked By: Interview Candidate | Asked On: Oct 13th, 2004

A31. The self-referencing constraint limits in a single table the changes to a primary key that the related foreign key defines. The foreign key in a self referencing table must specify the delete cascade rule.

Answered by: Sandhya.Kishan on: Jul 9th, 2012

Self-referencing constraint makes the table both the parent and dependent table in the same referential constraint.
Here the table is created first and then the foreign key is defined to that table.

How does db2 use multiple table indexes?

Asked By: Interview Candidate | Asked On: Oct 13th, 2004

Db2 use the multiple indexes to satisfy multiple predicates in a select statement that are joined by an and or or.

Answered by: Sandhya.Kishan on: Jul 9th, 2012

By using the concept of list prefetch DB2 uses multiple index processing.I is used to satisfy multiple predicates in a select statement that are joined by an AND or OR.

What is a root page?

Asked By: Interview Candidate | Asked On: Oct 13th, 2004

The opposite of a leaf page; it is the highest level index page. An index can contain only the one root page; all other index pages are associated to the root.

Answered by: Sandhya.Kishan on: Jul 9th, 2012

The indexes of DB2 are represented using b-tree,the b-trees top page is called as the root page.The root page entries represent the upper range limits of the index and are referenced first in a search.

What is an asynchronous write?

Asked By: Interview Candidate | Asked On: Oct 13th, 2004

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

Answered by: krsna on: Jun 7th, 2012

Asynchronous write is when the pages from bufferpool is written to disk by the page cleaners.

Answered by: Sandhya.Kishan on: Apr 6th, 2012

Asynchronous write is a function where the the function call immediately returns after the operation was enqueued or if before this happens an error was encountered.This function is present in "aio.h"...

How many rows will the query return ?

Asked By: radibioinfo | Asked On: Oct 4th, 2007

Table1 has 6 rows and table2 has 6 select * from table1, table2; a.6b.12c.36d.720e.Cannot sayrows.36

Answered by: Priya on: May 29th, 2012

This will yield to a correlated subquery return in SQL which will be each combination of record from the first table to second table. Which will be 6*6 = 36.

Answered by: santhosh on: Jan 6th, 2012

Ans: a. 6

How can you split db2 table in to exactly half?

Asked By: vardhan.frd | Asked On: Jan 6th, 2012

Can we divide it row wise or col wise.?Is there any query for this.?

Answered by: Mohit on: May 28th, 2012

You can table partitioning feature

How do you display last 5 records in db2?

Asked By: chhavis928 | Asked On: Aug 25th, 2011

Answered by: Mohit on: May 28th, 2012

There is nothing called "fetch last n records only" in db2...

You can use select col1 from table1 order by col1 desc fetch first 5 records only

Answered by: satyanarayana on: Jan 17th, 2012

First sort the records by using order by clause and then issue the following query

Code
  1. SELECT * FROM tablename fetch first 5 rows only;

Then it will give the last five records of the table

The hex form 102d... What is the actual value for this?

Asked By: praveen_s | Asked On: Apr 18th, 2012

Answered by: shiv on: May 7th, 2012

4141... in decimal

Can we use sum function on alphanumeric column ?

Asked By: praveen_s | Asked On: Apr 18th, 2012

Answered by: daniel.epps on: Apr 19th, 2012

yes

Db2 indexes

Asked By: radibioinfo | Asked On: Oct 4th, 2007

I ) unique index can be created only on primary key. Ii) query will execute faster if predicates are applied on indexed column. 1 both are true2 i) is only true3 ii) is only true4 neither is true

Answered by: padmanabha on: Feb 2nd, 2012

Answer is 1 Both are True.

Answered by: yuvaevergreen on: Mar 26th, 2010

ii) is Only True
Unique indexes can be created on any column.

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.