Changing DB2 Database logging methods
Piyush Chordia 2700021NT6 Visits (6882)
DB2 databases can be configured for different logging mechanisms like circular and archival logging. These mechanisms can be changed for a database at any point after the database is created. By default while creating a database in IBM DB2, db logging method is set to "Circular" logging which is generally not used in production environments. Archival logging is the recommend logging type for DB2 databases, since with this type of logging, one can recover/restore the database to a specific point in time or to the end of logs.
As you can see the clear difference between Circular and Archive logging types. Circular logging provides automatic log file management ( DB2 application will never run out of log space ). Below table mentions the pros and cons.
Once done no need to enable scheduling at next step. Just click next and then verify the changes in last step before clicking the finish button.
CONNECT TO TC2;
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
UPDATE DB CFG FOR TC2 USING logarchmeth1 "DISK:c:\ibm" logprimary 15 logsecond 4 logfilsiz 1024;
BACKUP DATABASE TC2 TO "C:\IBM" WITH 2 BUFFERS BUFFER 9 PARALLELISM 1 WITHOUT PROMPTING;
Note: Either run each above command after typing db2 on the db2cmd command prompt or copy the above code into a text file and save it as a .sql file. On windows run:
db2cmd /c /w db2 -v -tf "<full path to the .sql file>"
On linux login on to the machine with the required instance username,password and then run:
sh -c db2 -v -tf "<full path to the .sql file>"