Partn - Informix
O Partn converte para uma linguagem humana os endereços das partnum/tblsnum dos comandos onstat para database:owner.table; Há muitas opções de onstat que exibem um partNum/tblnum em sua saída. É útil para traduzi-los em algo que um humano pode ler.
Exemplo 1 - Comando do Informix
[s106:informix]$/export/home/informix/utils2/partn-2.0> onstat -T | more
IBM Informix Dynamic Server Version 11.70.FC2 -- On-Line -- Up 31 days 07:16:24 -- 9901824 Kbytes
Tblspaces
n address flgs ucnt tblnum physaddr npages nused npdata nrows nextns
1 163d444c0 8 0 5 0:0 0 0 0 0 0
2 16da5d5f8 8 0 6 0:0 0 0 0 0 0
3 1a596b510 8 0 a 0:0 0 0 0 0 0
4 1782c6588 8 0 c 0:0 0 0 0 0 0
5 1782c60f0 8 0 f 0:0 0 0 0 0 0
6 15e3b84c0 8 0 14 0:0 0 0 0 0 0
7 167f08028 8 0 15 0:0 0 0 0 0 0
8 16175b2a0 8 0 17 0:0 0 0 0 0 0
9 16175b738 8 0 18 0:0 0 0 0 0 0
10 16175bbd0 8 0 19 0:0 0 0 0 0 0
11 15ec489c0 8 0 1a 0:0 0 0 0 0 0
12 167f28028 8 0 1b 0:0 0 0 0 0 0
13 1ec31db68 8 0 1c 0:0 0 0 0 0 0
14 167f06028 8 0 1f 0:0 0 0 0 0 0
15 15fe02388 8 0 23 0:0 0 0 0 0 0
16 161c8c288 8 0 26 0:0 0 0 0 0 0
17 1a596b028 8 0 28 0:0 0 0 0 0 0
18 16ce78028 8 0 2a 0:0 0 0 0 0 0
19 1a18baa48 8 0 32 0:0 0 0 0 0 0
20 177ee6378 8 0 42 0:0 0 0 0 0 0
Exemplo 1 - Comando do Informix usando o Partn[s106:informix]$/export/home/informix/utils2/partn-2.0> onstat -T | ./partn -xk5 | head -30
IBM Informix Dynamic Server Version 11.70.FC2 -- On-Line -- Up 31 days 07:17:35 -- 9901824 Kbytes
Tblspaces
n address flgs ucnt tblnum physaddr npages nused npdata nrows nextns
1 163d444c0 8 0 5 0:0 0 0 0 0 0 sysmaster:informix.syschfree
2 16da5d5f8 8 0 6 0:0 0 0 0 0 0 sysmaster:informix.syscfgtab
3 1a596b510 8 0 a 0:0 0 0 0 0 0 sysmaster:informix.sysptnhdr
4 1782c6588 8 0 c 0:0 0 0 0 0 0 sysmaster:informix.sysptnext
5 1782c60f0 8 0 f 0:0 0 0 0 0 0 sysmaster:informix.systabnames
6 15e3b84c0 8 0 14 0:0 0 0 0 0 0 sysmaster:informix.sysptntab
7 167f08028 8 0 15 0:0 0 0 0 0 0 sysmaster:informix.syslcktab
8 16175b2a0 8 0 17 0:0 0 0 0 0 0 sysmaster:informix.sysdbstab
9 16175b738 8 0 18 0:0 0 0 0 0 0 sysmaster:informix.syschktab
10 16175bbd0 8 0 19 0:0 0 0 0 0 0 sysmaster:informix.sysmchktab
11 15ec489c0 8 0 1a 0:0 0 0 0 0 0 sysmaster:informix.sysrstcb
12 167f28028 8 0 1b 0:0 0 0 0 0 0 sysmaster:informix.systxptab
13 1ec31db68 8 0 1c 0:0 0 0 0 0 0 sysmaster:informix.syslogfil
14 167f06028 8 0 1f 0:0 0 0 0 0 0 sysmaster:informix.sysshmhdr
15 15fe02388 8 0 23 0:0 0 0 0 0 0 sysmaster:informix.sysplog
16 161c8c288 8 0 26 0:0 0 0 0 0 0 sysmaster:informix.sysshmvals
17 1a596b028 8 0 28 0:0 0 0 0 0 0 sysmaster:informix.sysscblst
18 16ce78028 8 0 2a 0:0 0 0 0 0 0 sysmaster:informix.sysvplst
19 1a18baa48 8 0 32 0:0 0 0 0 0 0 sysmaster:informix.sysmgminfo
20 177ee6378 8 0 42 0:0 0 0 0 0 0 sysmaster:informix.sysopendb
Exemplo 2 - Comando do Informix[s106:informix]$/export/home/informix/utils2/partn-2.0> onstat -P | head -30
IBM Informix Dynamic Server Version 11.70.FC2 -- On-Line -- Up 31 days 07:18:31 -- 9901824 Kbytes
Buffer pool page size: 2048
partnum total btree data other dirty
0 18909 0 4 18905 1
1048577 449 0 359 90 0
1048578 4 1 2 1 0
1048580 36 15 20 1 0
1048581 67 26 41 0 0
1048582 22 5 17 0 0
1048583 21 10 11 0 0
1048584 4 1 3 0 0
1048585 11 3 8 0 0
1048586 3 1 1 1 0
1048589 2 2 0 0 0
1048590 1 1 0 0 0
1048593 1 1 0 0 0
1048595 15 10 5 0 0
1048596 7 3 4 0 0
1048597 3 2 1 0 0
1048598 3 2 1 0 0
1048599 2 1 1 0 0
1048600 1 1 0 0 0
1048601 1 1 0 0 0
1048603 1 1 0 0 0
1048604 4 1 2 1 0
1048606 2 1 1 0 0
1048610 1 1 0 0 0
1048612 8 4 4 0 0
Exemplo 2 - Comando do Informix usando o Partn[s106:informix]$/export/home/informix/utils2/partn-2.0> onstat -P | ./partn | head -30
IBM Informix Dynamic Server Version 11.70.FC2 -- On-Line -- Up 31 days 07:18:11 -- 9901824 Kbytes
Buffer pool page size: 2048
partnum total btree data other dirty
0 18931 0 4 18927 1 UNUSED
1048577 449 0 359 90 0 informix.TBLSpace,rootdbs
1048578 4 1 2 1 0 sysmaster:informix.sysdatabases
1048580 36 15 20 1 0 sysmaster:informix.systables
1048581 67 26 41 0 0 sysmaster:informix.syscolumns
1048582 22 5 17 0 0 sysmaster:informix.sysindices
1048583 21 10 11 0 0 sysmaster:informix.systabauth
1048584 4 1 3 0 0 sysmaster:informix.syscolauth
1048585 11 3 8 0 0 sysmaster:informix.sysviews
1048586 3 1 1 1 0 sysmaster:informix.sysusers
1048589 2 2 0 0 0 sysmaster:informix.syssyntable
1048590 1 1 0 0 0 sysmaster:informix.sysconstraints
1048593 1 1 0 0 0 sysmaster:informix.sysdefaults
1048595 15 10 5 0 0 sysmaster:informix.sysprocedures
1048596 7 3 4 0 0 sysmaster:informix.sysprocbody
1048597 3 2 1 0 0 sysmaster:informix.sysprocplan
1048598 3 2 1 0 0 sysmaster:informix.sysprocauth
1048599 2 1 1 0 0 sysmaster:informix.sysblobs
1048600 1 1 0 0 0 sysmaster:informix.sysopclstr
1048601 1 1 0 0 0 sysmaster:informix.systriggers
1048603 1 1 0 0 0 sysmaster:informix.sysdistrib
1048604 4 1 2 1 0 sysmaster:informix.sysfragments
1048606 2 1 1 0 0 sysmaster:informix.sysxtdtypes
1048610 1 1 0 0 0 sysmaster:informix.syscolattribs
1048612 8 4 4 0 0 sysmaster:informix.syscasts
Requisitos
Partn precisa abrir conexões para todos os seus bancos de dados. Assim, é necessário que o usuário que esta rodando ele a permissão CONNECT com os bancos.
Building - Você necessita o esql/c para compilar.
Instalando
Descompactando
$ tar xvzf partn-2.0.tgz
./partn-2.0/
./partn-2.0/README.html
./partn-2.0/slurp.ec
./partn-2.0/slurp.h
./partn-2.0/partn.c
./partn-2.0/str_dup.c
./partn-2.0/partn_info.h
./partn-2.0/Makefile
./partn-2.0/hash.h
./partn-2.0/malloc_err.h
./partn-2.0/malloc_err.c
./partn-2.0/hash.c
./partn-2.0/dblimident.c
./partn-2.0/partn_info.c
./partn-2.0/README
./partn-2.0/dblimident.h
./partn-2.0/Makefile.dev
./partn-2.0/str_dup.h
Compilando$ cd partn-2.0
$ make
cc -c partn.c
cc -c hash.c
cc -c str_dup.c
cc -c malloc_err.c
cc -c partn_info.c
cc -c dblimident.c
esql -c slurp.ec
esql partn.o hash.o str_dup.o malloc_err.o partn_info.o dblimident.o slurp.o -o partn
Usage - partn needs to know which column (-k n) is the partnum and whether it is in hex (-x) or decimal (-d). Defaults are column 1 and to guess.
$ partn -?
partn [-k ] [{-d|-x}] [-f]
where:
-k = the partnum is in column . (default: 1)
-d = the partnum column is in decimal
-x = the partnum column is in hexadecimal
-f = always print the dbspace, even if the table is not fragmented
-h = no headings/blank-lines
0 comentários:
Enviar um comentário