
CREATE TABLE LM.T_BALANCE_SHEET_MARS AS 
SELECT * FROM LM.T_BALANCE_SHEET;
ALTER TABLE LM.T_BALANCE_SHEET_MARS RENAME COLUMN A_MOPDB_LOAD_SET_FK TO A_WORKFLOW_HISTORY_KEY;
BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname => 'LM', tabname => 'T_BALANCE_SHEET', cascade => TRUE, options => 'GATHER AUTO');
END;
/


CREATE TABLE LM.T_CURRENT_ACCOUNTS_MARS AS 
SELECT * FROM LM.T_CURRENT_ACCOUNTS;
ALTER TABLE LM.T_CURRENT_ACCOUNTS_MARS RENAME COLUMN A_MOPDB_LOAD_SET_FK TO A_WORKFLOW_HISTORY_KEY;
BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname => 'LM', tabname => 'T_CURRENT_ACCOUNTS', cascade => TRUE, options => 'GATHER AUTO');
END;
/


CREATE TABLE LM.T_FC_ADH_ADJUSTMENTS_MARS AS 
SELECT * FROM LM.T_FC_ADH_ADJUSTMENTS;
ALTER TABLE LM.T_FC_ADH_ADJUSTMENTS_MARS RENAME COLUMN A_MOPDB_LOAD_SET_FK TO A_WORKFLOW_HISTORY_KEY;
BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname => 'LM', tabname => 'T_FC_ADH_ADJUSTMENTS', cascade => TRUE, options => 'GATHER AUTO');
END;
/


CREATE TABLE LM.T_FC_CSM_ADJUSTMENTS_MARS AS 
SELECT * FROM LM.T_FC_CSM_ADJUSTMENTS;
ALTER TABLE LM.T_FC_CSM_ADJUSTMENTS_MARS RENAME COLUMN A_MOPDB_LOAD_SET_FK TO A_WORKFLOW_HISTORY_KEY;
BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname => 'LM', tabname => 'T_FC_CSM_ADJUSTMENTS', cascade => TRUE, options => 'GATHER AUTO');
END;
/


CREATE TABLE LM.T_FC_QRE_ADJUSTMENTS_MARS AS 
SELECT * FROM LM.T_FC_QRE_ADJUSTMENTS;
ALTER TABLE LM.T_FC_QRE_ADJUSTMENTS_MARS RENAME COLUMN A_MOPDB_LOAD_SET_FK TO A_WORKFLOW_HISTORY_KEY;
BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname => 'LM', tabname => 'T_FC_QRE_ADJUSTMENTS', cascade => TRUE, options => 'GATHER AUTO');
END;
/


CREATE TABLE LM.T_FORECAST_MARS AS 
SELECT * FROM LM.T_FORECAST;
ALTER TABLE LM.T_FORECAST_MARS RENAME COLUMN A_MOPDB_LOAD_SET_FK TO A_WORKFLOW_HISTORY_KEY;
BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname => 'LM', tabname => 'T_FORECAST', cascade => TRUE, options => 'GATHER AUTO');
END;
/


CREATE TABLE LM.T_STANDING_FACILITIES_MARS AS 
SELECT * FROM LM.T_STANDING_FACILITIES;
ALTER TABLE LM.T_STANDING_FACILITIES_MARS RENAME COLUMN A_MOPDB_LOAD_SET_FK TO A_WORKFLOW_HISTORY_KEY;
BEGIN
  DBMS_STATS.GATHER_TABLE_STATS(ownname => 'LM', tabname => 'T_STANDING_FACILITIES', cascade => TRUE, options => 'GATHER AUTO');
END;
/



GRANT SELECT ON LM.T_BALANCE_SHEET_MARS TO "AP-WLA-MOPDB";
GRANT SELECT ON LM.T_BALANCE_SHEET_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON LM.T_BALANCE_SHEET_MARS TO MOPDB_BALANCE_SHEET_RO;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_BALANCE_SHEET_MARS TO MOPDB_BALANCE_SHEET_RW;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_BALANCE_SHEET_MARS TO MRDS_LOADER;
GRANT SELECT ON LM.T_CURRENT_ACCOUNTS_MARS TO "AP-WLA-MOPDB";
GRANT SELECT ON LM.T_CURRENT_ACCOUNTS_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON LM.T_CURRENT_ACCOUNTS_MARS TO MOPDB_CURRENT_ACCOUNTS_RO;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_CURRENT_ACCOUNTS_MARS TO MOPDB_CURRENT_ACCOUNTS_RW;
GRANT SELECT ON LM.T_CURRENT_ACCOUNTS_MARS TO MOPDB_ECB_EXLIQ;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_CURRENT_ACCOUNTS_MARS TO MRDS_LOADER;
GRANT SELECT ON LM.T_FC_ADH_ADJUSTMENTS_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON LM.T_FC_ADH_ADJUSTMENTS_MARS TO MOPDB_FC_ADJUSTMENTS_RO;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_FC_ADH_ADJUSTMENTS_MARS TO MOPDB_FC_ADJUSTMENTS_RW;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_FC_ADH_ADJUSTMENTS_MARS TO MRDS_LOADER;
GRANT SELECT ON LM.T_FC_CSM_ADJUSTMENTS_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON LM.T_FC_CSM_ADJUSTMENTS_MARS TO MOPDB_FC_ADJUSTMENTS_RO;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_FC_CSM_ADJUSTMENTS_MARS TO MOPDB_FC_ADJUSTMENTS_RW;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_FC_CSM_ADJUSTMENTS_MARS TO MRDS_LOADER;
GRANT SELECT ON LM.T_FC_QRE_ADJUSTMENTS_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON LM.T_FC_QRE_ADJUSTMENTS_MARS TO MOPDB_FC_ADJUSTMENTS_RO;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_FC_QRE_ADJUSTMENTS_MARS TO MOPDB_FC_ADJUSTMENTS_RW;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_FC_QRE_ADJUSTMENTS_MARS TO MRDS_LOADER;
GRANT SELECT ON LM.T_FORECAST_MARS TO "AP-WLA-MOPDB";
GRANT SELECT ON LM.T_FORECAST_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON LM.T_FORECAST_MARS TO MOPDB_LM_FORECAST_RO;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_FORECAST_MARS TO MOPDB_LM_FORECAST_RW;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_FORECAST_MARS TO MRDS_LOADER;
GRANT SELECT ON LM.T_STANDING_FACILITIES_MARS TO "AP-WLA-MOPDB";
GRANT SELECT ON LM.T_STANDING_FACILITIES_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON LM.T_STANDING_FACILITIES_MARS TO MOPDB_ECB_EXLIQ;
GRANT SELECT ON LM.T_STANDING_FACILITIES_MARS TO MOPDB_STANDING_FACILITIES_RO;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_STANDING_FACILITIES_MARS TO MOPDB_STANDING_FACILITIES_RW;
GRANT DELETE, INSERT, SELECT, UPDATE ON LM.T_STANDING_FACILITIES_MARS TO MRDS_LOADER;


