DB2数据库运行慢,卡死等情况。

db2数据库运行三四天后会突然卡慢,过两三小时后又会恢复正常。卡慢的过程中会出现以下问题:
1.DB2在运行一段时间后会出现卡死,造成磁盘IO性能瓶颈。2.DB2数据查询较慢。语句执行效率低。某些语句执行花几分钟。


以为数据相关信息
Database Configuration for Database qydb

Database configuration release level                    = 0x0f00
Database release level                                  = 0x0f00

Database territory                                      = CN
Database code page                                      = 1386
Database code set                                       = GBK
Database country/region code                            = 86
Database collating sequence                             = UNIQUE
Alternate collating sequence              (ALT_COLLATE) =
Number compatibility                                    = OFF
Varchar2 compatibility                                  = OFF
Date compatibility                                      = OFF
Database page size                                      = 4096

Statement concentrator                      (STMT_CONC) = OFF

Discovery support for this database       (DISCOVER_DB) = ENABLE

Restrict access                                         = NO
Default query optimization class         (DFT_QUERYOPT) = 5
Degree of parallelism                      (DFT_DEGREE) = 1
Continue upon arithmetic exceptions   (DFT_SQLMATHWARN) = NO
Default refresh age                   (DFT_REFRESH_AGE) = 0
Default maintained table types for opt (DFT_MTTB_TYPES) = SYSTEM
Number of frequent values retained     (NUM_FREQVALUES) = 10
Number of quantiles retained            (NUM_QUANTILES) = 20

Decimal floating point rounding mode  (DECFLT_ROUNDING) = ROUND_HALF_EVEN

Backup pending                                          = NO

All committed transactions have been written to disk    = NO
Rollforward pending                                     = NO
Restore pending                                         = NO

Multi-page file allocation enabled                      = YES

Log retain for recovery status                          = NO
User exit for logging status                            = YES

Self tuning memory                    (SELF_TUNING_MEM) = ON
Size of database shared memory (4KB)  (DATABASE_MEMORY) = AUTOMATIC(469392)
Database memory threshold               (DB_MEM_THRESH) = 10
Max storage for lock list (4KB)              (LOCKLIST) = 20000
Percent. of lock lists per application       (MAXLOCKS) = 70
Package cache size (4KB)                   (PCKCACHESZ) = AUTOMATIC(1296)
Sort heap thres for shared sorts (4KB) (SHEAPTHRES_SHR) = AUTOMATIC(245070)
Sort list heap (4KB)                         (SORTHEAP) = AUTOMATIC(49014)

Database heap (4KB)                            (DBHEAP) = 20000
Catalog cache size (4KB)              (CATALOGCACHE_SZ) = 172
Log buffer size (4KB)                        (LOGBUFSZ) = 1237
Utilities heap size (4KB)                (UTIL_HEAP_SZ) = 5000
Buffer pool size (pages)                     (BUFFPAGE) = 1000
SQL statement heap (4KB)                     (STMTHEAP) = 10240
Default application heap (4KB)             (APPLHEAPSZ) = 13312
Application Memory Size (4KB)             (APPL_MEMORY) = AUTOMATIC(40000)
Statistics heap size (4KB)               (STAT_HEAP_SZ) = AUTOMATIC(4384)

Interval for checking deadlock (ms)         (DLCHKTIME) = 10000
Lock timeout (sec)                        (LOCKTIMEOUT) = 30

Changed pages threshold                (CHNGPGS_THRESH) = 80
Number of asynchronous page cleaners   (NUM_IOCLEANERS) = AUTOMATIC(1)
Number of I/O servers                   (NUM_IOSERVERS) = AUTOMATIC(6)
Index sort flag                             (INDEXSORT) = YES
Sequential detect flag                      (SEQDETECT) = YES
Default prefetch size (pages)         (DFT_PREFETCH_SZ) = AUTOMATIC

Track modified pages                         (TRACKMOD) = NO

Default number of containers                            = 1
Default tablespace extentsize (pages)   (DFT_EXTENT_SZ) = 32

Max number of active applications            (MAXAPPLS) = AUTOMATIC(162)
Average number of active applications       (AVG_APPLS) = AUTOMATIC(1)
Max DB files open per application            (MAXFILOP) = 61440

