Вы находитесь на странице: 1из 39

Informix

IBM Informix
Informix Enablement Team

201426

2010 IBM Corporation

Information Management Informix

Informix
(task)


Informix

2010 IBM Corporation

Information Management Informix

Informix
CPU
CPU



IDS
IDS

I/O
I/O
I/O


IDS

online.log

2010 IBM Corporation

Information Management Informix

CPU
Atop
Tasks: 209 total, 1 running, 207 sleeping, 0 stopped, 1 zombie
Cpu(s): 0.3%us, 0.3%sy, 0.0%ni, 50.0%id, 49.2%wa, 0.0%hi, 0.2%si, 0.0%st
Bsar 5 100
10:37:06 AM CPU
10:37:11 AM
all
10:37:16 AM
all
10:37:21 AM
all
10:37:26 AM
all

%user
0.70
0.50
0.50
0.50

%nice
0.00
0.00
0.00
0.00

%system %iowait
0.40
49.20
0.30
49.45
0.50
49.30
0.40
49.35

%steal
0.00
0.00
0.00
0.00

%idle
49.70
49.75
49.70
49.75

1CPU20

2CPU2%

12CPU

2010 IBM Corporation

Information Management Informix

Atop
Cpu(s): 0.5%us, 0.2%sy, 0.0%ni, 49.9%id, 49.4%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 4044192k total, 4016092k used, 28100k free, 32344k buffers
Swap: 8193140k total, 138236k used, 8054904k free, 3544312k cached
Bonstat -g seg
id
key
addr
size
ovhd
class blkused blkfree
12943367 52564801 44000000 895340544 10925608 R 218587 2
12976136 52564802 795dd000 334397440 3920416 V 17035 64605
V
.
Total: -

1229737984 -

235622 64607

IDS

IDS4

IDS

BUFFERPOOL

SHMVIRTSIZE

SHMADD
5

2010 IBM Corporation

Information Management Informix

I/O1
Aiostat 5 100
avg-cpu: %user %nice %system %iowait %steal %idle
14.29 0.00 0.29
6.38 0.00
79.04
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
25.24
386.78
293.22
131991652 100065298
sda1
0.00
0.01
0.00
1866
14
sda2
24.76
380.97
287.73
130010482 98190344

BSysmaster SQL for I/O


select d.name dbspace, fname[1,125] chunk_name,
sum(pagesread) diskreads, sum(pageswritten) diskwrites,
sum(pagesread)+sum(pageswritten) disk_rwes
from sysmaster:syschkio c, sysmaster:syschunks k, sysmaster:sysdbspaces d
where d.dbsnum = k.dbsnum and k.chknum = c.chunknum --# c.chknum
group by 1, 2 order by 5 desc;

dbspace
dbs11
demodbs
llogdbs
rootdbs

chunk_name
/opt/dbschk/dbs11
/opt/dbschk/demodbchk
/opt/dbschk/llogch
/opt/dbschk/online_root

diskreads
475
2493
66
37513

diskwrites
23232301
9843421
11156850
10001

disk_rwes
23234759
91323498
11156916
47514

2010 IBM Corporation

Information Management Informix

I/O2
Constat -D
address chunk/dbs
b2d481c0 1 1
b417dce8 2 2
b4179028 3 3
b4179218 4 4

offset page Rd page Wr pathname


0
475
23232301 /opt/dbschk/dbs11
0
2493
9843421
/opt/dbschk/demodbchk
0
66
11156850 /opt/dbschk/llogch
0
37513
2738
/opt/dbschk/online_root

Donstat -g iof
AIO global files:
gfd pathname
bytes read
3 dbs11
972800
4 demodbchk
5105 664
5 llogch
135168
6 online_root
76826624

page reads bytes write


475
47579752448
2493
20159326208
66
22849228800
37513
5607424

page writes io/s


23232301 916.6
9843421
916.6
11156850 916.6
2738
916.6

(Read)Chunk
(Write)Chunk

2010 IBM Corporation

Information Management Informix

I/O 3

I/OInformix?
I/O?
?

I/OI/O

dbspaceI/O

Attached Index Detached Index

2010 IBM Corporation

Information Management Informix

Aonstat -g ntu|grep sqlexec|wc -l


323

Bonstat -g ntu
#netscb connects read write

q-free q-limits q-exceed alloc/max

6/ 12

6/ 10 135/ 10

5222 112957 114819

0/ 0 10/ 10

C. onstat -g ntd
Client Type Calls Accepted Rejected
Read
Write
sqlexec
yes
5212
123
59347
66366

DBAIDSRejectedIDS

