db2中更改日志文件大小及其个数
来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 23:56 点击:次
db2中更改日志文件大小及其个数比较简单,只需要修改2个参数即可,比ORACLE方便的多。
默认日志文件放在SQLOGDIR目录下。
[huateng@db2server SQLOGDIR]$ pwd
/home/huateng/huateng/NODE0000/SQL00001/SQLOGDIR
[huateng@db2server SQLOGDIR]$ ls -lh
总计 53M www.2cto.com
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000011.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000012.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000013.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000014.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000015.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000016.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000017.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000018.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000019.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000020.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000021.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000022.LOG
-rw------- 1 huateng huateng 4.1M 03-30 06:26 S0000023.LOG
[huateng@db2server SQLOGDIR]$ db2 connect to dbtest
Database Connection Information
Database server = DB2/LINUX 9.7.0
SQL authorization ID = HUATENG
Local database alias = DBTEST
[huateng@db2server SQLOGDIR]$ db2 get db cfg | grep LOGPRIMARY
Number of primary log files (LOGPRIMARY) = 13
[huateng@db2server SQLOGDIR]$ db2 get db cfg | grep LOGFILSIZ
Log file size (4KB) (LOGFILSIZ) = 1024
当前日志文件数为13,大小大约为4M。
下面将日志文件数改为3个,大小为16M。
[huateng@db2server SQLOGDIR]$ db2 update db cfg using LOGPRIMARY 3
SQL5153N The update cannot be completed because the following relationship
would be violated: "softmax <= 100 * logprimary". www.2cto.com
[huateng@db2server SQLOGDIR]$ db2 get db cfg | grep -i softmax
Percent log file reclaimed before soft chckpt (SOFTMAX) = 520
[huateng@db2server SQLOGDIR]$ db2 update db cfg using SOFTMAX 200
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, all
applications must disconnect from this database before the changes become
effective.
[huateng@db2server SQLOGDIR]$ db2 update db cfg using LOGPRIMARY 3
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, all
applications must disconnect from this database before the changes become
effective.
[huateng@db2server SQLOGDIR]$ db2 update db cfg using LOGFILSIZ 4096
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, all
applications must disconnect from this database before the changes become
effective.
- 发表评论
-
- 最新评论 更多>>