You are on page 1of 4

DB2 LUW DBA Candidate Interview Question Sampler Here is an outline of questions and topics I recently prepared for

interviewing new candidates for my current client. Besides these questions, I would also be l ooking for the following qualities in a strong candidate: Strong English language skills Can describe a documentation philosophy and has some writing samples Good face-to-face communication skills and easy-going personality Proactivity, doesn t wait for someone to tell her what to do Creative/hacking approach to database problems, especially if you want a per formance specialist. A geek with outside technical interests is ideal. Someone with a background in database development and some years in at least one non-database programming language; someone who can understand development c hallenges. The Interview Outline DB2 Process and Memory Model What is the difference between an Application and an Agent? How can you see physical memory (core) utilization by a Unix DB2 server? (db 2mtrk) What is the memory used by sorts? (SORTHEAP) What is the difference between the DB2 host (machine), the instance, and the database? Tell us something about DB2 memory structure (root is Instance shared memory , below that is Database shared memory; within each Database there is Applicatio n Group shared memory, then each Agent has private memory). How do we control or influence the allocation of these memory sets? (by settings in DB and DBM CFG, creation and configuration of bufferpools) Configuration down to Database Level What command allows me to see all instances set up on a host? ( db2ilist ) What command lets me see databases defined on an instance that I am attached to? (db2 list database directory) How can I see what the DB2 registry variables are? ( db2set -all) What will show me instance configuration? (db2 get dbm cfg) What will show me database configuration? (db2 get db cfg for <dbname>) What are the some of the scopes of configuration starting at the network as a whole, and working down to the database (not including objects within the data base), that can affect non-partitioned DB2? Try to get as many as possible. Coul d include: A. Network configuration including ODBC configuration of DB2 clients and con figuration of DB2 Connect gateway machines B. C. D. Backup server and monitor server configuration. Cluster configuration OS kernel configuration;

E. Server physical and swap (virtual) memory, disk storage (amount and type ), and number and type of processors F. G. DB2 registry (db2set -all) Instance configuration (GET DBM CFG)

H. I. J. Backup

Node catalog (IP address and port) Database catalog Database configuration (GET DB CFG)

