Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lester Knutsen
President and Principle Database Consultant
Advanced DataTools Corporation
Session: K4
May 24, 2005
Control Structures
Sysmaster Database
Dictionary cache
Working Storage
Sort Space
Page
3
Server information
Dbspace & chunk information
Database & table information
Use session information
Performance of queries on
sysmaster database
The data is in shared memory but:
10
10
11
11
12
12
13
14
14
15
15
sysconfig
syslogs
sysprofile
sysvpprof
- ONCONFIG File
- Logical Logs
- Server Statistics
- Virtual Processors
16
16
17
17
parameter,
effective_value
18
18
SQL output
parameter
ROOTNAME
ROOTPATH
DBSERVERNAME
MIRRORPATH
PHYSDBS
MSGPATH
CONSOLE
TAPEDEV
LTAPEDEV
ROOTOFFSET
ROOTSIZE
effective_value
rootdbs
/u3/dev/rootdbs1
train1
/u3/dev/rootdbsm1
rootdbs
/u3/informix7/online1.log
/u3/informix7/console1.log
/dev/null
/dev/null
0
400000
19
19
20
20
21
21
SQL output
uniqid size_used
32
1000
33
1000
34
1000
35
1000
36
1000
37
1000
38
1000
39
1000
40
1000
41
1000
42
1000
22
22
char(16),
integer
23
bufreads
isopens
isrewrites
ovlock
buffwts
deadlks
plgwrites
pagreads
fgwrites
btraidx
totalsorts
dskwrites
isstarts
isdeletes
ovuser
lockreqs
lktouts
llgrecs
pagwrites
lruwrites
dpra
memsorts
bufwrites
isreads
iscommits
ovtrans
lockwts
numckpts
llgpagewrites
flushes
chunkwrites
rapgs_used
disksorts
24
24
Sysprofile - onstat -p
Informix Dynamic Server Version 9.30.TC2-- On-Line -- Up 00:10:24
58496 Kbytes
Profile
dskreads pagreads bufreads %cached dskwrits pagwrits bufwrits %cached
350
372
2108
83.40
10
11
1
0.00
isamtot open
start
read
write
rewrite delete
commit
rollbk
2839
94
122
457
0
0
0
0
0
gp_read gp_write gp_rewrt gp_del
gp_alloc gp_free gp_curs
2
0
0
0
0
0
2
ovlock
ovuserthread ovbuff
usercpu syscpu
numckpts flushes
0
0
0
3.93
0.87
2
6
bufwaits lokwaits lockreqs deadlks dltouts ckpwaits compress seqscans
67
0
966
0
0
0
0
4
ixda-RA idx-RA
da-RA
RA-pgsused lchwaits
5
0
247
252
0
25
25
26
26
SQL output
name
ovlock
ovuser
ovtrans
latchwts
buffwts
lockwts
ckptwts
deadlks
lktouts
fgwrites
lruwrites
chunkwrites
value
0
0
0
41
1617
0
12
0
0
1190
21430
4648
27
27
28
28
SQL output
dskreads
29209
bufreads
1489235
dskwrites bufwrites
56228
414748
cached
98.04
cached
86.44
29
29
integer,
char(50)
float,
float
VP id
VP class name
number of unix secs of user time
number of unix secs of system
time
30
30
31
SQL output
vpid
1
2
3
4
5
6
7
8
9
pid class
295 cpu
296 adm
297 lio
298 pio
299 aio
300 msc
301 aio
302 tli
305 pio
usercpu
syscpu
309.26
0.14
0.27
0.15
5.00
0.04
4.65
0.14
0.22
23.58
0.36
5.57
1.49
46.16
0.24
43.75
0.30
1.56
32
32
33
33
sysdbspaces - DB Spaces
syschunks
- Chunks
syschkio
- I/O by Chunk
syschfree*
- Free Space by Chunk
34
34
35
35
36
36
Syschunks (continued)
is_inconsistent
flags
fname
mfname
moffset
mis_offline
mis_recovering
bitval,
smallint,
char(128),
char(128),
integer,
bitval,
bitval,
mflags
smallint
37
37
38
38
Syschfree*
Table syschfree: Lists free space on a chunk
chknum
extnum
start
leng
integer,
integer,
integer,
integer
chunk number
extent number in chunk
physical addr of start
length of extent
39
39
40
40
SQL output
dbspace
pages_size
rootdbs
logsdbs
datadbs
tmpdbs
20000
12500
25000
12500
pages_used
pages_free
5653
12053
6722
53
14347
447
18278
12447
percent_free
71.74
3.58
73.11
99.58
41
41
Size_in_Pages,
-- sum of all chuncks size pages
Num_free_blob_page -- sum of all chunks free
pages
from
sysdbspaces d, syschunks c
where
d.dbsnum = c.dbsnum
and
d.is_blobspace = 1
group by 1
order by 1
42
42
SQL output
dbspace
blobdbs
size_in_pages
10000
num_free_blob_page
2497
43
43
44
44
SQL output
dbspace
datadbs
datadbs
datadbs
datadbs
datadbs
datadbs
datadbs
datadbs
datadbs
datadbs
chknum
4
3
3
3
3
3
3
3
3
3
extnum
0
31
15
13
30
25
19
29
24
26
start
3
9107
1921
1705
6069
5429
4853
5909
5333
5621
free_pages
12497
3393
976
160
160
128
96
96
64
64
45
45
46
46
SQL output
dbspace chknum chktype
blobdbs
6
Primary
datadbs
3
Primary
datadbs
4
Primary
logsdbs
2
Primary
rootdbs
1
Mirror
rootdbs
1
Primary
tmpdbs
5
Primary
reads
21
2082
5
176
11616
13340
13
47
47
48
48
SQL output
dbspace
dbsnum
is_mirrored
is_blobspace
is_temp
chunknum
device
dev_offset
is_offline
is_recovering
is_blobchunk
is_inconsistent
pages_size
pages_free
mirror_device
mirror_offset
rootdbs
1
1
0
0
1
/u3/dev/rootdbs1
0
0
0
0
0
20000
14355
/u3/dev/rootdbsm1
0
49
49
sysdatabases
systabnames
sysextents
sysptprof
systabinfo*
- Databases
- Tables
- Tables extents
- Tables I/O
- Tables information
50
50
Sysdatabases
View sysdatabases: List of databases on the server.
name
char(18),
database name
partnum
integer,
table id for systables
owner
char(8),
user name of creator
created
integer,
date created
is_logging
bitval,
unbuffered logging, 1=Yes, 0=No
is_buff_log
bitval,
buffered logging, 1=Yes, 0=No
is_ansi
bitval,
ANSI mode database, 1=Yes, 0=No
is_nls
bitval,
NLS support, 1=Yes, 0=No
flags
smallint
logging flags
51
51
Systabnames
Table systabnames: All tables on the server.
partnum
dbsname
owner
tabname
collate
integer,
char(18),
char(8),
char(18),
char(32)
52
52
char(18),
char(18),
integer,
integer
database name
table name
physical address for this extent
size of this extent
53
53
Sysptprof
View sysptprof:
dbsname
tabname
partnum
lockreqs
lockwts
deadlks
lktouts
isreads
iswrites
isrewrites
Tables IO profile.
char(18),
char(18),
integer,
integer,
integer,
integer,
integer,
integer,
integer,
integer,
database name
table name
partnum for this table
lock requests
lock waits
deadlocks
lock timeouts
reads
writes
rewrites
54
54
Sysptprof (continued)
isdeletes
bufreads
bufwrites
seqscans
pagreads
pagwrites
integer,
integer,
integer,
integer
integer,
integer
deletes
buffer reads
buffer writes
sequential scans
disk reads
disk writes
55
55
Systabinfo*
View systabinfo: Table information
ti_partnum
integer,
table's partnum
ti_flags
smallint,
partition flags
ti_rowsize
smallint,
rowsize (max for variable)
ti_ncols
smallint,
number of varchar or blob columns
ti_nkeys
smallint,
number of indexes
ti_nextns
smallint,
number of extents
ti_created
integer,
date created
ti_serialv
integer,
current serial value
ti_fextsiz
integer,
first extent size ( in pages )
ti_nextsiz
integer,
next extent size ( in pages )
ti_nptotal
integer,
number of pages allocated
56
56
Systabinfo* (continued)
ti_npused
ti_npdata
ti_octptnm
ti_nrows
integer,
integer,
integer,
integer
57
57
58
58
SQL output
dbspace
datadbs
datadbs
datadbs
rootdbs
rootdbs
rootdbs
rootdbs
rootdbs
rootdbs
rootdbs
database
extentdb2
zip1
zip_lk
extentdb
extentdb1
onpload
stores1
stores2
stores7
sysmaster
59
59
60
60
61
61
SQL output
dbsname
zip7
zip_lk
rootdbs
sysmaster
datadbs
sysmaster
sysmaster
sysmaster
extentdb1
sysutils
sysmaster
stores2
tabname
zip
zip
TBLSpace
syscolumns
TBLSpace
sysviews
sysprocbody
systables
extent_sizes
sysprocbody
sysconstraints
sysprocbody
num_of_extents
50
27
8
6
4
3
3
3
2
2
2
2
total_size
1168
1544
400
56
200
24
24
24
24
16
16
16
62
62
63
SQL output
dbsname
tabname
num_of_extents
current_pages_used
proposed_ext_size
proposed_next_size
zip7
zip
50
1168
2803
467
dbsname
tabname
num_of_extents
current_pages_used
proposed_ext_size
proposed_next_size
zip_lk
zip
27
1544
3706
618
64
64
65
65
SQL output
dbsname
zip
sysmaster
sysmaster
sysmaster
sysmaster
zip_lk
sysmaster
sysmaster
sysmaster
sysmaster
zip
sysmaster
tabname
zip
systables
sysusers
sysviews
sysprocauth
zip
sysprocedures
syscolumns
sysdatabases
flags_text
systables
systabauth
isreads
41898
11402
10276
2653
2212
1399
1108
872
538
450
101
86
iswrites
41898
0
315
0
0
0
0
0
3
0
34
0
lockreqs
830
67187
51373
15919
13272
1
6649
5182
1469
2546
239
536
66
66
dbsname,
tabname,
sum(seqscans) total_scans
from sysptprof
where
seqscans > 0
group
by 1, 2
order
by 3 desc
67
67
syssessions
syssesprof
syslocks
syseswts
- Session data
- User statistics
- Locks
- Wait times
68
68
Syssessions
(onstat -g ses)
View syssessions: User session and connection information.
sid
integer,
Session id number
username
char(8),
User name
uid
smallint,
User unix id
pid
integer,
User process id
hostname
char(16),
Hostname
tty
char(16),
TTY port
connected
integer,
Time user connected
feprogram
char(16),
Program name
pooladdr
integer,
Pointer to private session pool
69
69
Syssessions (continued)
is_wlatch
is_wlock
is_wbuff
is_wckpt
is_wlogbuf
is_wtrans
is_monitor
is_incrit
state
integer,
integer,
integer,
integer,
integer,
integer,
integer,
integer,
integer
70
70
Syssesprof
(onstat -g ses)
View sysyesprof: User session performance statistics.
sid
integer,
Session Id
lockreqs
decimal(16,0),
Locks requested
locksheld
decimal(16,0),
Locks held
lockwts
decimal(16,0),
Locks waits
deadlks
decimal(16,0)
Deadlocks detected
lktouts
decimal(16,0),
Deadlock timeouts
logrecs
decimal(16,0),
Logical Log records written
isreads
decimal(16,0),
Reads
iswrites
decimal(16,0),
Writes
isrewrites
decimal(16,0),
Rewrites
isdeletes
decimal(16,0),
Deletes
71
71
Syssesprof (continued)
iscommits
isrollbacks
longtxs
bufreads
bufwrites
seqscans
pagreads
pagwrites
total_sorts
dsksorts
max_sortdiskspace
logspused
maxlogsp
decimal(16,0),
decimal(16,0),
decimal(16,0),
decimal(16,0),
decimal(16,0),
decimal(16,0),
decimal(16,0),
decimal(16,0),
decimal(16,0),
decimal(16,0),
decimal(16,0),
decimal(16,0),
decimal(16,0)
Commits
Rollbacks
Long transactions
Buffer reads
Buffer writes
Sequential scans
Page reads
Page writes
Total sorts
Sorts to disk
Max space used by a sort
Current log bytes used
Max bytes of logical logs used
72
72
73
73
74
74
Syseswts
View sysseswts: Wait status and times on objects.
sid
reason
numwaits
cumtime
maxtime
integer,
char(50),
integer,
float,
integer
Session ID
Description of reason for wait
Number of waits for this reason
Cumulative wait time for this reason
Max wait time for this reason
75
75
sysdatabases.name database,
-- Database Name
syssessions.username,
-- User Name
syssessions.hostname,
-- Workstation
syslocks.owner sid
-- Informix Session ID
from syslocks, sysdatabases , outer syssessions
where syslocks.tabname = "sysdatabases -- Locks on sysdatabases
and
syslocks.rowidlk = sysdatabases.rowid -- Join to database
and
syslocks.owner = syssessions.sid
-- Use session ID
order by 1;
76
76
77
77
pid
11564
hostname
merlin
startdate
07/14/1997
78
78
79
80
80
81
81
82
82
83
83
84
84
85
Lester Knutsen
Advanced DataTools Corporation
Lester@advancedatatools.com
86
86