Viewing log files

In general, there are two categories of Db2 or Db2 Warehouse log files, container logs and Db2 or Db2 Warehouse diagnostic logs.

Procedure

  1. To view Db2 or Db2 Warehouse container log files, do the following:
    1. Get the names of all Db2 or Db2 Warehouse database service pods:
      kubectl -n <namespace> get po --selector type=engine
    2. Use kubectl logs to view the Db2 or Db2 Warehouse database container logs:
      kubectl -n <namespace> logs <Db2 engine POD name> | more -
  2. To view Db2 or Db2 Warehouse diagnostic log files, do the following:
    1. Exec into the Db2 pod.
    2. Go to the Db2 or Db2 Warehouse diagnostic logs folder /mnt/blumeta0/db2/log/.
      Tip: The OS environment variable DIAGPATH defines the Db2 or Db2 Warehouse diagnostic logs folder.
    3. Sort all the db2diag.*.log files by timestamp and view/tail the most recent one:
      ls -latr ${DIAGPATH}/NODE0000/db2diag.*.log