NetBackup familiarity? What are the differences between offline and online backup? What are the adv antages and disadvantages of each? When first setting up and then later maintaining a database, what would be y our main concerns with backup? (backups are successful, they can be retrieved, b eing retained for correct number of days, logs are being archived, backups are n ot interfering with time slots for other important processes) How can you learn more about a backup that was done five days ago? (command LIST HISTORY) Restore Redirected Restore describe the basic steps required. What do you need to restore DB2 to a point in time? Logging What are the kinds of logging? (circular, archival) When would you use one kind of logging and not another? What kind of maintenance needs to be done with logs? What database configuration parameter establishes the minimum number of logs ? (LOGPRIMARY) Starting and stopping DB2 How would you stop DB2 if db2stop did not work? (db2_kill, ipclean). If db2start is taking a long time, what should you do? (determine the cause by tail db2diag.log) If db2start is taking a long time to complete, why might that be? (disaster log recovery) How can you determine that the DB2 engine is running? (attempt connect, chec k ps -ef for process db2sysc) Space Organization Describe the kinds of tablespaces. (SMS and DMS physical organization types; and object types REGULAR, LARGE, SYSTEM TEMPORARY, USER TEMPORARY) What relationship does type of tablespace have to backup? (only DMS allows o nline tablespace level backups) Where can Large Objects (LOB) reside? (in LARGE tablespaces) What is the relationship between tablespace and bufferpool? (every tablespac e can have only one bufferpool, bufferpool must have the same page size as table space) How can you determine the amount of space utilized on the filesystems of a U nix host? (df) Unix Before I can do work within an instance, what must be done? (Answer: attach to the instance, generally by setting the value of environment variable DB2INSTA NCE in your .profile by running the db2profile script ; or change instance via t

he command db2 attach to <instance name> ) What are some common DB2 command-line options, and what do they do? (e.g. vm stat, sar, vi, iostat, uname). How might you use a Unix utility to streamline or automate your work? (awk, sed, grep). What common Unix/Solaris commands would you use to query the state of the da tabase host? (last reboot, vmstat, sar) How do you copy a line and paste to another location in vi? ( escape y to ya nk, escape p to paste ) High Availability What kind of high availability environment do you have experience with? If S olaris Cluster, ask relevant questions. Windows Which Windows utilities would you use to do your job? (name ftp client, teln et client, db2 windows client, editor) Are you familiar with Wiki s for documentation? How do you document your work? Performance Describe operating system metrics you would check for performance problems, and what numbers might indicate a problem. (CPU user % 99-100 can indicate a tab le scan is occurring) Describe the main database performance and troubleshooting tools (db2diag.lo g, instance.nfy, SNAPSHOT, EVENT MONITOR) Tell us more about what data elements you might look at in a snapshot How can I tell that a bufferpool might be too small? (hit ratio below 98%, t hough some applications might not improve with a larger bufferpool; experiment t hrough incremental bufferpool changes) Describe performance numbers or calculations that can indicate database perf ormance is not optimal (e.g. hit ratios, sort time or number sorts, high SQL exe cution time, high number of rows read on a specific table indicating tablescan) SQL How to see the access plan for SQL? (db2expln, EXPLAIN) What are the two ways that an application can submit SQL? (dynamic and stati c) Describe a left outer join, when would it be used? How can you make sure you only return 10 rows? (clause FETCH FIRST 10 ROWS O NLY) If I make a change (such as create index) that can improve the performance o f SQL, what do I have to do to make sure the performance change takes effect? (m ake sure statistics are current via RUNSTATS after the index was created/dropped ; for static SQL do a rebind; for dynamic SQL, FLUSH PACKAGE CACHE DYNAMIC). What is the shortest way to show the current database timestamp on DB2 comma nd line ( db2 values(current timestamp) ). Describe a correlated subquery. What is a common table? Can I view dynamic SQL that has been run in the database in the past? (YES i f it is still in dynamic package cache). How can I view the SQL that is still in dynamic package cache? (GET SNAPSHOT FOR DYNAMIC SQL ON <dbname>) Tables. Columns and Indexes Describe the kinds of table-related maintenance you might expect to do (reor g, runstats, table snapshot for unusual read/write activity, reorgchk).

What is a reorg? For standard maintenance how would you use runstats and reorgs? (such as how often) If a table was constantly busy, how could you run runstats and reorgs, o r would you? Describe two ways to create a primary key. Describe the components of a table that are needed to establish referential integrity between two tables. How to easily assign an incremented an unique value to a column? (define it IDENTITY) (also used triggers with SEQUENCE objects) What command shows me the structure of a table? (DESCRIBE TABLE <tabschema>. <tabname>) What is a quick way to see the indexes for a table? (DESCRIBE INDEXES FOR TA BLE <tabschema>.<tabname>) Process concurrency How can you detect a problem with table locking? (table or database snapshot high lock wait times, high number locks, high exclusive lock escalations). How can you see all the connected processes running against the database? (D B2 LIST APPLICATIONS) How to see utilities that are running? (DB2 LIST UTILITIES, I think this is version 9 or 8.2 at the earliest) How can I see more detail if I suspect that there is a locking related perfo rmance issue? (run GET SNAPSHOT FOR LOCKS) If two or more processes are holding locks the other one needs and also wait ing for a lock held by the other what is that called? (deadlock) What is another name for a transaction and what is it? (Unit of Work or UOW; database work that gets done between COMMIT). How can transaction design affect performance? (Until a COMMIT is taken tabl e locks are retained, which can prevent other concurrent processes from accessin g the table resulting in lock wait)

You might also like