Dropping all your ODM model

Posted on

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;
/

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s