Error: ETL Cleanup

When an ETL fails (
SBX_STAGE_Load or OP_User_Access_Load
), it might be necessary to roll back all of the failed ETL depending on the type of error.
In order to run the
SBX_AuditStage_Cleanup
or
OP_User_Access_Load_Cleanup
, you need to determine the
$LOAD_NUMBER
to use. This is specified under the Global Variables section of the Data Services Admin Console UI page.
Run the corresponding query based on the type of cleanup ETL that you need to run:
Invoice Auditing: SBX_AuditStage_Cleanup
/*
Determine BATCH_CONTROL_KEY of last successful SBX_STAGE_Load +1. The number returned will be used in the SBX_AuditStage_Cleanup ($LOAD_NUMBER) under Global Variables.
*/
SELECT MAX(BATCH_CONTROL_KEY) + 1 FROM SBXRPTCTRL.RS_BATCH_CONTROL WHERE PROCESS_NAME = 'WF_AUDIT_DATA' AND STATUS = 'COMPLETED';
Reporting Users: OP_User_Access_Load_Cleanup
/*
Determine BATCH_CONTROL_KEY of last successful OP_User_Access_Load +1. The number returned will be used in the OP_User_Access_Load_Cleanup ($LOAD_NUMBER) under Global Variables.
*/
SELECT MAX(BATCH_CONTROL_KEY) + 1 FROM SBXRPTCTRL.RC_BATCH_CONTROL WHERE PROCESS_NAME = 'WF_OP_USER_ACCESS' AND STATUS = 'COMPLETED';
ERP Reconciliation Extract: ERP_Recon_Load_Cleanup
/*
Determine BATCH_CONTROL_KEY of last successful ERP_Recon_Load +1. The number returned will be used in the ERP_Recon_Load_Cleanup ($LOAD_NUMBER) under Global Variables.
*/
SELECT MAX(BATCH_CONTROL_KEY) + 1 FROM SBXRPTCTRL.RS_BATCH_CONTROL WHERE PROCESS_NAME = 'WF_ERP_RECON_LOAD' AND STATUS = 'COMPLETED';