When loading Fact Tables some additional "tender loving care" has to be taken. First, on fact tables there are many indexes and aggregate tables that might slow down the loading performance or need maintenance. For this reason, before and after each fact table a stored procedure is called. These stored procedures should deal with all database maintenance tasks prior and after loading the fact table and get parameters like $G_LOAD_TYPE (is it an initial or delta load?), the name of the fact table to be dealt with and more.
PreLoad Script:
print('Calling pre-processing of CO_TRANS_FACT transaction data...'); DWH_DS.CA_DWH.PREPROCESSING_FACT_TABLE($G_LOAD_TYPE, 'Y', 'CO_TRANS_FACT'); print('Calling pre-processing of CO_TRANS_FACT transaction data...done');
PostLoad Script:
print('Calling post-processing of PROFIT_CENTER_FACT...'); DWH_DS.CA_DWH.POSTPROCESSING_FACT_TABLE($G_LOAD_TYPE, $G_REBUILD_INDEXES, 'PROFIT_CENTER_FACT', $P_FAILURES); if ($P_FAILURES = 0) print('Calling post-processing of PROFIT_CENTER_FACT...done'); else print('Calling post-processing of PROFIT_CENTER_FACT...done but with {$P_FAILURES} errors');