Updating the log path in DB2


Sometimes after a database has been created, you may want to move where the default log path is. DB2 places the log path in the home directory, and you may want to have the logs stored on another storage device.

Login as the DB2 adminstrative user, then type the following command to change your log path:

> db2 UPDATE DB CFG FOR MyDB USING NEWLOGPATH /db2data/AnyDirectory/NODE0000/logdir

Stop and restart DB2 (db2stop force and db2start) and the your new log path will now be active.