Log file size (4KB)                         (LOGFILSIZ) = 10240
Number of primary log files                (LOGPRIMARY) = 99
Number of secondary log files               (LOGSECOND) = 12
Changed path to log files                  (NEWLOGPATH) =
Path to log files                                       = /home/db2inst1/db2inst1/NODE0000/SQL00001/LOGSTREAM0000/
Overflow log path                     (OVERFLOWLOGPATH) =
Mirror log path                         (MIRRORLOGPATH) = /dblog/NODE0000/LOGSTREAM0000/
First active log file                                   = S0001128.LOG
Block log on disk full                (BLK_LOG_DSK_FUL) = NO
Block non logged operations            (BLOCKNONLOGGED) = NO
Percent max primary log space by transaction  (MAX_LOG) = 0
Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0

Percent log file reclaimed before soft chckpt (SOFTMAX) = 520

HADR database role                                      = STANDARD
HADR local host name                  (HADR_LOCAL_HOST) =
HADR local service name                (HADR_LOCAL_SVC) =
HADR remote host name                (HADR_REMOTE_HOST) =
HADR remote service name              (HADR_REMOTE_SVC) =
HADR instance name of remote server  (HADR_REMOTE_INST) =
HADR timeout value                       (HADR_TIMEOUT) = 120
HADR target list                     (HADR_TARGET_LIST) =
HADR log write synchronization mode     (HADR_SYNCMODE) = NEARSYNC
HADR spool log data limit (4KB)      (HADR_SPOOL_LIMIT) = 0
HADR log replay delay (seconds)     (HADR_REPLAY_DELAY) = 0
HADR peer window duration (seconds)  (HADR_PEER_WINDOW) = 0

First log archive method                 (LOGARCHMETH1) = DISK:/db2logretain1/
Archive compression for logarchmeth1    (LOGARCHCOMPR1) = OFF
Options for logarchmeth1                  (LOGARCHOPT1) =
Second log archive method                (LOGARCHMETH2) = OFF
Archive compression for logarchmeth2    (LOGARCHCOMPR2) = OFF
Options for logarchmeth2                  (LOGARCHOPT2) =
Failover log archive path                (FAILARCHPATH) =
Number of log archive retries on error   (NUMARCHRETRY) = 5
Log archive retry Delay (secs)         (ARCHRETRYDELAY) = 20
Vendor options                              (VENDOROPT) =

Auto restart enabled                      (AUTORESTART) = ON
Index re-creation time and redo index build  (INDEXREC) = SYSTEM (ACCESS)
Log pages during index build            (LOGINDEXBUILD) = OFF
Default number of loadrec sessions    (DFT_LOADREC_SES) = 1
Number of database backups to retain   (NUM_DB_BACKUPS) = 12
Recovery history retention (days)     (REC_HIS_RETENTN) = 366
Auto deletion of recovery objects    (AUTO_DEL_REC_OBJ) = OFF

TSM management class                    (TSM_MGMTCLASS) =
TSM node name                            (TSM_NODENAME) =
TSM owner                                   (TSM_OWNER) =
TSM password                             (TSM_PASSWORD) =

Automatic maintenance                      (AUTO_MAINT) = ON
   Automatic database backup            (AUTO_DB_BACKUP) = OFF
   Automatic table maintenance          (AUTO_TBL_MAINT) = ON
     Automatic runstats                  (AUTO_RUNSTATS) = ON
       Real-time statistics            (AUTO_STMT_STATS) = ON
       Statistical views              (AUTO_STATS_VIEWS) = OFF
       Automatic sampling                (AUTO_SAMPLING) = OFF
     Automatic statistics profiling    (AUTO_STATS_PROF) = OFF
       Statistics profile updates        (AUTO_PROF_UPD) = OFF
     Automatic reorganization               (AUTO_REORG) = OFF

Auto-Revalidation                          (AUTO_REVAL) = DEFERRED
Currently Committed                        (CUR_COMMIT) = ON
CHAR output with DECIMAL input        (DEC_TO_CHAR_FMT) = NEW
Enable XML Character operations        (ENABLE_XMLCHAR) = YES
WLM Collection Interval (minutes)     (WLM_COLLECT_INT) = 0
Monitor Collect Settings
Request metrics                       (MON_REQ_METRICS) = BASE
Activity metrics                      (MON_ACT_METRICS) = BASE
Object metrics                        (MON_OBJ_METRICS) = EXTENDED
Unit of work events                      (MON_UOW_DATA) = NONE
   UOW events with package list        (MON_UOW_PKGLIST) = OFF
   UOW events with executable list    (MON_UOW_EXECLIST) = OFF
