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


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


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


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


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


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


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

GRANT SELECT ON TOP.T_AGGREGATED_ALLOTMENT_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON TOP.T_AGGREGATED_ALLOTMENT_MARS TO MOPDB_MML_USER, MOPDB_ECB_OUTSTANDING, "AP-WLA-MOPDB";
GRANT DELETE, INSERT, SELECT, UPDATE ON TOP.T_AGGREGATED_ALLOTMENT_MARS TO MRDS_LOADER, MOPDB_MML_ADMIN;


GRANT SELECT ON TOP.T_ALLOTMENT_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON TOP.T_ALLOTMENT_MARS TO MOPDB_MML_USER, MOPDB_ECB_OUTSTANDING, "AP-WLA-MOPDB";
GRANT DELETE, INSERT, SELECT, UPDATE ON TOP.T_ALLOTMENT_MARS TO MRDS_LOADER, MOPDB_MML_ADMIN;

GRANT SELECT ON TOP.T_ALLOTMENT_MODIFICATIONS_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON TOP.T_ALLOTMENT_MODIFICATIONS_MARS TO MOPDB_MML_USER, MOPDB_ECB_OUTSTANDING, "AP-WLA-MOPDB";
GRANT DELETE, INSERT, SELECT, UPDATE ON TOP.T_ALLOTMENT_MODIFICATIONS_MARS TO MRDS_LOADER, MOPDB_MML_ADMIN;

GRANT SELECT ON TOP.T_ALLOTMENT_MODIFICATIONS_AGGREGATED_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON TOP.T_ALLOTMENT_MODIFICATIONS_AGGREGATED_MARS TO MOPDB_MML_USER, MOPDB_ECB_OUTSTANDING, "AP-WLA-MOPDB";
GRANT DELETE, INSERT, SELECT, UPDATE ON TOP.T_ALLOTMENT_MODIFICATIONS_AGGREGATED_MARS TO MRDS_LOADER, MOPDB_MML_ADMIN;

GRANT SELECT ON TOP.T_ANNOUNCEMENT_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON TOP.T_ANNOUNCEMENT_MARS TO MOPDB_MML_USER, MOPDB_ECB_OUTSTANDING, "AP-WLA-MOPDB";
GRANT DELETE, INSERT, SELECT, UPDATE ON TOP.T_ANNOUNCEMENT_MARS TO MRDS_LOADER, MOPDB_MML_ADMIN;

GRANT SELECT ON TOP.T_FBL_ITEM_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON TOP.T_FBL_ITEM_MARS TO MOPDB_MML_USER, MOPDB_ECB_OUTSTANDING, "AP-WLA-MOPDB";
GRANT DELETE, INSERT, SELECT, UPDATE ON TOP.T_FBL_ITEM_MARS TO MRDS_LOADER, MOPDB_MML_ADMIN;

GRANT SELECT ON TOP.T_FULLBID_ARRAY_COMPILED_MARS TO MML_LAB WITH GRANT OPTION;
GRANT SELECT ON TOP.T_FULLBID_ARRAY_COMPILED_MARS TO MOPDB_MML_USER, MOPDB_ECB_OUTSTANDING, "AP-WLA-MOPDB";
GRANT DELETE, INSERT, SELECT, UPDATE ON TOP.T_FULLBID_ARRAY_COMPILED_MARS TO MRDS_LOADER, MOPDB_MML_ADMIN;

