分类: DB2/Informix
2008-08-01 10:17:21
按照事先规划创建表空间:
rx8640-2:/home/db/informix/etc/> onspaces -c -d indxdbs01 -p /home/db/informix/dbs/idxchunk0 -o 100 -s 1000000
rx8640-2:/home/db/informix/etc/> onspaces -c -d logdbs01 -p /home/db/informix/dbs/logchunk0 -o 100 -s 1000000
rx8640-2:/home/db/informix/etc/> onspaces -c -d phydbs01 -p /home/db/informix/dbs/phychunk0 -o 100 -s 1000000
rx8640-2:/home/db/informix/etc/> onspaces -c -d tmpdbs01 -t -p /home/db/informix/dbs/tmpchunk1 -o 100 -s 1000000
rx8640-2:/home/db/informix/etc/> onspaces -c -d tmpdbs02 -t -p /home/db/informix/dbs/tmpchunk2 -o 100 -s 1000000
rx8640-2:/home/db/informix/etc/> onspaces -c -d tmpdbs03 -t -p /home/db/informix/dbs/tmpchunk3 -o 100 -s 1000000
rx8640-2:/home/db/informix/etc/> onspaces -c -d workdbs01 -p /home/db/informix/dbs/workchunk0 -o 100 -s 2000000
rx8640-2:/home/db/informix/etc/> onspaces -c -d workdbs02 -p /home/db/informix/dbs/workchunk1 -o 100 -s 2000000
rx8640-2:/home/db/informix/etc/> onspaces -c -d workdbs03 -p /home/db/informix/dbs/workchunk2 -o 100 -s 2000000
rx8640-2:/home/db/informix/etc/> onspaces -c -d workdbs04 -p /home/db/informix/dbs/workchunk3 -o 100 -s 2000000
rx8640-2:/home/db/informix/etc/> onspaces -c -d workdbs05 -p /home/db/informix/dbs/workchunk4 -o 100 -s 2000000
rx8640-2:/home/db/informix/etc/> onstat -d
IBM Informix Dynamic Server Version 9.40.FC7 -- On-Line -- Up 00:30:34 -- 432024 Kbytes
Dbspaces
address number flags fchunk nchunks flags owner name
c000000008cbb030 1 0x60001 1 1 N B informix rootdbs
c000000009c4eb00 2 0x60001 2 1 N B informix indxdbs01
c000000009c39110 3 0x60001 3 1 N B informix logdbs01
c000000009c396e0 4 0x60001 4 1 N B informix phydbs01
c000000009c39cb0 5 0x42001 5 1 N TB informix tmpdbs01
c000000009c3a410 6 0x42001 6 1 N TB informix tmpdbs02
c000000009c3ab70 7 0x42001 7 1 N TB informix tmpdbs03
c000000009c62090 8 0x60001 8 1 N B informix workdbs01
c000000009c625b0 9 0x60001 9 1 N B informix workdbs02
c000000009c62b80 10 0x60001 10 1 N B informix workdbs03
c000000009c700f0 11 0x60001 11 1 N B informix workdbs04
11 active, 2047 maximum
Chunks
address chunk/dbs offset size free bpages flags pathname
c000000008cbb1e0 1 1 0 500000 245816 PO-B /home/db/informix/dbs/rootchunk0
c000000009c4ecb0 2 2 50 1000000 999947 PO-B /home/db/informix/dbs/idxchunk0
c000000009c392c0 3 3 50 500000 9947 PO-B /home/db/informix/dbs/logchunk0
c000000009c39890 4 4 50 500000 499947 PO-B /home/db/informix/dbs/phychunk0
c000000009c39e60 5 5 50 500000 499947 PO-B /home/db/informix/dbs/tmpchunk1
c000000009c3a5c0 6 6 50 500000 499947 PO-B /home/db/informix/dbs/tmpchunk2
c000000009c3ad20 7 7 50 500000 499947 PO-B /home/db/informix/dbs/tmpchunk3
c000000009c62240 8 8 50 1000000 999947 PO-B /home/db/informix/dbs/workchunk0
c000000009c62760 9 9 50 1000000 999947 PO-B /home/db/informix/dbs/workchunk1
c000000009c62d30 10 10 50 1000000 999947 PO-B /home/db/informix/dbs/workchunk2
c000000009c702a0 11 11 50 1000000 999947 PO-B /home/db/informix/dbs/workchunk3
11 active, 32766 maximum
Expanded chunk capacity mode: always
将日志文件分段(以20MB为单位):
rx8640-2:/home/db/informix/etc/> onparams -a -d logdbs01 -s 20000
Logical log successfully added.
执行50次后提示不能继续划分。
查看日志文件划分情况:
rx8640-2:/home/db/informix/bin/> onstat -l
IBM Informix Dynamic Server Version 9.40.FC7 -- On-Line -- Up 16:41:26 -- 432024 Kbytes
Physical Logging
Buffer bufused bufsize numpages numwrits pages/io
P-2 0 16 741 83 8.93
phybegin physize phypos phyused %used
1:263 499500 824 0 0.00
Logical Logging
Buffer bufused bufsize numrecs numpages numwrits recs/pages pages/io
L-3 0 16 42902 3101 1241 13.8 2.5
Subsystem numrecs Log Space used
OLDRSAM 42902 4527152
address number flags uniqid begin size used %used
c0000000094c0110 1 U-B---- 1 1:499763 1000 1000 100.00
c0000000094c0180 2 U-B---- 2 1:500763 1000 1000 100.00
c0000000094c01f0 3 U-B---- 3 1:501763 1000 1000 100.00
c0000000094c0260 4 U---C-L 4 1:502763 1000 101 10.10
c0000000094c02d0 5 A------ 0 1:503763 1000 0 0.00
c0000000094c0340 6 A------ 0 1:504763 1000 0 0.00
c0000000095d9110 7 A------ 0 3:53 10000 0 0.00
c0000000095d9180 8 A------ 0 3:10053 10000 0 0.00
c0000000095d91f0 9 A------ 0 3:20053 10000 0 0.00
c0000000095d9260 10 A------ 0 3:30053 10000 0 0.00
c0000000095d92d0 11 A------ 0 3:40053 10000 0 0.00
c0000000095d9340 12 A------ 0 3:50053 10000 0 0.00
c0000000095d93b0 13 A------ 0 3:60053 10000 0 0.00
c0000000095d9420 14 A------ 0 3:70053 10000 0 0.00
c0000000095d9490 15 A------ 0 3:80053 10000 0 0.00
c0000000095d9500 16 A------ 0 3:90053 10000 0 0.00
c0000000095d9570 17 A------ 0 3:100053 10000 0 0.00
c0000000095d95e0 18 A------ 0 3:110053 10000 0 0.00
c0000000095d9650 19 A------ 0 3:120053 10000 0 0.00
c0000000095d96c0 20 A------ 0 3:130053 10000 0 0.00
c0000000095d9730 21 A------ 0 3:140053 10000 0 0.00
c0000000095d97a0 22 A------ 0 3:150053 10000 0 0.00
c0000000095d9810 23 A------ 0 3:160053 10000 0 0.00
c0000000095d9880 24 A------ 0 3:170053 10000 0 0.00
c0000000095d98f0 25 A------ 0 3:180053 10000 0 0.00
c0000000095d9960 26 A------ 0 3:190053 10000 0 0.00
c0000000095d99d0 27 A------ 0 3:200053 10000 0 0.00
c0000000095d9a40 28 A------ 0 3:210053 10000 0 0.00
c0000000095d9ab0 29 A------ 0 3:220053 10000 0 0.00
c0000000095d9b20 30 A------ 0 3:230053 10000 0 0.00
30 active, 30 total
rx8640-2:/home/db/informix/bin/> onmode -l
rx8640-2:/home/db/informix/bin/> onmode -l
rx8640-2:/home/db/informix/bin/> onmode -l
rx8640-2:/home/db/informix/bin/> ontape -s -L 0
Archive to tape device '/dev/null' is complete.
Program over.
rx8640-2:/home/db/informix/bin/> onmode -c
rx8640-2:/home/db/informix/bin/> onparams -d -l 1 -y
Logical log file 1 has been pre-dropped.
It will be deleted from the log list and its space can be reused
once you take level 0 archives of all BLOBspaces, Smart BLOBspaces
and non-temporary DBspaces.
rx8640-2:/home/db/informix/bin/> onparams -d -l 2 -y
Logical log file 2 has been pre-dropped.
It will be deleted from the log list and its space can be reused
once you take level 0 archives of all BLOBspaces, Smart BLOBspaces
and non-temporary DBspaces.
rx8640-2:/home/db/informix/bin/> onparams -d -l 3 -y
Logical log file 3 has been pre-dropped.
It will be deleted from the log list and its space can be reused
once you take level 0 archives of all BLOBspaces, Smart BLOBspaces
and non-temporary DBspaces.
rx8640-2:/home/db/informix/> onstat -l
IBM Informix Dynamic Server Version 9.40.FC7 -- On-Line -- Up 00:16:47 -- 432024 Kbytes
Physical Logging
Buffer bufused bufsize numpages numwrits pages/io
P-2 0 16 1016 124 8.19
phybegin physize phypos phyused %used
1:263 250000 1140 0 0.00
Logical Logging
Buffer bufused bufsize numrecs numpages numwrits recs/pages pages/io
L-1 0 16 43103 3158 1299 13.6 2.4
Subsystem numrecs Log Space used
OLDRSAM 43103 4577584
address number flags uniqid begin size used %used
c000000009998110 1 D------ 0 1:250263 500 0 0.00
c000000009998180 2 D------ 0 1:250763 500 0 0.00
c0000000099981f0 3 D------ 0 1:251263 500 0 0.00
c000000009d1f110 4 U---C-L 10 3:53 10000 5 0.05
c000000009d1f180 5 A------ 0 3:10053 10000 0 0.00
c000000009d1f1f0 6 A------ 0 3:20053 10000 0 0.00
c000000009d1f260 7 A------ 0 3:30053 10000 0 0.00
c000000009d1f2d0 8 A------ 0 3:40053 10000 0 0.00
c000000009d1f340 9 A------ 0 3:50053 10000 0 0.00
c000000009d1f3b0 10 A------ 0 3:60053 10000 0 0.00
c000000009d1f420 11 A------ 0 3:70053 10000 0 0.00
c000000009d1f490 12 A------ 0 3:80053 10000 0 0.00
c000000009d1f500 13 A------ 0 3:90053 10000 0 0.00
c000000009d1f570 14 A------ 0 3:100053 10000 0 0.00
c000000009d1f5e0 15 A------ 0 3:110053 10000 0 0.00
c000000009d1f650 16 A------ 0 3:120053 10000 0 0.00
c000000009d1f6c0 17 A------ 0 3:130053 10000 0 0.00
c000000009d1f730 18 A------ 0 3:140053 10000 0 0.00
c000000009d1f7a0 19 A------ 0 3:150053 10000 0 0.00
c000000009d1f810 20 A------ 0 3:160053 10000 0 0.00
c000000009d1f880 21 A------ 0 3:170053 10000 0 0.00
c000000009d1f8f0 22 A------ 0 3:180053 10000 0 0.00
c000000009d1f960 23 A------ 0 3:190053 10000 0 0.00
c000000009d1f9d0 24 A------ 0 3:200053 10000 0 0.00
c000000009d1fa40 25 A------ 0 3:210053 10000 0 0.00
c000000009d1fab0 26 A------ 0 3:220053 10000 0 0.00
c000000009d1fb20 27 A------ 0 3:230053 10000 0 0.00
c000000009d1fb90 28 A------ 0 3:240053 10000 0 0.00
c000000009d1fc00 29 A------ 0 3:250053 10000 0 0.00
c000000009d1fc70 30 A------ 0 3:260053 10000 0 0.00
c000000009d1fce0 31 A------ 0 3:270053 10000 0 0.00
c000000009d1fd50 32 A------ 0 3:280053 10000 0 0.00
c000000009d1fdc0 33 A------ 0 3:290053 10000 0 0.00
c000000009d1fe30 34 A------ 0 3:300053 10000 0 0.00
c000000009d1fea0 35 A------ 0 3:310053 10000 0 0.00
c000000009d1ff10 36 A------ 0 3:320053 10000 0 0.00
c000000009d1ff80 37 A------ 0 3:330053 10000 0 0.00
c000000009c62f80 38 A------ 0 3:340053 10000 0 0.00
c000000009c70610 39 A------ 0 3:350053 10000 0 0.00
c000000009c70680 40 A------ 0 3:360053 10000 0 0.00
c000000009c706f0 41 A------ 0 3:370053 10000 0 0.00
c000000009c70760 42 A------ 0 3:380053 10000 0 0.00
c000000009c707d0 43 A------ 0 3:390053 10000 0 0.00
c000000009c70840 44 A------ 0 3:400053 10000 0 0.00
c000000009c708b0 45 A------ 0 3:410053 10000 0 0.00
c000000009c70920 46 A------ 0 3:420053 10000 0 0.00
c000000009c70990 47 A------ 0 3:430053 10000 0 0.00
c000000009c70a00 48 A------ 0 3:440053 10000 0 0.00
c000000009c70a70 49 A------ 0 3:450053 10000 0 0.00
c000000009c70ae0 50 A------ 0 3:460053 10000 0 0.00
c000000009c70b50 51 A------ 0 3:470053 10000 0 0.00
c000000009c70bc0 52 A------ 0 3:480053 10000 0 0.00
49 active, 52 total
把数据库实例从联机状态改为静止状态:
rx8640-2:/home/db/informix/bin/> onmode -s
This will perform a GRACEFUL SHUTDOWN -
Do you wish to continue (y/n)? y
将onconfig.front配置文件中PHYDBS对应的参数由rootdbs改为phydbs01:
rx8640-2:/home/db/informix/bin/> onparams -p -d phydbs01 -s 500000 -y
Shutting down, please wait ...
Initializing, please wait ...
Recovering, please wait ...
把数据库实例从静止状态重新改为联机状态:
rx8640-2:/home/db/informix/bin/> onmode –m