Lock timeout events                   (MON_LOCKTIMEOUT) = NONE
Deadlock events                          (MON_DEADLOCK) = WITHOUT_HIST
Lock wait events                         (MON_LOCKWAIT) = NONE
Lock wait event threshold               (MON_LW_THRESH) = 5000000
Number of package list entries         (MON_PKGLIST_SZ) = 32
Lock event notification level         (MON_LCK_MSG_LVL) = 1

SMTP Server                               (SMTP_SERVER) =
SQL conditional compilation flags         (SQL_CCFLAGS) =
Section actuals setting               (SECTION_ACTUALS) = NONE
Connect procedure                        (CONNECT_PROC) =
Adjust temporal SYSTEM_TIME period (SYSTIME_PERIOD_ADJ) = NO
Log DDL Statements                      (LOG_DDL_STMTS) = NO
Log Application Information             (LOG_APPL_INFO) = NO
Default data capture on new Schemas   (DFT_SCHEMAS_DCC) = NO
Database is in write suspend state                      = NO


Multi-page file allocation enabled                      = YES

Log retain for recovery status                          = NO
User exit for logging status                            = YES

Self tuning memory                    (SELF_TUNING_MEM) = ON
Size of database shared memory (4KB)  (DATABASE_MEMORY) = AUTOMATIC(469392)
Database memory threshold               (DB_MEM_THRESH) = 10
Max storage for lock list (4KB)              (LOCKLIST) = 20000
Percent. of lock lists per application       (MAXLOCKS) = 70
Package cache size (4KB)                   (PCKCACHESZ) = AUTOMATIC(1296)
Sort heap thres for shared sorts (4KB) (SHEAPTHRES_SHR) = AUTOMATIC(245070)
Sort list heap (4KB)                         (SORTHEAP) = AUTOMATIC(49014)

Database heap (4KB)                            (DBHEAP) = 20000
Catalog cache size (4KB)              (CATALOGCACHE_SZ) = 172
Log buffer size (4KB)                        (LOGBUFSZ) = 1237
Utilities heap size (4KB)                (UTIL_HEAP_SZ) = 5000
Buffer pool size (pages)                     (BUFFPAGE) = 1000
SQL statement heap (4KB)                     (STMTHEAP) = 10240
Default application heap (4KB)             (APPLHEAPSZ) = 13312
Application Memory Size (4KB)             (APPL_MEMORY) = AUTOMATIC(40000)
Statistics heap size (4KB)               (STAT_HEAP_SZ) = AUTOMATIC(4384)

Interval for checking deadlock (ms)         (DLCHKTIME) = 10000
Lock timeout (sec)                        (LOCKTIMEOUT) = 30

Changed pages threshold                (CHNGPGS_THRESH) = 80
Number of asynchronous page cleaners   (NUM_IOCLEANERS) = AUTOMATIC(1)
Number of I/O servers                   (NUM_IOSERVERS) = AUTOMATIC(6)
Index sort flag                             (INDEXSORT) = YES
Sequential detect flag                      (SEQDETECT) = YES
Default prefetch size (pages)         (DFT_PREFETCH_SZ) = AUTOMATIC

Track modified pages                         (TRACKMOD) = NO

Default number of containers                            = 1
Default tablespace extentsize (pages)   (DFT_EXTENT_SZ) = 32

Max number of active applications            (MAXAPPLS) = AUTOMATIC(162)
Average number of active applications       (AVG_APPLS) = AUTOMATIC(1)
Max DB files open per application            (MAXFILOP) = 61440

Log file size (4KB)                         (LOGFILSIZ) = 10240
Number of primary log files                (LOGPRIMARY) = 99
Number of secondary log files               (LOGSECOND) = 12
Changed path to log files                  (NEWLOGPATH) =
Path to log files                                       = /home/db2inst1/db2inst1/NODE0000/SQL00001/LOGSTREAM0000/
Overflow log path                     (OVERFLOWLOGPATH) =
Mirror log path                         (MIRRORLOGPATH) = /dblog/NODE0000/LOGSTREAM0000/
First active log file                                   = S0001128.LOG
Block log on disk full                (BLK_LOG_DSK_FUL) = NO
Block non logged operations            (BLOCKNONLOGGED) = NO
Percent max primary log space by transaction  (MAX_LOG) = 0
Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0

Percent log file reclaimed before soft chckpt (SOFTMAX) = 520

