5.5.4 Data Movement

The Customer Segmentation and Anomaly Detection use case make use of time series data and time series length can go up to six months to one year. When model is freshly deployed to production, given production may not have enough history of time series data; hence data movement from sandbox to production is required.

Note:

  • You must drop the partition before re-deployment for the particular model group.
  • To drop a partition, run the following SQL commands:
    ALTER TABLE AIF_NON_BEHAVIORAL_DATA_PROD DROP
    PARTITION <MODEL_GROUP_NAME>;
    ALTER TABLE AIF_BEHAVIORAL_DATA_UNSUP_PROD DROP
    PARTITION <MODEL_GROUP_NAME>;
  • Import/Export utility is available under the folder
    $<Compliance_Studio_HOME>//deployed/ml4aml/
    datamovement
Export from Sandbox

Note:

This section is intended for DBA/UNIX Admin.
  1. Provide read/write/execute permissions to Export_Sandbox_Data.sh.
  2. Execute following Unix command

    dos2unix Export_Sandbox_Data.sh

  3. Following grants are needed on Sandbox_Schema / Export_Schema ( using sysdba )
    grant read, write on directory DATA_PUMP_DIR to export_schema_name;
    grant export full database to export_schema_name;
  4. Execute the export utility using the following command
    ./Export_Sandbox_Data.sh
    1. Provide Oracle schema details when prompted
    2. Model Group Name will also be captured as part of inputs.

Outputs

AIF_DATA_UNSUP.dmp will be created as part of successful execution.

Execution Logs

EXP_AIF_DATA_UNSUP.log will be created as part of the execution in case of any issues.

Note:

Oracle Drive Compatibility:
  1. This utility can be executed from the same BD folder if the oracle drivers for the BD client and sandbox database server are compatible.
  2. If not compatible, this utility can be copied to the database UNIX server of the sandbox schema under the folder DATA_PUMP_DIR.
  3. DATA_PUMP_DIR for any oracle database server can be found out using the following query (using sysdba)

    select * from dba_directories where directory_name = 'DATA_PUMP_DIR'

Import into Production

Note:

This section is intended for DBA/UNIX Admin.
  1. Copy AIF_DATA.dmp (output of export) and Import_Sandbox_Data.sh to DATA_PUMP_DIR of BD Production Database server.
  2. Provide read/write/execute permissions to AIF_DATA.dmp and Import_Sandbox_Data.sh
  3. Execute following Unix command

    dos2unix Import_Sandbox_Data.sh

  4. Following grants are needed on BD Production Schema / Import Schema ( using sysdba )
    GRANT read, write on directory DATA_PUMP_DIR to import_schema_name;
    GRANT import full database to import_schema_name;
  5. Execute the import utility using the following command
    ./Import_Sandbox_Data.sh
    1. Provide Oracle schema details of the importing schema when prompted
    2. The Export schema user name / ID will also be captured as part of inputs.

Outputs

On successful execution, AIF_BEHAVIORAL_DATA_UNSUP will be populated for the model group.

Execution Logs

IMP_AIF_DATA _UNSUP.log will be created as part of the execution in case of any issues.

Note:

DATA_PUMP_DIR for any oracle database server can be found out using the following query (using sysdba).
select * from dba_directories where directory_name =
'DATA_PUMP_DIR'
.