Note that even though I said that there is one transaction log per database in any DBMS (including DB2 ) then this transaction-log (logtream) is often divided physically in to multiple files for speed and "easy" log-management.
Configurations of the size of each physical logfile and how many logfiles should be created physically on disk by default and in continuous fashion should be configured and sized according to how big the workload will be and should be big enough to handle multiple simultaneous UOW of any size.
In DB2 you can have up to 256 primary logfiles allocated on disk and infinate secondary logfiles ( locsecond = -1 ). However that needs some configuration on archiving methods and overflow storage configurations.
Otherwise logprimary+logsecond <= 256 logfiles.
See here for further info and those links that NerdsOfTech provided. Logfilz is the size of each logfile and should be big enough as I said to store multiple logrecords and multiple simultaneous UOW.
Regards,
Tomas Helgi
marrowyung
ASKER
"Note that even though I said that there is one transaction log per database in any DBMS (including DB2 ) then this transaction-log (logtream) is often divided physically in to multiple files for speed and "easy" log-management. "
in MySQL it is not . please correct me if I am wrong.
"In DB2 you can have up to 256 primary logfiles allocated on disk and infinate secondary logfiles ( locsecond = -1 ). However that needs some configuration on archiving methods and overflow storage configurations. "
in DB2, more than one log file can also be use at the same time to off load the loading of log writing?
Tomas Helgi Johannsson
Hi!
By design then MySQL/MariaDB has one transaction-log (the bin-log ) per mysql instance. That is every database under that instance relies on that bin-log.
This design is also on DB2 on z/OS where there is one transaction-log per subsystem (instance). This design, that is one transaction log per instance, as is on DB2 z/OS, MySQL and MariaDB, puts that transaction log in the highest critical category of the whole system and needs to be protected against any loss or corruption to be able to do recovery to point in time for any database and/or table in that particular database in the instance.
However DB2 on LUW is designed in such way that every database has it's own transaction log so if one transaction log corrupts by missing log-files or corrupt physical files then that will not affect other databases under that particular DB2 instance.
"By design then MySQL/MariaDB has one transaction-log (the bin-log ) per mysql instance. That is every database under that instance relies on that bin-log. "
this is what I meant !
" However DB2 on LUW is designed in such way that every database has it's own transaction log so if one transaction log corrupts by missing log-files or corrupt physical files then that will not affect other databases under that particular DB2 instance.
"
so DB2 still better and we need additional configuration for it?
Tomas Helgi Johannsson
Hi!
>so DB2 still better and we need additional configuration for it?
It depends on what your requirements are for the database system at whole. :)
The DB2 database logs are put by default in the same path as the database itself with a default size of 1000 (4k pages) but you can easilly configure numbers of primary/secondary logfiles, logfilesize and logpath using the db2 commands.
The command (in *nix)
Note that even though I said that there is one transaction log per database in any DBMS (including DB2 ) then this transaction-log (logtream) is often divided physically in to multiple files for speed and "easy" log-management.
Configurations of the size of each physical logfile and how many logfiles should be created physically on disk by default and in continuous fashion should be configured and sized according to how big the workload will be and should be big enough to handle multiple simultaneous UOW of any size.
In DB2 you can have up to 256 primary logfiles allocated on disk and infinate secondary logfiles ( locsecond = -1 ). However that needs some configuration on archiving methods and overflow storage configurations.
Otherwise logprimary+logsecond <= 256 logfiles.
See here for further info and those links that NerdsOfTech provided.
Logfilz is the size of each logfile and should be big enough as I said to store multiple logrecords and multiple simultaneous UOW.
Regards,
Tomas Helgi