RejectedNETTYPEIDS
NETTYPE soctcp10, 350CPU
NETTYPE connection_typepoll_threadsc_per_tvp_class
poll_threadsNUMCPUVPSc_per_t350vp_classNET

2010 IBM Corporation

Information Management Informix

online.log
Agrep Error online.log
10:05:43 SCHAPI: Error -23197 Database locale information mismatch.
Bgrep Thread online.log
13:41:16 Who: Session(654, prpsvr@hljpicc, 213218, 70000035702aff8)
Thread(805, sqlexec, 700000357393c98, 4)
File: rsdebug.c Line: 1067
13:41:16 Results: Possible inconsistencies in 'prpalldb:"piccprp".prprepay'
13:41:16 Action: Run 'oncheck -cD 6292799'

C. grep "Assert Failed" online.log


00:57:53 Assert Failed: Unexpected virtual processor termination, pid =22, exit = 0x9
00:57:53 Who: Session(1122, demodb@demo_no, 6238, 721214359)
Thread(62340, sqlexec, 3845e36, 1)

Error -23197 finderr -23197


oncheck -cDoncheck
Assert Failedaf.xxxIBM

10

2010 IBM Corporation

Information Management Informix

Informix
(task)


Informix

11

2010 IBM Corporation

Information Management Informix

(task)
dbspace
root dbspace
dbspace
dbspace

temp dbspace
temp dbspace
temp dbspace

Update Statistics

12

2010 IBM Corporation

Information Management Informix

dbspaces rootdbs
A Sysmaster SQL
select distinct t.dbsname database, d.name dbspace, t.tabname
from sysmaster:sysdbstab d, sysmaster:syschunks c, sysmaster:sysextents t
where t.chunk = c.chknum and c.dbsnum=d.dbsnum
and t.dbsname not like 'sys%' and t.dbsname != 'onpload'
and t.tabname not like 'sys%' and d.name ='rootdbs' ;
database
bank18030
htyuan
htyuan

dbspace
rootdbs
rootdbs
rootdbs

tabname
customer
t100_1
t101_20

rootdbs

dbspacerootdbs

13

2010 IBM Corporation

Information Management Informix

dbspaces
ASysmaster SQL (dbaccess sysmaster)
select name dbspace, sum(chksize) allocated, sum(nfree) free,
round(((sum(chksize) - sum(nfree))/sum(chksize))*100,2) pcused
from sysmaster:sysdbspaces d, sysmaster:syschunks c
where d.dbsnum = c.dbsnum
group by name order by 4 desc,name;
dbspace allocated
demodbs 2000000
dbs11
2000000
dbs12
2000000

free
28800
860150
860150

pcused%
98.56
56.99
56.99

dbspace

dbspacedbspace

14

2010 IBM Corporation

Information Management Informix

temp dbspace1
A. onstat -c |grep DBSPACETEMP
or env |grep DBSPACETEMP
DBSPACETEMP tmpdbs01,tmpdbs02,tmpdbs03,tmpdbs04
Bdbaccess sysmaster
select d.name,d.pagesize, t.fname,t.chksize,t.nfree
from syschunks t,sysdbspaces d
where t.dbsnum=d.dbsnum and d.is_temp=1 order by 1;
d.name, d.pagesize, t.fname,
t.chksize,t.nfree
tmpdbs01 2048 /opt/dbschk/tmpchk01 1000000 147
tmpdbs02 2048 /opt/dbschk/tmpchk02 1000000 39947
tmpdbs03 2048 /opt/dbschk/tmpchk03 1000000 439
tmpdbs04 2048 /opt/dbschk/tmpchk04 1000000 4947

onconfig DBSPACETEMP

temp dbspace

15

2010 IBM Corporation

Information Management Informix

temp dbspace2
C. onstat -d |grep TB
address number flags fchunk nchunks pgsize flags owner name
7b430600 5
0x42001 5
1
2048 N TB informix tmpdbs01
7b430798 6
0x42001 6
1
2048 N TB informix tmpdbs02
7b430930 7
0x42001 7
1
2048 N TB informix tmpdbs03
7b430ac8 8
0x42001 8
1
2048 N TB informix tmpdbs04
D. onstat -d |grep tmp
address chunk/dbs
7b432ac0 5
5 0
7b432cb0 6
6 0
7b433028 7
7 0
7b433218 8
8 0

offset size free


bpages flags pathname
1000000 147
PO-B- /opt/dbschk/tmpchk01
1000000 39947 PO-B- /opt/dbschk/tmpchk02
1000000 439
PO-B- /opt/dbschk/tmpchk03
1000000 4937
PO-B- /opt/dbschk/tmpchk04

onstat -d temp dbspace

instance 4 temp dbspace

temp dbspace 2GB

IDS temp dbspaces

