-- ====================================================================
-- Seed Data for DEVO Replica Management Tables
-- ====================================================================
-- Purpose: Initial configuration data for MOPDB and RAR replication management
-- Source: MARS-770 install_package_MarsGeneralRelease_MARS770_tables.sql
-- ====================================================================

-- Initial MOPDB replica management configuration
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_CEPH';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'MPEC' AND TABLE_NAME = 'T_MPEC';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'REFERENCE' AND TABLE_NAME = 'T_CAPITAL_KEY';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'CT_MOPDB' AND TABLE_NAME = 'MOPDB_METADATA_INVENTORY';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'REFERENCE' AND TABLE_NAME = 'T_CSDB_RATING_ACTION';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'REFERENCE' AND TABLE_NAME = 'T_CURRENCY';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'CLSLNK_SNPSHT_DT' WHERE OWNER = 'RIAD' AND TABLE_NAME = 'T_CLSLNK_PSTNZ_HIST';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'TOP' AND TABLE_NAME = 'T_AGGREGATED_ALLOTMENT';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'ELA' AND TABLE_NAME = 'T_ELA_INFO';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_ALL_ASSETS_ORIGINATOR';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_ALL_ASSETS_ADD_GUARANTOR';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_ALL_ASSETS_IAB';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_ALL_ASSETS_SERVICER';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_ALL_ASSETS_LSP';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_ALL_ASSETS_IRSP';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_ALL_ASSETS_FXSC';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_COLLATERAL';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'REFERENCE' AND TABLE_NAME = 'T_COUNTRY';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_SNAPSHOT_DATE';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'TOP' AND TABLE_NAME = 'T_ALLOTMENT';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'TOP' AND TABLE_NAME = 'T_ALLOTMENT_MODIFICATIONS';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'TOP' AND TABLE_NAME = 'T_ANNOUNCEMENT';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'TOP' AND TABLE_NAME = 'T_FBL_ITEM';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'TOP' AND TABLE_NAME = 'T_FULLBID_ARRAY_COMPILED';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'REF_DATE' WHERE OWNER = 'LM' AND TABLE_NAME = 'T_STANDING_FACILITIES';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'REFERENCE_DATE' WHERE OWNER = 'LM' AND TABLE_NAME = 'T_CURRENT_ACCOUNTS';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'REF_DATE' WHERE OWNER = 'LM' AND TABLE_NAME = 'T_BALANCE_SHEET';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'REFERENCE_DATE' WHERE OWNER = 'LM' AND TABLE_NAME = 'T_FORECAST';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'ADJUSTMENT_DATE' WHERE OWNER = 'LM' AND TABLE_NAME = 'T_FC_ADH_ADJUSTMENTS';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'LM' AND TABLE_NAME = 'T_FC_CSM_ADJUSTMENTS';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'LM' AND TABLE_NAME = 'T_FC_QRE_ADJUSTMENTS';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_COLLATERAL_ALL_SOURCES';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_ALL_ASSETS';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'TIME_PERIOD' WHERE OWNER = 'SDW' AND TABLE_NAME = 'T_EXCHANGE_RATES';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'OVERWRITE', PARTITION_COLUMN = 'ROWID' WHERE OWNER = 'TOP' AND TABLE_NAME = 'T_ALLOTMENT_MODIFICATIONS_AGGREGATED';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'T_INTRADAY_CREDIT';
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_MOPDB SET SAVE_MODE = 'APPEND', PARTITION_COLUMN = 'SNAPSHOT_DATE' WHERE OWNER = 'C2D' AND TABLE_NAME = 'MV_PUBLIC_ELIGIBLE_MARKETABLE_ASSETS';
COMMIT;

-- Initial RAR replica management configuration
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_RAR
SET SAVE_MODE = 'OVERWRITE' , PARTITION_COLUMN = 'ROWID';
COMMIT;

UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_RAR SET SAVE_MODE = 'APPEND' , PARTITION_COLUMN = 'A_SNAPSHOT_DATE' WHERE TABLE_NAME = 'NH_HF_PRICE' AND OWNER = 'CORR_RAR' ;
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_RAR SET SAVE_MODE = 'APPEND' , PARTITION_COLUMN = 'A_INSERTION_DATE' WHERE TABLE_NAME = 'NH_PRICE' AND OWNER = 'CORR_RAR' ;
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_RAR SET SAVE_MODE = 'APPEND' , PARTITION_COLUMN = 'A_INSERTION_DATE' WHERE TABLE_NAME = 'NH_POSITION' AND OWNER = 'CORR_RAR' ;
UPDATE CT_MRDS.A_DEVO_REPLICA_MGMT_RAR SET SAVE_MODE = 'APPEND' , PARTITION_COLUMN = 'A_INSERTION_DATE' WHERE TABLE_NAME = 'NH_PERFORMANCE' AND OWNER = 'CORR_RAR' ;
COMMIT;