自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

DB2數(shù)據(jù)庫性能調(diào)整的命令介紹

數(shù)據(jù)庫
如何才能調(diào)整數(shù)據(jù)庫的性能,成為了大家熱議的話題,本文將為您介紹DB2數(shù)據(jù)庫的性能調(diào)整命令,供您參考,希望能對您有所幫助。

數(shù)據(jù)庫的性能是我們重點考慮的因素,如何才能調(diào)整數(shù)據(jù)庫的性能,成為了大家熱議的話題,本文將為您介紹DB2數(shù)據(jù)庫的性能調(diào)整命令,供您參考,希望能對您有所幫助。

IBM DB2數(shù)據(jù)庫性能調(diào)整命令:

查看執(zhí)行計劃:

db2expln:

db2expln -d dbname -c pkgOwner -p pkgNmae -o expln.out

dynexpln:

dynexpln -d eos -q "select * from eosmenu" -g -t

dynexpln -d eos -f query.sql -o out.txt

更新統(tǒng)計信息:

runstats:

db2 runstats on table songxn.eosmenu and indexs songxn.ix1,songxn.ix2 allow read access

db2 runstats on table songxn.eosmenu with distribution and detailed index all

調(diào)整優(yōu)化等級:

(0,1,2,3,5,7,9):#p#

更改DFT_QUERYOPT(db cfg), 默認為5

SQL:set current query optimization = 3

索引:

建立索引:

create unique index ind1 on vicky.staff ( dept, lastname )

create unique index ind2 on vicky.emplyee ( empno ) include ( lastname, salary)

include中的字段不列入排序范圍

叢集索引:

記錄與索引的順序一致

cretae index ind3 on vicky.staff ( dept ) CLUSTER

SCAN MODE:#p#

Index Scan,Full Index Scan(Index only Access),Relation Scan

查詢索引:

select indname from syscat.indexes where tabname='customer'

索引建議器:

db2advis -d dbname -i query.sql | -s "sql stmt" -o advis.out

在數(shù)據(jù)頁中預(yù)留空間:

alter table vicky.staff PCTFREE 30(預(yù)留30%)

load from staff.ixf of ixf modified by pagefreespace=30 replace into vicky.staff

緩沖池與IO

默認為IBMDEFAULTBP

新建緩沖池:

db2 create bufferpool bpname size 1000 pagesize 4k

alter tablespace tbname bufferpool bpname

當(dāng)臟頁超過CHNGPGS_THRESH(%,db cfg)時,緩沖池將被清空并寫回

延展緩沖池:#p#

ESTORE_SEG_SZ& NUM_ESTORE_SEGS(db cfg)

db2 alter bufferpool ibmdefaultbp [ not ] extended storage

I/O SERVER:

NUM_IOSERVERS(db cfg):一般為磁盤數(shù)+2

數(shù)據(jù)重整:

REORGCHK:

db2 reorgchk update statistics on table all 該語句也用來對所有表做RUNSTATS

db2 reorgchk current statistics on table vicky.staff

table statistics:

CARD:記錄筆數(shù)

OV(ERFLOW):overflow的記錄數(shù)

NP(AGES):含有記錄的頁數(shù)

FP(AGES):表格占用的總頁數(shù)

TSIZE(Bytes):表格大小#p#

index statistics:

LEAF:leaf page數(shù)

ELEAF:空葉數(shù)

NDEL:被刪除的RID數(shù)

LVLS:索引層級數(shù)

ISIZE:索引平均長度

KEYS:不同的索引值的個數(shù)

表格重整:

db2 reorg table vicky.staff index ind1 use tempspace2 indexscan

索引重整:

db2 reorg indexes all for table vicky.staff _options_

options:allow read|write|no access, cleanup only pages|all(不重建索引結(jié)構(gòu),只回收空索引頁)

聯(lián)機表格重整(V8+):

db2 reorg table vicky.staff index vicky.ind2 inplace allow write access

db2 reorg table vicky.staff index vicky.ind2 inplace pause|resume

db2 list history reorg all for dbname#p#

MQT

MQT:

建立MQT:

CREATE TABLE vicky.mqt1 AS

( SELECT name, location, salary

FROM vicky.staff, vicky.org

WHERE staff.dept=org.deptnumb AND salary>20000

) DATA INITIALLY DEFERRED REFRESH DEFERRED|IMMEDIATE

ENABLE|DISABLE QUERY OPTIMIZATION

REFRESH TABLE vicky.mqt1

利用MQT:

RUNSTATS ON TABLE vicky.mqt1

UPDATE DB CFG FOR sample USING DFT_REFRESH_AGE ANY

并行處理

設(shè)置并行處理:#p#

UPDATE DBM CFG USING INTRA_PARALLEL YES

UPDATE DB CFG FOR EOS USING DFT_DEGREE ANY

并行處理上限:

應(yīng)用級:

SET RUNTIME DEGREE FOR ( 25 ) TO 4

SET RUNTIME DEGREE FOR ALL TO 6

實例級:

UPDATE DBM CFG USING MAX_QUERYDEGREE 6

MDC表:

CREATE TABLE vicky.sales

( YearAndMonth CHAR(4),

Region CHAR(20),

Product CHAR(2),#p#

Sales BIGINT

) ORGANIZE BY DIMENSIONS ( YearAndMonth, Region )

CREATE TABLE vicky.table1

( col1 CHAR(10),

col2 CHAR(10),

col3 CHAR(10),

col4 INTEGER,

col5 DECIMAL(10,2),

) ORGANIZE BY DIMENSIONS ( col1, ( col2, col3 ),col4 )
 

責(zé)任編輯:段燃 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-09-30 11:49:21

DB2數(shù)據(jù)庫權(quán)限

2010-08-31 13:06:49

DB2數(shù)據(jù)庫

2010-08-27 10:06:23

DB2安裝雙機

2010-09-01 09:13:29

DB2表空間

2010-08-27 11:08:59

DB2安裝目錄

2010-09-06 17:15:41

DB2數(shù)據(jù)庫

2010-08-03 09:59:30

DB2數(shù)據(jù)庫

2009-02-26 09:34:16

性能優(yōu)化DB2數(shù)據(jù)庫

2010-08-17 17:29:06

DB2性能優(yōu)化

2010-07-28 14:07:51

DB2數(shù)據(jù)庫

2010-08-05 15:08:22

提高DB2數(shù)據(jù)庫

2010-09-01 10:55:24

db2管理

2011-08-18 19:10:27

DB2數(shù)據(jù)庫命令

2011-03-11 16:02:03

DB2數(shù)據(jù)庫安裝

2010-08-03 14:40:05

DB2數(shù)據(jù)庫

2011-03-14 17:03:21

DB2數(shù)據(jù)庫性能監(jiān)控

2010-09-07 15:58:24

DB2數(shù)據(jù)庫性能

2011-04-08 15:00:20

DB2數(shù)據(jù)庫

2010-07-30 10:05:51

DB2數(shù)據(jù)庫性能

2015-10-23 16:32:29

DB2數(shù)據(jù)庫性能
點贊
收藏

51CTO技術(shù)棧公眾號