After installation of the database, the system will maintain all logs under the database instance folder (Usuallly it is C:\DB2).
After installing more than one database it is recommended to group all these logs in one folder per database.
Follow below steps to organize your database log.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Connect to the database console | |
db2cmd | |
-- Set the current instance | |
set DB2INSTANCE=DB2 | |
-- Connect to the database | |
db2 connect to maxdb76 | |
-- Create folder to host all logs example here (C:\LOG\LOG_MAXDB76) | |
-- Create 5 folder for all log types (logarchmeth1 - logarchmeth2 - failarchpath - logpath - mirrorlogpath) | |
-- 8192 bytes is the size of the log file | |
-- 20 is the number of primary log files (pre allocated) | |
-- 100 is the number of secondary log files (allocated once is needed from the database) | |
UPDATE DATABASE CONFIGURATION USING logarchmeth1 "DISK:C:\DB2\LOG\LOG_MAXDB76\logarchmeth1" | |
logarchmeth2 "DISK:C:\DB2\LOG\LOG_MAXDB76\logarchmeth2" failarchpath "C:\DB2\LOG\LOG_MAXDB76\failarchpath" | |
newlogpath "C:\DB2\LOG\LOG_MAXDB76\logpath" mirrorlogpath "C:\DB2\LOG\LOG_MAXDB76\mirrorlogpath" | |
logprimary 20 logsecond 100 logfilsiz 8192 LOGINDEXBUILD OFF | |
-- Restart the database | |
db2stop force | |
db2start |
0 comments:
Post a Comment