set serveroutput on

DECLARE
   run_id NUMBER;
   no_recs NUMBER;
BEGIN
  run_id :=1000;
  dbms_olap.create_id (run_id );
  dbms_olap.recommend_mview_strategy(run_id, NULL, NULL, 100000000,
    10, '','costs,sales');
  SELECT COUNT(*) into no_recs 
  FROM system.mview_recommendations 
  WHERE runid= run_id;
  DBMS_OUTPUT.put_line ( 'No of Recommendations: ' || no_recs );
   -- Let's see the recommendations and script
   -- different for NT and Unix
  dbms_olap.generate_mview_report('/tmp/advisor_cache.html',
  run_id,dbms_olap.rpt_all);
  dbms_olap.generate_mview_script('/tmp/advisor_cache.sql',
  run_id,'DEMO');
END;
/
