IBM Connections:Reorg Connections Databases: Difference between revisions
No edit summary |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= Shell de Criação dos arquivos de reorg = | |||
1) Conectar com um usuário com permissão de db2admin | |||
2) Criar o arquivo '''db2-reorg-tables.sh''' | |||
#!/bin/bash | |||
for DBNAME in BLOGS DOGEAR FILES FORUM HOMEPAGE OPNACT PEOPLEDB SNCOMM WIKIS METRICS COGNOS PNS CCM | |||
do | |||
db2 connect to $DBNAME | |||
db2 reorgchk update statistics on table all > resultado$DBNAME.txt | |||
db2 terminate | |||
echo "db2 connect to $DBNAME" > reorg$DBNAMETable.txt | |||
cat resultadoPEOPLEDB.txt | grep Table: | awk -F: '{ print "db2 reorg table" $2 }' >> reorg$DBNAMETable.txt | |||
echo "db2 terminate" >> reorg$DBNAMETable.txt | |||
echo "db2 connect to $DBNAME" > reorg$DBNAMEIndex.txt | |||
cat resultadoPEOPLEDB.txt | grep Table: | awk -F: '{ print "db2 reorg indexes all for table" $2 }' >> reorg$DBNAMEIndex.txt | |||
echo "db2 terminate" >> reorg$DBNAMEIndex.txt | |||
sh -x reorg$DBNAMETable.txt | |||
sh -x reorg$DBNAMEIndex.txt | |||
done | |||
Salvar e fechar | |||
3) Executar o arquivo | |||
sh -x db2-reorg-tables.sh | |||
= Exemplos do resultado= | |||
---- | ---- | ||
Line 19: | Line 53: | ||
sh -x reorgPEOPLEDBIndex.txt | sh -x reorgPEOPLEDBIndex.txt | ||
= Ver também = | |||
* [[IBM Connections:Reorg Connections Databases]] | * [[IBM Connections:Reorg Connections Databases]] | ||
Line 174: | Line 62: | ||
* [[IBM Connections| Mais Artigos sobre IBM Connections]] | * [[IBM Connections| Mais Artigos sobre IBM Connections]] | ||
[[ | [[Category:IBM Connections]] | ||
[[Category:Tuning IBM Connections]] |
Latest revision as of 11:49, 13 September 2016
Shell de Criação dos arquivos de reorg
1) Conectar com um usuário com permissão de db2admin
2) Criar o arquivo db2-reorg-tables.sh
#!/bin/bash for DBNAME in BLOGS DOGEAR FILES FORUM HOMEPAGE OPNACT PEOPLEDB SNCOMM WIKIS METRICS COGNOS PNS CCM do db2 connect to $DBNAME db2 reorgchk update statistics on table all > resultado$DBNAME.txt db2 terminate echo "db2 connect to $DBNAME" > reorg$DBNAMETable.txt cat resultadoPEOPLEDB.txt | grep Table: | awk -F: '{ print "db2 reorg table" $2 }' >> reorg$DBNAMETable.txt echo "db2 terminate" >> reorg$DBNAMETable.txt echo "db2 connect to $DBNAME" > reorg$DBNAMEIndex.txt cat resultadoPEOPLEDB.txt | grep Table: | awk -F: '{ print "db2 reorg indexes all for table" $2 }' >> reorg$DBNAMEIndex.txt echo "db2 terminate" >> reorg$DBNAMEIndex.txt sh -x reorg$DBNAMETable.txt sh -x reorg$DBNAMEIndex.txt done
Salvar e fechar
3) Executar o arquivo
sh -x db2-reorg-tables.sh
Exemplos do resultado
db2 connect to PEOPLEDB db2 reorgchk update statistics on table all > resultadoPEOPLEDB.txt db2 terminate echo "db2 connect to PEOPLEDB" > reorgPEOPLEDBTable.txt cat resultadoPEOPLEDB.txt | grep Table: | awk -F: '{ print "db2 reorg table" $2 }' >> reorgPEOPLEDBTable.txt echo "db2 terminate" >> reorgPEOPLEDBTable.txt echo "db2 connect to PEOPLEDB" > reorgPEOPLEDBIndex.txt cat resultadoPEOPLEDB.txt | grep Table: | awk -F: '{ print "db2 reorg indexes all for table" $2 }' >> reorgPEOPLEDBIndex.txt echo "db2 terminate" >> reorgPEOPLEDBIndex.txt sh -x reorgPEOPLEDBTable.txt sh -x reorgPEOPLEDBIndex.txt