Monday, November 11, 2013

Dropping all your ODM model

This post is main a note to myself of a script to drop all my Oracle Data Miner models.

1. Check to see what models you have in your schema

SELECT model_name,
       mining_function,
       algorithm,
       build_duration,
       model_size
FROM ALL_MINING_MODELS;

2. Drop all the ODM models

set serveroutput on
DECLARE
   cursor c_1 is SELECT model_name
                 FROM ALL_MINING_MODELS;
BEGIN
  FOR r_1 in c_1 LOOP
     dbms_output.put_line('Dropping model '||r_1.model_name);
     DBMS_DATA_MINING.DROP_MODEL(model_name => r_1.model_name);
  END LOOP;
  commit;
END;
/

No comments:

Post a Comment

Post a Comment