Задание 1. Перестройка локальных индексов
В этом задании необходимо выполнить перестроение всех локальных индексов французских секций в таблице Customer, для этого:
- Откройте командную строку PROENV и перейдите в каталог C:\OpenEdge\WRK\tablepartitioning:
- Запуск Proenv: Start -> All Programs -> Progress -> OpenEdge -> Proenv
- Переход в каталог:
cd tablepartitioning
- Активируйте возможность построения индексов в секциях для базы данных sportsco:
proutil sportsco -C enabletpidxbld
TP Index Rebuild has been enabled for database sportsco. (12479)
Примечание: начиная с OpenEdge 12.0 возможность перестроения локальных индексов активируется по умолчанию во время активации Table Partitioning.
- Выполните параллельно перестроение всех локальных индексов для трёх французских секций таблицы Customer – Customer-4, Customer-5 и Customer-6. Для того чтобы убедиться, что индекс CountrySalesrepLocalIdx может быть перестроен одновременно для разных секций, попробуйте выполнить эти команды параллельно.
proutil sportsco -C tpidxbuild table customer partition customer-4
proutil sportsco -C tpidxbuild table customer partition customer-5
proutil sportsco -C tpidxbuild table customer partition customer-6
Пример вывода утилиты tpidxbuild:
proenv>proutil sportsco -C tpidxbuild table customer partition customer-5 OpenEdge Release 12.0 as of Fri Feb 22 19:02:39 EST 2019 Do you have enough disk space for index sorting? (y/n) y TMB value is 8, TM value is 8, SG value is 48, packing factor is 100. (16141) Index record(s) updated at timestamp 1559038590. (18223) Temporary sort file at: V:\Progress120\WRK\tablepartitioning will use the available disk space. (11443) Attempting to obtain an exclusive lock on customer(customer-5). (16753) If you would like to cancel this operation, press CTRL-C. (8581) ... requested lock has been obtained. TP Index Rebuild operation continuing. Index 67 ( PUB.Customer, CountrySalesrepLocalIdx.customer-5:5 ): de-activated (17368) Area 300: Table scan complete for partition customer-5. Elapsed time: 0.000 (17473) Sorting and index building group 24. Sorting index group 24 complete. Elapsed time: 0.001 (16761) Building index 67 (CountrySalesrepLocalIdx) for customer-5 of group 24 in area 301 (16763) Building of indexes in group 24 completed. Elapsed time: 0.000 (16762) Temporary sort file at V:\Progress120\WRK\tablepartitioning used up 0K of disk space. (11480) A total of 0K of temporary sort disk space was used for area 300. (11483) Index 67 ( PUB.Customer, CountrySalesrepLocalIdx.customer-5:5 ): activated (17369) 1 indexes were rebuilt. (11465) Index rebuild complete. 0 error(s) encountered. Elapsed time: 8.406 proenv>
Таким образом, мы видим, что благодаря секционированию индексов таблицы мы можем быстрее выполнять их перестроение выполняя команду TPIDXBUILD для каждой секции параллельно. Это также даёт нам преимущество на случай, если повреждение в индексе возникло в одной секции – нам не надо делать перестроение поврежденного индекса всей большой таблицы, достаточно это сделать только для той секции, где повреждение было обнаружено.
Задание завершено!