HADR database role                                      = STANDARD
HADR local host name                  (HADR_LOCAL_HOST) =
HADR local service name                (HADR_LOCAL_SVC) =
HADR remote host name                (HADR_REMOTE_HOST) =
HADR remote service name              (HADR_REMOTE_SVC) =
HADR instance name of remote server  (HADR_REMOTE_INST) =
HADR timeout value                       (HADR_TIMEOUT) = 120
HADR target list                     (HADR_TARGET_LIST) =
HADR log write synchronization mode     (HADR_SYNCMODE) = NEARSYNC
HADR spool log data limit (4KB)      (HADR_SPOOL_LIMIT) = 0
HADR log replay delay (seconds)     (HADR_REPLAY_DELAY) = 0
HADR peer window duration (seconds)  (HADR_PEER_WINDOW) = 0

First log archive method                 (LOGARCHMETH1) = DISK:/db2logretain1/
Archive compression for logarchmeth1    (LOGARCHCOMPR1) = OFF
Options for logarchmeth1                  (LOGARCHOPT1) =
Second log archive method                (LOGARCHMETH2) = OFF
Archive compression for logarchmeth2    (LOGARCHCOMPR2) = OFF
Options for logarchmeth2                  (LOGARCHOPT2) =
Failover log archive path                (FAILARCHPATH) =
Number of log archive retries on error   (NUMARCHRETRY) = 5
Log archive retry Delay (secs)         (ARCHRETRYDELAY) = 20
Vendor options                              (VENDOROPT) =

Auto restart enabled                      (AUTORESTART) = ON
Index re-creation time and redo index build  (INDEXREC) = SYSTEM (ACCESS)
Log pages during index build            (LOGINDEXBUILD) = OFF
Default number of loadrec sessions    (DFT_LOADREC_SES) = 1
Number of database backups to retain   (NUM_DB_BACKUPS) = 12
Recovery history retention (days)     (REC_HIS_RETENTN) = 366
Auto deletion of recovery objects    (AUTO_DEL_REC_OBJ) = OFF

TSM management class                    (TSM_MGMTCLASS) =
TSM node name                            (TSM_NODENAME) =
TSM owner                                   (TSM_OWNER) =
TSM password                             (TSM_PASSWORD) =

Automatic maintenance                      (AUTO_MAINT) = ON
   Automatic database backup            (AUTO_DB_BACKUP) = OFF
   Automatic table maintenance          (AUTO_TBL_MAINT) = ON
     Automatic runstats                  (AUTO_RUNSTATS) = ON
       Real-time statistics            (AUTO_STMT_STATS) = ON
       Statistical views              (AUTO_STATS_VIEWS) = OFF
       Automatic sampling                (AUTO_SAMPLING) = OFF
     Automatic statistics profiling    (AUTO_STATS_PROF) = OFF
       Statistics profile updates        (AUTO_PROF_UPD) = OFF
     Automatic reorganization               (AUTO_REORG) = OFF

Auto-Revalidation                          (AUTO_REVAL) = DEFERRED
Currently Committed                        (CUR_COMMIT) = ON
CHAR output with DECIMAL input        (DEC_TO_CHAR_FMT) = NEW
Enable XML Character operations        (ENABLE_XMLCHAR) = YES
WLM Collection Interval (minutes)     (WLM_COLLECT_INT) = 0
Monitor Collect Settings
Request metrics                       (MON_REQ_METRICS) = BASE
Activity metrics                      (MON_ACT_METRICS) = BASE
Object metrics                        (MON_OBJ_METRICS) = EXTENDED
Unit of work events                      (MON_UOW_DATA) = NONE
   UOW events with package list        (MON_UOW_PKGLIST) = OFF
   UOW events with executable list    (MON_UOW_EXECLIST) = OFF
Lock timeout events                   (MON_LOCKTIMEOUT) = NONE
Deadlock events                          (MON_DEADLOCK) = WITHOUT_HIST
Lock wait events                         (MON_LOCKWAIT) = NONE
Lock wait event threshold               (MON_LW_THRESH) = 5000000
Number of package list entries         (MON_PKGLIST_SZ) = 32
Lock event notification level         (MON_LCK_MSG_LVL) = 1

SMTP Server                               (SMTP_SERVER) =
SQL conditional compilation flags         (SQL_CCFLAGS) =
Section actuals setting               (SECTION_ACTUALS) = NONE
Connect procedure                        (CONNECT_PROC) =
Adjust temporal SYSTEM_TIME period (SYSTIME_PERIOD_ADJ) = NO
Log DDL Statements                      (LOG_DDL_STMTS) = NO
Log Application Information             (LOG_APPL_INFO) = NO
Default data capture on new Schemas   (DFT_SCHEMAS_DCC) = NO
Database is in write suspend state                      = NO
参与18

