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.
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • db2管理工具小结
  • DB2数据库的导出与导入(Windows客户端)
  • db2 CLP中如何换行
  • DB2查看表结构及所用表语句
  • DB2 · CREATE TABLESPACE
  • 使用DB2对象:创建模式、表和视图
  • DB2数据库逻辑卷的复制
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1