Consultor Eletrônico



Kbase 20209: 4GL Program to Generate an Input File for IDXBUILD Process
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
SUMMARY:

This solution provides Progress 4GL code to shorten a rebuild of the index structure for a group of tables.

EXPLANATION:

If you need to rebuild the index structure of a certain group of tables using the PROUTIL IDXBUILD command, you must specify the name of the table and the index for each index to be reconstructed. This process can be very time consuming if you have many indexes to rebuild.

SOLUTION:

The following program generates a file named INDEX.INPUT that contains all tables and index names. You can use a text editor to remove the tables and indexes that will not be re-indexed.

After you edit the file, execute the PROUTIL IDXBUILD command:

proutil db-name -C idxbuild -TB n -TM n < INDEX.INPUT

The following 4GL code creates the read-the-database-metaschema and generate-the-input file to be informed of the PROUTIL idxbuild command:

/* Redirecting the output to the file INDEX.INPUT */
OUTPUT TO INDEX.INPUT.

/* Informing to proutil idxbuild process that not */
/* all index will be rebuild */
PUT UNFORMATTED "Some" SKIP.

/* Export all table and index name to */
/* the output file */
FOR EACH _FILE WHERE _FILE-NUMBER > 0:
FOR EACH _INDEX OF _FILE:
PUT UNFORMATTED _FILE-NAME SKIP.
PUT UNFORMATTED _INDEX-NAME SKIP.
END.
END.

/* Finishing the loop */
PUT UNFORMATTED "!" SKIP.

/* Confirmation of the files to be indexed */
PUT UNFORMATTED "Y" SKIP.

/* Change to N if you do not have enough disk */
/* space to create the sort file on disk */
PUT UNFORMATTED "Y" SKIP.

OUTPUT CLOSE.


Reference to Written Documentation:

Database Administration Guide and Reference.

20209