7同行回答

atpeace331atpeace331数据库管理员银行
回复 1# alan9668 问问题:    首先,数据库系统环境信息(OS类型、版本号),DB2 版本信息,实例配置、数据库配置信息,你得放到附件贴出来吧。否则,大家都不知道您的环境是windows、linux还是AIX。。。    其次,既然初步看是性能问题,你最好把问题发生时间段内的OS...显示全部
回复 1# alan9668

问问题:    首先,数据库系统环境信息(OS类型、版本号),DB2 版本信息,实例配置、数据库配置信息,你得放到附件贴出来吧。否则,大家都不知道您的环境是windows、linux还是AIX。。。
    其次,既然初步看是性能问题,你最好把问题发生时间段内的OS层面、数据库层面性能监控数据贴上来供大家分析诊断,这是最基本的信息。否则,再多的人在下边留言也是胡乱瞎猜,而你就只能瞎试,运气好,试对了,问题解决了,但也只是拼运气而已!!!最好把该有的信息全以附件形式贴出来!收起
银行 · 2015-06-18
浏览9351
yuanxiaoyangyuanxiaoyang系统工程师st
出现问题时有没有看一看db2diag日志,查一下消耗I/O比较高的sql,同时看一下后台应用的并发和排序等等这些。你们的应用是OLAP还是OLTP的?显示全部
出现问题时有没有看一看db2diag日志,查一下消耗I/O比较高的sql,同时看一下后台应用的并发和排序等等这些。你们的应用是OLAP还是OLTP的?收起
系统集成 · 2015-06-19
浏览9076
alan9668alan9668系统运维工程师alan
您好!系统为 Linux Red Hat Enterprise Linux Server release 6.2 DB2 版本信息为:DB2 v10.1.0.0 系统在出现以上的问题时,会导致磁盘IO问题外。其他如内存,CPU都还很足够。实例信息已在问题描述中贴出来了。...显示全部
您好!系统为 Linux Red Hat Enterprise Linux Server release 6.2
DB2 版本信息为:DB2 v10.1.0.0
系统在出现以上的问题时,会导致磁盘IO问题外。其他如内存,CPU都还很足够。
实例信息已在问题描述中贴出来了。收起
互联网服务 · 2015-06-18
浏览8284
icycastleicycastle课题专家组数据库管理员某证券公司
类似问题遇到过,关注下latch和锁定,我们是发现了一个长事务,修改了一张查询量很大的表,一直不提交,导致后续查询都需要从日志文件读前镜像数据,只要把这个会话杀了,一切都恢复正常了。...显示全部

类似问题遇到过,关注下latch和锁定,我们是发现了一个长事务,修改了一张查询量很大的表,一直不提交,导致后续查询都需要从日志文件读前镜像数据,只要把这个会话杀了,一切都恢复正常了。

收起
证券 · 2017-03-17
浏览8428
忧郁的凯奇忧郁的凯奇其它其他
同问 最近我们这边也有这个问题 都杀得没剩几个应用了 但还是慢得接近卡死 过两三个小时又会自动恢复显示全部

同问 最近我们这边也有这个问题 都杀得没剩几个应用了 但还是慢得接近卡死 过两三个小时又会自动恢复

收起
IT其它 · 2017-02-15
浏览8408
新数科技新数科技IT顾问北京新数科技有限公司
性能问题相对比较复杂,设计方面较多,单凭数据库参数无法做出有用判断,需要更多的静态和动态数据,或者您在观察之后将觉得极为可疑的地方相关数据贴出,否则难以下手。显示全部
性能问题相对比较复杂,设计方面较多,单凭数据库参数无法做出有用判断,需要更多的静态和动态数据,或者您在观察之后将觉得极为可疑的地方相关数据贴出,否则难以下手。收起
IT咨询服务 · 2015-06-19
浏览8240
drdb2drdb2系统工程师se
For troubleshooting such problem, you need to setup monitoring to capture system and db information in a period of time.显示全部
For troubleshooting such problem, you need to setup monitoring to capture system and db information in a period of time.收起
互联网服务 · 2015-06-18
浏览8228

提问者

alan9668
系统运维工程师alan
擅长领域: Linux服务器系统管理

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2015-06-18
  • 关注会员:3 人
  • 问题浏览:17361
  • 最近回答:2017-03-17
  • X社区推广