16

2010 IBM Corporation

Information Management Informix

1
A. onstat -l
Physical Logging
Buffer bufused bufsize numpages numwrits pages/io
P-1 12
64
331813
6434
51.57
phybegin
physize phypos phyused %used
2:53
999500 30664
12
0.00
Logical Logging
Buffer bufused bufsize numrecs numpages numwrits recs/pages pages/io
L-2 0
64
1851858 209365
159898
8.8
55.3

address number flags uniqid begin


size
used %used
b2d47f00 15 U-B---- 566 3:250053 50000 50000 100.00
b2d47f68 16 U---C-L 567 3:300053 50000 23015 46.03
...
20 active, 20 total

17

2010 IBM Corporation

Information Management Informix

OLTP
100MB20-50

rootdbs

LOGBUFFLOGBUFF128pages/io
LOGBUFFpages/ioLOGBUFF75%
logical log buffer75%logical log buffer
75% logical log buffer

2GB
checkpoint

rootdbs

PHYSBUFFPHYSBUFF128pages/io
PHYSBUFFpages/ioPHYSBUFF75%
physical log buffer75%physical log buffer
75% physical log buffer

18

2010 IBM Corporation

Information Management Informix

Update Statistics
A. Get the actual row number per table
dbaccess -e dbname sqlfile.sql
Select count(*) from manufact; --1,000,000
Select count(*) from stock;
--100123
Select count(*) from customer; --10,000,028

B. Get the statistics row numbers in systable


select tabname,nrows from systables where tabid >99
tabname
manufact
stock
customer

nrows
9.0
100123.0
10000028.0

C. Contrast A, B results, determine which table does not promptly update statistics

HIGH
MEDIUMLOW

(task)
19

2010 IBM Corporation

Information Management Informix

Informix
(task)


Informix

20

2010 IBM Corporation

Information Management Informix

instance








(lock)
(Checkpoint)
Checkpoint duration
(Long Transaction)

21

2010 IBM Corporation

Information Management Informix

Instance 1
onstat -p
dskreads pagreads bufreads %cached dskwrits pagwrits bufwrits %cached
6924024 6960444 57054963 87.87 276611 368870
2581449 89.32
isamtot
open
start
read
write
rewrite delete commit rollbk
28117252 826169 1545943 19339955 720261 240523 170898 336161 34
gp_read gp_write gp_rewrt gp_del gp_alloc gp_free gp_curs
0
0
0
0
0
0
0
ovlock ovuserthread ovbuff usercpu syscpu numckpts flushes
1
0
0
1481.63 89.86 54
29
bufwaits lokwaits lockreqs deadlks dltouts ckpwaits compress seqscans
207092
179
89705878 0
0
5
66122
60111
ixda-RA idx-RA da-RA
RA-pgsused lchwaits
500
97
5730949 5727768
186142

22

2010 IBM Corporation

Information Management Informix

Instance 2

23

%cached : (page)OLTP
95%%cachedBUFFERPOOL
IDSBUFFER

seqscans isamtot : seqscans / cisamtot 1%IDS

bufwaits(buffer)
pagepagebuffer
pagebufferbufwaitspage
LRU_MIN0pagebufferflush
bufwaits

ovbuffIDS(buffer)IDS
ovbuffer100000
BUFFERPOOLIDSBUFFERovbuff
IDS

2010 IBM Corporation

Information Management Informix

Instance 3

rollbk / commit rollbk / commit 1%


lokwaits / lockreqs

lokwaits

lockreqs

lokwaits / lockreqs

ovlockIDS15ovlock0IDS
15ovlockIDS15ovlock0
onconfigLOCKS

deadlks1deadlks1

24

2010 IBM Corporation

Information Management Informix

(lock)
Partition Profiles

onstat -g ppf
partnum lkrqs lkwts dlks
0x100123 8698 0
0
0x100124 4660 322 31
0x100125 1366 0
0
0x100126 1015 0
0
0x100127 771 0
0
0x100128 506 0
0

touts isrd
0
3163
53
6553
0
652
0
65
251 110
0
72

iswrt
243
3797
210
306
0
357

isrwt isdel
242 62
148 964
148 62
0
111
0
139
0
0

bfrd bfwrt seqsc rhitratio


12209 1219 3 100
41278 11832 0 100
3850 1138 1 100
5330 1410 1 100
0
1380 0 100
1207 778
0 100

(lock)?

lkrqs

lkwts

dlks

touts (remote deadlock timeout)

partnum

25

2010 IBM Corporation

Information Management Informix

Checkpoint
A grep Checkpoint online.log
16:28:31
used 440
16:33:32
16:33:32
used 12
16:38:32

Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used 69, Llog
Checkpoint Completed: duration was 60 seconds.
Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used 1152, Llog
Checkpoint Completed: duration was 0 seconds.

