Db2 Interview Questions And Answers

db2 interview questions and answers   Top 25 Db2 Interview Questions And Answers

1) What is DB2?

DB2 is a Relational Database Management System (RDBMS) which is used to store, analyze and retrieve the data efficiently. It supports Object Oriented features.


2) Who has developed DB2?

IBM had developed DB2 product


3) What is DB2 Instance?

It is a logical environment for DB2 Database Manager.


4) What are the contents of Instance directory in DB2?

The contents of Instance directory are:

● Database Manager Configuration file
● System Database Directory
● Node Directory
● Node Configuration File [db2nodes.cfg]
● Debugging files, dump files


5) What is the default instance of DB2 database server?

For DB2 Database Server, the default instance is ''DB2''.


6) In DB2 how can we list the instance?

Here is the command which is used to list the instance.

db2ilist


7) How can we start or stop the database manager of an instance in DB2?

Here is the command which is used to start or stop the database manager of an instance in DB2.

set db2instance=<instance_name> 


8) How can we start the instance in DB2?

Here is the command which is used to start the instance.

db2start


9) How can we stop the instance in DB2?

Here is the command which is used to stop the instance.

db2stop


10) How we can create a new instance in DB2?

Here is the command which is used to create new instance.

db2icrt


11) How we can update an instance in DB2?

Here is the command which is used to update an instance:

db2iupdt <inst_name>


12) How we can drop an instance in DB2?

Here is the command which is used to drop an instance:

db2idrop -u <inst_username> <inst_name><inst_name>


13) What is database directory in DB2?

It is an organized repository of databases. It contains all the details about default storage devices, configuration files, and temporary tables list etc.


14) What is Partitioned global directory in DB2?

It is the directory which contains all the global information related to database. This partition global directory is named as NODExxxx/SQLyyy, where xxxx is the data partition number and yyy is the database token.

The partition-global directory contains database related files as listed below.

● Table space information files [SQLSPCS.1, SQLSPCS.2]
● Storage group control files [SQLSGF.1, SQLSGF.2]
● Temporary table space container files.
● Global deadlock write-to-file event monitoring files
● Global Configuration file [SQLDBCONF]
● Locking files [SQLINSLK, SQLTMPLK]
● History files [DB2RHIST.ASC, DB2RHIST.BAK, DB2TSCHG.HIS, DB2TSCHG.HIS]
● Logging-related files [SQLOGCTL.GLFH.1, SQLOGCTL.GLFH.2]
● Automatic Storage containers


15) How to create a non-restrictive database in DB2?

Here is the command which is used to create a non-restrictive database in DB2:

db2 create database <database name>


16) How to create a restrictive database in DB2?

Here is the command which is used to create a restrictive database in DB2:

db2 create database <db_name> restrictive 


17) How to view system database directory files in DB2?

Here is the command which is used to view system database directory files in DB2:

db2 list database directory 


18) How to activate database in DB2?

Here is the command which is used to activate database in DB2:

db2 activate db <db_name>


19) How to deactivate database in DB2?

Here is the command which is used to deactivate database in DB2:

db2 deactivate db <db_name>


20) How to verify if database is restrictive or not in DB2?

Here is the command which is used to verify this:

db2 get db cfg for <db_name> | grep -i restrict 


21) How to configure database manager in DB2?

Here is the command which is used to verify this:

db2 get database manager configuration 
or
db2 get dbm cfg 


22) How to reset previous configurations in DB2?

Here is the command which is used to verify this:

db2 reset database manager configuration 


23) Hot to get the information of Database in DB2?

Here is the command which is used to verify this:

db2 get database configuration 


24) How to update the database configuration in DB2?

Here is the command which is used to verify this:

db2 update database configuration


25) How to drop database in DB2?

Here is the command which is used to verify this:

db2 drop database <db_name>