01. In EMP, the BONUS column is nullable. A report must show 0 for every employee whose BONUS is null, and the actual bonus for everyone else.
Which two expressions return 0 when BONUS is null?
(Choose two.)
a) CASE WHEN BONUS = 0 THEN 0 ELSE BONUS END
b) NULLIF(BONUS, 0)
c) BONUS * 0
d) COALESCE(BONUS, 0)
e) VALUE(BONUS, 0)
02. How do the real-time statistics in SYSIBM.SYSTABLESPACESTATS and SYSIBM.SYSINDEXSPACESTATS differ from the statistics that RUNSTATS collects?
a) They are written to SMF or GTF by the statistics trace and must be loaded into tables before use
b) Db2 maintains them continuously as data changes, and they help decide when to run REORG, COPY or RUNSTATS
c) They are gathered only when RUNSTATS runs, and they replace the catalog statistics the optimizer uses
d) They are held only in memory and are lost each time Db2 stops
03. Two online programs both update the ORDERS and ORDER_ITEM tables, and they deadlock with each other several times an hour. One program updates ORDERS first and the other updates ORDER_ITEM first, and each runs many updates before it commits.
Which two application changes reduce the deadlocks?
(Choose two.)
a) Raise the lock timeout interval so programs wait longer for locks
b) Rebind both programs with ISOLATION(RR) so rows stay locked
c) Update the two tables in the same order in both programs
d) Commit sooner, so each unit of work holds its locks for less time
04. After lock waits, program PGMA receives SQLCODE -911 and program PGMB receives SQLCODE -913. Neither program has issued COMMIT or ROLLBACK since.
Which statement describes their units of work?
a) Both units of work are still pending, and each program must decide whether to roll back or retry
b) PGMB's work was rolled back; PGMA's is still pending and PGMA must roll back or retry
c) Both units of work were rolled back by Db2, so each program can simply rerun its failed statement
d) PGMA's work was rolled back; PGMB's is still pending and PGMB must roll back or retry
05. Plan PAYPLAN has the package list PAYCOLL.*. A new program fails on its first SQL statement with SQLCODE -805. SYSIBM.SYSPACKAGE shows the program's package only in collection PAYTEST, with a consistency token that matches the load module. Site standards do not allow the plan's package list to change.
What resolves the failure?
a) Bind the package into PAYCOLL
b) Grant EXECUTE on plan PAYPLAN to the job's user
c) Precompile, compile and link-edit the program again
d) Rebind the existing package in collection PAYTEST
06. Online transactions against a small, heavily updated table space defined with LOCKSIZE PAGE often wait for page locks held by other transactions that are updating different rows on the same page.
Which change reduces these waits, and what is its trade-off?
a) Change to LOCKSIZE TABLESPACE; fewer locks are held, so the waits disappear
b) Set LOCKMAX 0; escalation is disabled, so the page lock waits stop
c) Change to LOCKSIZE ROW; waits drop, but Db2 manages many more locks and uses more CPU
d) Rebind with ISOLATION(RR); rows are locked only while being read
07. An application inserts customers through the view CUST_V, which joins CUSTOMER and ADDRESS. Because of the join, the view is read-only and Db2 rejects the INSERT.
What lets the INSERT through CUST_V succeed without changing the application?
a) Re-create CUST_V with WITH CHECK OPTION
b) Create an alias for CUST_V and target the alias
c) Create an AFTER INSERT trigger on CUSTOMER that inserts the ADDRESS row
d) Create an INSTEAD OF INSERT trigger on CUST_V that inserts into CUSTOMER and ADDRESS
08. No accounting trace is active on a Db2 subsystem. A DBA needs to begin collecting accounting data now, without restarting Db2. Which command does this?
a) -MODIFY TRACE(ACCTG)
b) -DISPLAY TRACE(ACCTG)
c) -START TRACE(ACCTG)
d) -STOP TRACE(ACCTG)
09. Why is the Db2 performance trace normally started only for a short period and for selected classes?
a) It records the most detailed data and has the highest processing overhead
b) Db2 must be restarted before the trace can be stopped
c) It can write only to GTF, and GTF must be restarted each time the performance trace is started
d) It stops the accounting and statistics traces while it runs
10. For a query on one table, the PLAN_TABLE row shows ACCESSTYPE = 'R' and PREFETCH = 'S'. What does the PREFETCH value indicate?
a) Db2 planned a sort of the result rows in a work file
b) Db2 planned sequential prefetch, reading ahead groups of consecutive pages before they are needed
c) Db2 chooses at run time whether to read ahead, from the pattern it sees
d) Db2 planned list prefetch, reading pages in sorted RID order