Consultor Eletrônico



Kbase 16568: A 4GL program to generate an idxbuild script by table
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/25/1998
A 4GL program to generate an idxbuild script by table

INTRODUCTION:
=============

When you do not have enough diskspace to rebuild all of your
indexes of a database at once but still want to sort (group)
your indexes in the database you have to build your indexes
seperately. this knowledgebase entry gives you a sample
4GL program on how to generate a script to rebuild all
indexes per table automatically.

If you run the idxbuild.p program, it generates a script called
idxbuild. This script executes proutil -C idxbuild for each
table separately. In this way the diskspace you need is
limited to the size of all indexes of one table.

You can make the temp file visible with the -t option on proutil.

Note that this is not a faster way to rebuild your indexes. It will
be slower than when you rebuild the indexes with enough space
(75% of the database) on a separate disk. If time is a concern
you can divide the script 'idxbuild' into separate scripts by
table groups so you can for example do a set of tables each
night or each weekend.


PROCEDURAL APPROACH:
====================

/* idxbuild.p */
output to idxbuild.

put "echo Wait and check on termination $0.log" skip.
for each _file where not _file._file-name begins "_":
put unformatted
"echo Processing all indexes from table " _file._file-name "..."
skip.
put unformatted
"proutil " dbname " -C idxbuild -TB 24 -TM 32 -B 512 <<EOF>> $0.log"
skip
"Some" skip.
for each _index of _file:
put unformatted _file._file-name skip.
put unformatted _index._index-name skip.
end.
put
"!" skip
"y" skip
"y" skip
"EOF" skip.
put "if [ $? -ne 0 ]" skip
"then" skip
" grep \"\\*\\*\" $0.log" skip
" exit" skip
"fi" skip(1).
end.
put skip "grep \"~\*~\* \" $0.log" skip.
quit.


REFERENCES TO WRITTEN DOCUMENTATION:
====================================

System Administration Guide Guide and Reference


Note: This is restricted to Unix platforms.

PJO 15 Jan 1997
PBH 24 Nov 1998
Progress Software Technical Support Note # 16568