DB2 ⭐ Featured
👁 0

Q: How to handle restrictive states?

Answer:
COPY PENDING needs image copy. CHECK PENDING needs CHECK DATA. REBUILD PENDING needs REBUILD INDEX. REORG PENDING needs REORG. RECOVER PENDING needs RECOVER. Use -DISPLAY DATABASE to see status.
DB2 ⭐ Featured
👁 0

Q: How to alter table structure?

Answer:
ALTER TABLE name ADD COLUMN col type. ALTER TABLE name DROP COLUMN col. ALTER TABLE name ALTER COLUMN col SET DATA TYPE. Some changes need REORG. Adding columns easy; changes may need unload/reload.
DB2 ⭐ Featured
👁 0

Q: What is tablespace?

Answer:
Tablespace is storage container for tables. CREATE TABLESPACE name IN database USING STOGROUP. Contains one or more tables. Segmented/universal tablespace types. Management at tablespace level (REORG, COPY, RECOVER).
VSAM ⭐ Featured
👁 0

Q: What is RBA?

Answer:
RBA (Relative Byte Address) is byte offset from dataset start. ESDS uses RBA for access. KSDS index points to RBA. Changed by REORG. Use key for KSDS, RBA only when necessary.
VSAM ⭐ Featured
👁 0

Q: How to reorganize VSAM?

Answer:
REPRO out then back: REPRO to sequential, DELETE cluster, DEFINE new cluster, REPRO back. Alternatively, IDCAMS export/import. Reclaims space, restores free space distribution. Schedule regularly.
VSAM ⭐ Featured
👁 0

Q: How to extend VSAM file?

Answer:
ALTER ds.name ADDVOLUMES(vol). Or secondary allocation triggers extension. RECORDS/CYLINDERS secondary amount. Up to 255 extents per volume. May need to reorganize if fragmented.
VSAM ⭐ Featured
👁 0

Q: What is HURBA?

Answer:
HURBA (High Used RBA) marks end of data. Records beyond HURBA are unused space. LISTCAT shows HURBA. Grows as records added. REORG resets to eliminate gaps in ESDS.
VSAM ⭐ Featured
👁 0

Q: How to improve KSDS performance?

Answer:
Appropriate CISIZE, FREESPACE. Adequate buffers (BUFND/BUFNI). Index in cache if possible. IMBED obsolete. Keep file organized (REORG). Monitor CA/CI splits. Sequential access for bulk.
VSAM ⭐ Featured
👁 0

Q: What is FREESPACE distribution?

Answer:
FREESPACE spread across CIs and CAs. Initial load distributes evenly. After activity, distribution varies. REORG restores even distribution. Monitor CI/CA splits for tuning.
DB2 ⭐ Featured
👁 0

Q: How does REORG work?

Answer:
REORG physically reorganizes tablespace or index. Eliminates fragmentation, reclaims space, restores clustering. REORG TABLESPACE db.ts. Options: SHRLEVEL (REFERENCE/CHANGE), LOG (YES/NO). Schedule during low activity. Run RUNSTATS after.
DB2 ⭐ Featured
👁 0

Q: How to handle -904 SQLCODE?

Answer:
-904 is resource unavailable. Tablespace/index in restricted state, stopped, or unavailable. Check display status. May need START DATABASE command. Check for REORG, RECOVER, LOAD running. Wait and retry.
DB2 ⭐ Featured
👁 0

Q: What is clustered index?

Answer:
Clustered index determines physical row order. Only one per table. Other indexes are secondary. CLUSTER keyword on CREATE INDEX. Good for range queries on cluster key. REORG restores clustering after updates.
DB2
👁 0

Q: What is table compression?

Answer:
Compression reduces storage. Huffman encoding in dictionary. CREATE TABLE ... COMPRESS YES. REORG to compress existing. CPU trade-off for I/O savings. Good for read-heavy, large tables.