Bonstat -g ckp
IDS11.x Non-Blocking Checkpoit

checkpoint duration

(IDS11.5)

AUTO_CKPTS

AUTO_LRU_TUNNING

LRU_MIN_DIRTY, LRU_MAX_DIRTY

CKPINTVL, LRUS, CLEANERS, NUMAIOVPS


26

2010 IBM Corporation

Information Management Informix

1
Agrep Long Transaction online.log|wc -l
13

BMonitor long trunsaction


onstat IBM Informix 9.40.FC7 On-Line (LONGTX) -- Up 35 days 16:41:40 -- 3920896 Kbytes
onstat -x
1cf0a6748 A-R-- 1cd55c618 642073 119403 119405 0x1aa91e4 DIRTY 0
onstat -u |grep 1cd55c618
1cd55c618
--RPX-- 1880841 informix - 0
onstat -g ses 1880841

27

642073 256446 323049

2010 IBM Corporation

Information Management Informix

(long transaction)

LTXHWM : (transaction)
LTXHWMIDS

LTXEHWM : (transaction)
LTXEHWMIDS

DYNAMIC_LOGSIDS
DYNAMIC_LOGS2IDS
DYNAMIC_LOGS1IDS
DBADYNAMIC_LOGS0
IDS

28

2010 IBM Corporation

Information Management Informix

Informix
(task)


Informix

29

2010 IBM Corporation

Information Management Informix

I/O

extent

30

2010 IBM Corporation

Information Management Informix

I/O
Adbaccess sysmaster
select dbsname, tabname,
(isreads + pagreads) diskreads, (iswrites + pagwrites) diskwrites,
(isreads + pagreads)+ (iswrites + pagwrites) disk_rsws
from sysmaster:sysptprof
where tabname not like 'sys% and dbsname not like 'sys%'
order by 5 desconstat -D
dbsname tabname
demodb customer
demodb orders
demodb stock
demodb test_cn

diskreads
53793
4397
42152
589

diskwrites
0
31112
201
11000

disk_rsws
53793
35509
42353
11589

I/O

dbspaceI/O

31

2010 IBM Corporation

Information Management Informix

Adbaccess dbname
Select tabname,nrows,
(npused*pagesize)/1024/1024 used_space_m
from systables
where nrows> 1000000 order by 2 desc
tabname
orders
customer
cust_calls
test_cn
t_fragment_test

nrows
50000000
10000041
4318028.0
4194304.0
1788486.0

used_space_m
4069.015625
1395.099609375
2811.21875
32.638671875
1164.380859375

1500MB

32

2010 IBM Corporation

Information Management Informix

extent
Adbaccess dbname
select dbsname, tabname, count(*) num_of_extents, sum( pe_size ) total_size
from sysmaster:systabnames, sysmaster:sysptnext
where partnum = pe_partnum and dbsname="demodb" and tabname not like 'sys%'
group by 1, 2 having count(*)>50 order by 3 desc
dbsname tabname num_of_extents total_size
demodb cust_calls2
156
220408
demodb cust_calls
140
1515552
demodb orders_sum
132
70008

extent50
extent size next size

extent

33

2010 IBM Corporation

Information Management Informix

Adbaccess dbname
select t.tabname,i.idxname, i.levels from sysindexes i, systables t
where i.tabid = t.tabid and i.levels>=4 order by 3 desc;

tabname
orders_sum
orders
cust_calls
customer
cust_calls
cust_calls

idxname
117_29
112_16
111_19
110_13
111_20
111_15

levels
5
4
4
4
4
4

34

2010 IBM Corporation

Information Management Informix

Adbaccess dbname
select p.dbsname , t.tabname , sum(p.seqscans) seqscans , max(t.nrows) nrows
from sysmaster:sysptprof p , systables t where p.tabname = t.tabname and t.nrows >
100 and p.seqscans>0 and p.dbsname not like "sys%" and p.tabname not like "sys%"
group by 1,2 order by 3 desc;
dbname
demodb
demodb
demodb
demodb

tabname
stock
test_cn
state
items

seqscans nrows
3102
10
132
9882121288
121
45276
11
1324552

(sequential scan)

stock

test_cn

35

2010 IBM Corporation

Information Management Informix

IDS





36

Slide 36

2010 IBM Corporation

Information Management Informix

Instance

(lock)
Checkpoint
Checkpoint duration

Long Transaction

I/O

extent

37

2010 IBM Corporation

Information Management Informix

38

2010 IBM Corporation

Information Management Informix

39

2010 IBM Corporation

Вам также может понравиться