Home
Deprecated DBMS_DATA_MINING package subprograms and datatypes should not be used
Description
GET_MODEL_DETAILS,GET_MODEL_DETAILS_XML,GET_MODEL_SETTINGS_XMLGET_NAMED_ASSOCIATION_RULES,GET_NAMED_BAYESIAN_RULES,GET_NAMED_CLUSTERS- Deprecated collection datatypes such as
DM_NESTED_NUMERICALS,DM_NESTED_CATEGORICALS,DM_NESTED_BINARY_DOUBLES
This rule flags any reference to DBMS_DATA_MINING calls and PL/SQL object types that Oracle marked as deprecated in 18c and later. Affected items include, but are not limited to:
Oracle has replaced these convenience APIs with data-dictionary views (e.g. ALL/DBA/USER_MVIEW_MODELS, USER_MINING_MODEL_DETAILS*) and JSON/SQL access paths. Continuing to compile code that relies on the obsolete subprograms or datatypes will produce compile-time errors once they become desupported in future releases.
Key Benefits
- Future Compatibility: Code remains compilable in Oracle 18c and later when the deprecated routines are removed.
- Performance: Dictionary views and SQL scoring functions leverage the optimizer and can be parallelised.
- Maintainability: Eliminates reliance on thick-client style PL/SQL wrappers that receive no new features or bug fixes.
- Security & Support: Keeps the code base within Oracle’s actively patched feature set.
Non-compliant Code Example
DECLARE model_name VARCHAR2(100) := 'my_model_name'; -- Replace with your model name model_details DBMS_DATA_MINING.DM_MODEL_GLOBAL_DETAILS; --Non compliant code BEGIN model_details := DBMS_DATA_MINING.GET_MODEL_DETAILS_GLOBAL(model_name); --Non compliant code -- Example: Display the model name DBMS_OUTPUT.PUT_LINE('Model Name: ' || model_details.name); -- Example: Display the algorithm type DBMS_OUTPUT.PUT_LINE('Algorithm Type: ' || model_details.algorithm_name); END; /
