how to compress a db2diag file
How to compress and create a new db2diag.log
If you need to compress the db2diag and create a new one follow the steps below:
1- Finding the db2diag.log path
at the prompting command type:
db2 get dbm cfg | grep -i diag
You will see something like this:
server :# db2 get dbm cfg | grep -i diag
Diagnostic error capture level (DIAGLEVEL) = 3
Diagnostic data directory path (DIAGPATH) = /db2/instance1/sqllib/db2dump
2 - Going to db2diag.log path
at the promptig command type:
cd /db2/instance1/sqllib/db2dump
ls - ltr | grep -i diag
You will see something like this:
-rw-r----- 1 sample db2iadm1 6291344 Mar 11 16:30 db2eventlog.000.crash
-rw-rw-rw- 1 sample db2iadm1 19745333 Apr 07 15:53 db2diag.log.old.gz
-rw-rw-rw- 1 sample db2iadm1 19580 Apr 23 06:50 sample.nfy
-rw-r----- 1 sample db2iadm1 6291344 Jun 23 23:41 db2eventlog.000
-rw-r--r-- 1 sample db2iadm1 688961095 Jun 23 23:53 db2diag.log
3 - Creating a new one db2diag.log
at the prompting command type:
db2diag -A
You will see something like this:
/usr/local/db2/sample/sqllib/db2dump>db2diag -A
db2diag: Moving "/usr/local/db2/sample/sqllib/db2dump/db2diag.log" to "/usr/local/db2/sample/sqllib/db2dump/db2diag.log_2008-06-24-21.13.31"
4- Compressing the old db2diag.log
at the prompting command type:
compress db2diag.log