IBM Connections:Reorg Connections Databases: Difference between revisions
No edit summary |
No edit summary |
||
(One intermediate revision 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 | ||
Line 175: | Line 63: | ||
[[Category:IBM Connections]] | [[Category:IBM Connections]] | ||
[[Category: | [[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