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.- Provide read/write/execute permissions to
Export_Sandbox_Data.sh
. - Execute following Unix command
dos2unix Export_Sandbox_Data.sh
- 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;
- Execute the export utility using the following command
./Export_Sandbox_Data.sh
- Provide Oracle schema details when prompted
- 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:- This utility can be executed from the same BD folder if the oracle drivers for the BD client and sandbox database server are compatible.
- If not compatible, this utility can be copied to the database UNIX server of the sandbox schema under the folder DATA_PUMP_DIR.
- 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.- Copy
AIF_DATA.dmp
(output of export) andImport_Sandbox_Data.sh
toDATA_PUMP_DIR
of BD Production Database server. - Provide read/write/execute permissions to
AIF_DATA.dmp
andImport_Sandbox_Data.sh
- Execute following Unix command
dos2unix Import_Sandbox_Data.sh
- 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;
- Execute the import utility using the following
command
./Import_Sandbox_Data.sh
- Provide Oracle schema details of the importing schema when prompted
- 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'
.