ORA-40341: Access violation on model storage object in Oracle

oracle

While I was trying to drop a table, it throws following error in Oracle SQL Developer:

ORA-40341: Access violation on model storage object

The tables are temporary tables created while pushing into the database using Oracle R Enterprise. The names of the tables are: DM$PRORE$21_473, DM$PGORE$21_473, ...

I need to drop all these tables as these tables have occupied large space of my database. While googling, I found this link but it provides no solution clues.

Best Answer

Database tables created using ore.push will have the prefix ORE$. Normally, these are automatically cleaned up when the R session ends or the ORE db connection terminated (unless you save the ore.frame objects in an ORE datastore).

In-database models from Oracle Data Mining (ODM) as created from ore.odmSVM will also normally be deleted automatically and the end of the R session or ORE db connection termination. You should not attempt to remove DM$ tables as they are part of the in-database model. If you do delete any of these, their corresponding models will be corrupted/invalid.

You can invoke

SELECT name FROM dm_user_models;

to see the list of models in the database for your schema.

You can drop ODM models using the following in SQL*Plus or SQL Dev:

BEGIN 
  DBMS_DATA_MINING.DROP_MODEL('MY_MODEL'); 
END;

Lots of thanks goes to Mark Hornick, Senior Manager, Oracle Advanced Analytics for his constant support in ORE implementation in my project.