SPOOL DROP.LOG

connect CS_OLAP/CS_OLAP;

REM =====================================================================================
REM Drop script to remove the CS_OLAP account and all the associated metadata
REM
REM =====================================================================================
REM Drop the CWM2 metadata for Channels
REM ======================================================================================
execute cwm2_olap_table_map.remove_awview('CS_OLAP','CS_O_SHAW_SHAWC_CHANN8VIEW');
DROP VIEW CS_OLAP.CS_O_SHAW_SHAWC_CHANN8VIEW
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWCHAN8TBL
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWCHAN8OBJ
/
execute cwm2_olap_dimension.drop_dimension('CS_OLAP','SHAWCHANNELS');
execute cwm2_olap_metadata_refresh.mr_refresh();
commit
/


REM ======================================================================================
REM Drop the CWM2 metadata for Geographies
REM ======================================================================================
execute cwm2_olap_table_map.remove_awview('CS_OLAP','CS_O_SHAW_SHAWG_STAND9VIEW');
DROP VIEW CS_OLAP.CS_O_SHAW_SHAWG_STAND9VIEW
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWGEOG9TBL
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWGEOG9OBJ
/
execute cwm2_olap_dimension.drop_dimension('CS_OLAP','SHAWGEOGRAPHIES');
execute cwm2_olap_metadata_refresh.mr_refresh();
commit
/





REM ======================================================================================
REM Drop the CWM2 metadata for Products
REM ======================================================================================
execute cwm2_olap_table_map.remove_awview('CS_OLAP','CS_O_SHAW_SHAWP_PRODU10VIEW');
DROP VIEW CS_OLAP.CS_O_SHAW_SHAWP_PRODU10VIEW
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWPROD10TBL
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWPROD10OBJ
/
execute cwm2_olap_dimension.drop_dimension('CS_OLAP','SHAWPRODUCTS');
execute cwm2_olap_metadata_refresh.mr_refresh();
commit
/




REM ======================================================================================
REM Drop the CWM2 metadata for Promotions
REM ======================================================================================
execute cwm2_olap_table_map.remove_awview('CS_OLAP','CS_O_SHAW_SHAWP_PROMO11VIEW');
DROP VIEW CS_OLAP.CS_O_SHAW_SHAWP_PROMO11VIEW
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWPROM11TBL
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWPROM11OBJ
/
execute cwm2_olap_dimension.drop_dimension('CS_OLAP','SHAWPROMOTIONS');
execute cwm2_olap_metadata_refresh.mr_refresh();
commit
/



REM ======================================================================================
REM Drop the CWM2 metadata for Time
REM ======================================================================================
execute cwm2_olap_table_map.remove_awview('CS_OLAP','CS_O_SHAW_SHAWT_CALEN12VIEW');
DROP VIEW CS_OLAP.CS_O_SHAW_SHAWT_CALEN12VIEW
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWT_TI12TBL
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWT_TI12OBJ
/
execute cwm2_olap_dimension.drop_dimension('CS_OLAP','SHAWT_TIME');
execute cwm2_olap_metadata_refresh.mr_refresh();
commit
/


REM ======================================================================================
REM Drop the CWM2 metadata for Sales Data
REM ======================================================================================
execute cwm2_olap_table_map.remove_awview('CS_OLAP','CS_O_SHAW_SHAWSALE14VIEW');
DROP VIEW CS_OLAP.CS_O_SHAW_SHAWSALE14VIEW
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWSALE13TBL
/
DROP TYPE CS_OLAP.CS_O_SHAW_SHAWSALE13OBJ
/
execute cwm2_olap_cube.drop_cube('CS_OLAP','SHAWSALES');
execute cwm2_olap_metadata_refresh.mr_refresh();
commit
/


REM ======================================================================================
REM Drop the measure folder
REM ======================================================================================
execute cwm2_olap_catalog.Drop_Catalog('SHAW MEASURES');
execute cwm2_olap_catalog.Drop_Catalog('SHAW KEYS');
execute cwm2_olap_metadata_refresh.mr_refresh();
commit
/




REM ======================================================================================
REM Drop user cs_olap and associated tablespaces
REM ======================================================================================
connect / as sysdba
drop directory eifdir;
drop user cs_olap cascade;
drop tablespace cs_olap including contents;
drop tablespace cs_olaptemp including contents;
drop directory eifdir;
alter system checkpoint;
commit
/
SPOOL OFF
exit