Consultor Eletrônico



Kbase 63597: Script to disable indexes
Autor   Tatiane Koslinsky - CAT
Acesso   Público
Publicação   9/26/2017
You can streamline the dictionary correction stage in the process of converting to Datasul. The technique is to import the settings (DF files) with the inactive indexes, and then activate them with the Progress idxbuild tool.

To use this method, you must edit all the settings and include the word 'INACTIVE' in the index settings. Below is a short PowerShell script to perform this task automatically:

$dfFiles = Get-ChildItem *.df;
$dfFiles | ForEach-Object {
Get-Content $_ | ForEach-Object {
$_;
if ($_ -like "ADD INDEX *") {
" INACTIVE";
}
} | Out-File -Encoding ASCII -FilePath "$($_.BaseName).inactive.df";
}
$dfFiles = $null;

This script processes all dictionary definitions in the current directory and creates a new definition, with the extension '.inactive.df'. In this new definition, the indexes are set as inactive.