The db2 tutorial you are watching is: DB2 programming skills (9). 4.8 Check out which databases are under this instance
db2 LIST DATABASE DIRECTORY [ on /home/db2inst1 ]
4.9 View and change the configuration of the database head
Please note that in most cases, after changing the configuration of the data, it will only take effect after all connections are broken.
Check the configuration of the database head
db2 get db cfg for head
Change the value of a setting in the database head
4.9.1 Change the size of the sort heap
db2 update db cfg for head using SORTHEAP 2048
Change the size of the sorting heap to 2048 pages. It is best to set this value larger for applications with more queries.
4.9.2 Change the size of the thing log
db2 update db cfg for head using logfilsiz 40000
The size of this item must be consistent with the processing of things in the database. If the things are larger, the value should be changed a little larger. Otherwise, it is easy to deal with errors with full log files.
4.9.3 Modify the program heap memory size when there is insufficient program heap memory
db2 update db cfg for head using applheapsz 40000
This value cannot be too small, otherwise there will be insufficient memory to run the application.
4.10 View and change the configuration of the database instance
View DB instance configuration
db2 get dbm cfg
Change database instance configuration
4.10.1 Turn on monitoring of locking conditions.
db2 update dbm cfg using dft_mon_lock on
4.10.2 Change the diagnostic error capture level
db2 update dbm cfg using diaglevel 3
0 is not recorded information
1 is to record only errors
2. Record service and non-service errors
The default is 3, and the errors and warnings of db2 are recorded.
4. Record all information, including the information that was successfully executed
Generally speaking, please do not use 4, as it will cause db2 to run very slowly.
db2 LIST DATABASE DIRECTORY [ on /home/db2inst1 ]
4.9 View and change the configuration of the database head
Please note that in most cases, after changing the configuration of the data, it will only take effect after all connections are broken.
Check the configuration of the database head
db2 get db cfg for head
Change the value of a setting in the database head
4.9.1 Change the size of the sort heap
db2 update db cfg for head using SORTHEAP 2048
Change the size of the sorting heap to 2048 pages. It is best to set this value larger for applications with more queries.
4.9.2 Change the size of the thing log
db2 update db cfg for head using logfilsiz 40000
The size of this item must be consistent with the processing of things in the database. If the things are larger, the value should be changed a little larger. Otherwise, it is easy to deal with errors with full log files.
4.9.3 Modify the program heap memory size when there is insufficient program heap memory
db2 update db cfg for head using applheapsz 40000
This value cannot be too small, otherwise there will be insufficient memory to run the application.
4.10 View and change the configuration of the database instance
View DB instance configuration
db2 get dbm cfg
Change database instance configuration
4.10.1 Turn on monitoring of locking conditions.
db2 update dbm cfg using dft_mon_lock on
4.10.2 Change the diagnostic error capture level
db2 update dbm cfg using diaglevel 3
0 is not recorded information
1 is to record only errors
2. Record service and non-service errors
The default is 3, and the errors and warnings of db2 are recorded.
4. Record all information, including the information that was successfully executed
Generally speaking, please do not use 4, as it will cause db2 to run very slowly.