Saturday, March 14, 2026

ONNX in Oracle AI Database 26ai: First-Class Models Inside the Database

ONNX in Oracle AI Database 26ai: First-Class Models Inside the Database
Oracle AI Database 26ai

ONNX models inside Oracle AI DatabaseWhat “first-class model objects” really changes for lifecycle, inference placement, and vector workflows

Oracle AI Database 26ai does more than let you stash another model format in the catalog. It turns supported ONNX models into schema objects that participate in Oracle Machine Learning scoring semantics, extends the platform to larger models, and makes in-database embedding workflows more operationally credible. The value is not just convenience. It is about where inference happens, how model contracts are governed, how vectors are generated, and what new operational responsibilities move into the database tier.

Imported as schema objectsONNX models land as MINING MODEL objects rather than opaque application files.
Broader scoring surfaceOracle positions ONNX support across embeddings, classification, regression, and clustering use cases.
Larger model handling26ai adds support for ONNX models larger than 1 GB through external initializers and related runtime plumbing.
Vector workflow payoffThe same in-database model can serve ingestion-time and query-time embedding generation, tightening contract consistency.

What Oracle AI Database 26ai actually changed

1

The important shift is not “Oracle can read ONNX.” The more meaningful shift is that Oracle treats supported ONNX models as managed database model objects, wires them into scoring operators, expands the size envelope for practical models, and uses that runtime as a building block for vector and image workflows.

First-class object

Schema-managed model lifecycle

Oracle’s 26ai feature guide says imported ONNX-format models become first-class MINING MODEL objects in the schema. That matters because the model stops being “just a file the application knows about” and becomes cataloged, inspectable, and governable through Oracle’s model infrastructure.

Operator parity

Use familiar scoring paths

Oracle’s ONNX support is framed around the same OML scoring family that Oracle users already know, including PREDICTION, CLUSTER, and VECTOR_EMBEDDING. The practical benefit is interface continuity rather than a separate inference stack bolted on beside SQL.

Larger models

Beyond the earlier size ceiling

26ai adds support for importing ONNX models larger than 1 GB when model weights are externalized. Oracle explicitly ties this to transformer-style embedding models and to OML4Py-based conversion workflows that can emit external initializers.

Image workflows

In-database multimodal path

The feature guide also extends the in-database ONNX runtime to image transformer models, provided the ONNX pipeline itself includes the required image decoding and preprocessing. That is a meaningful architectural boundary: preprocessing must travel with the model contract.

Why first-class objects matter: once a model is a schema object, the governance conversation changes. You can inspect it in model views, control who invokes it, reason about rollout by object name, and align inference with the same transactional and security envelope as the data it scores.

26ai capabilityWhat Oracle saysOperational meaningWhere teams still need discipline
ONNX as first-class objectsImported ONNX models become schema-level MINING MODEL objects and can be used through Oracle scoring operators.Model discovery, naming, and access control move into the database contract.You still need versioning policy, promotion rules, and model compatibility testing.
Larger ONNX modelsModels larger than 1 GB are supported when using external initializers with the in-database ONNX runtime.Some models that were previously too awkward now become candidates for in-database serving.Memory footprint, import packaging, and instance sizing become material concerns.
Image transformer supportImage transformer models can be imported and used with the in-database ONNX runtime, with preprocessing embedded in the ONNX pipeline.Multimodal vector generation can happen in the same estate as the indexed data.The model artifact must include preprocessing correctly; this is not inferred by Oracle for you.
Embedding workflow integrationOracle documents using the same model for embedding generation during indexing and query time.Vector semantics are easier to keep aligned across write and read paths.You must still prove dimension, tokenizer, and preprocessing consistency with your own tests.

The right mental model: ONNX support is a lifecycle feature, not only an import feature

2

If you think only about model import, you miss the design point. The real question is how a model is authored, packaged, registered, invoked, observed, and eventually replaced inside a database-centered application stack.

Author or convert modelThird-party ML, Hugging Face,or OML4Py conversion pipelineImport into OracleDirectory, cloud object storage,or OML import procedureRegistered model objectStored as a schemaMINING MODEL with metadataSQL and PL/SQL scoringPrediction, clustering,and embedding operatorsVector application pathGenerate embeddings duringdata preparation and againfor query-time inputsKey contract boundaryMetadata must correctly describe inputs, outputs,function, and preprocessing assumptions.
Phase 1Prepare the model artifact

Choose an ONNX model whose task and preprocessing assumptions are explicit. For image models, Oracle requires the decoding and preprocessing logic to be part of the ONNX pipeline.

Phase 2Import with metadata

The model file is not enough. Oracle needs metadata that maps model inputs and outputs to database usage semantics, especially for embedding models.

Phase 3Publish a stable name

Consumers should call a stable schema object name rather than track a filesystem artifact. This is where rollout and replacement policy becomes cleaner.

Phase 4Use the model from SQL paths

Embedding generation, and more generally scoring, can stay close to the data. That reduces contract drift between application and database layers.

Phase 5Operate and validate

Inspect model catalog views, verify dimensions and outputs, watch memory behavior for large models, and prove query-time and indexing-time compatibility.

Do not confuse proximity with magic. In-database inference removes data movement and environment sprawl, but it also places model runtime behavior inside the database service boundary. That shifts responsibility for sizing, import discipline, and operational diagnostics onto the database platform team.

Model onboarding paths: import is simple only when the model contract is simple

3

Oracle exposes more than one route for bringing ONNX models into the database. The right choice depends on whether you are in a vector-centric workflow, whether the model is large, and whether your organization already lives in the OML4SQL model lifecycle.

Import pathBest fitStrengthsCaveats
DBMS_VECTOR.LOAD_ONNX_MODELLocal directory-based onboarding for in-database embedding workflows.Direct, explicit, and well aligned with AI Vector Search examples.Metadata correctness is your responsibility; embedding-focused examples are easiest to validate.
DBMS_VECTOR.LOAD_ONNX_MODEL_CLOUDModels staged in object storage or similar cloud locations.Avoids an extra local file movement step and supports in-memory loading options.Credentialing, object access, and memory policy become part of the deployment contract.
DBMS_DATA_MINING.IMPORT_ONNX_MODELTeams already centered on Oracle Machine Learning model governance.Keeps ONNX inside the established OML model-management family.You still need task-appropriate metadata and validation of input mapping.
OML4Py conversion pipelinePreparing transformer-style models, especially larger models with external initializers.Oracle explicitly documents OML4Py as a path for converting Hugging Face and local models to ONNX for in-database use.Model conversion is still a packaging pipeline; it does not absolve you from downstream scoring validation.
Practical import

Embedding model load from a database directory

Oracle’s vector documentation shows a direct load path that imports an ONNX embedding model and registers it under a database model name. The critical part is not just the file path; it is the metadata JSON that declares the function, output tensor, and input mapping.

PL/SQL · Load an ONNX embedding model
BEGIN
  DBMS_VECTOR.LOAD_ONNX_MODEL(
    directory  => 'DM_DUMP',
    file_name  => 'all_MiniLM_L12_v2.onnx',
    model_name => 'DOC_MODEL',
    metadata   => JSON('{
      "function" : "embedding",
      "embeddingOutput" : "embedding",
      "input" : { "input" : ["DATA"] }
    }')
  );
END;
/
Why metadata matters

The database needs a usable model contract

For ONNX import, Oracle needs enough metadata to understand what the model is for and how database input should be mapped. Treat metadata as deployment-critical configuration and store it with the same discipline as the model artifact itself.

  • Declare the intended function accurately, especially for embedding models.
  • Map the correct input tensor name to database-supplied content.
  • Identify the output tensor used for embeddings.
  • Retest whenever the exported model changes, even if the model name does not.

The failure mode to avoid: a model imports successfully, but the metadata describes the wrong input or output names, or the model’s preprocessing assumptions changed during export. In that case the object exists, but the semantic contract is broken. Oracle can catalog the object; only your validation can prove that the object still means what you think it means.

What to inspect after import

Catalog views

After import, inspect the model through mining model views rather than assuming the object is ready because the procedure returned successfully.

SQL · Confirm that the ONNX model is cataloged
SELECT model_name,
       mining_function,
       algorithm,
       algorithm_type,
       model_size
FROM   user_mining_models
WHERE  model_name = 'DOC_MODEL';
Input mapping

Attribute-level sanity check

Oracle exposes model attributes in data dictionary views. Use them to confirm that the imported contract lines up with the way your SQL will call the model.

SQL · Inspect imported model attributes
SELECT model_name,
       attribute_name,
       attribute_type,
       data_type
FROM   user_mining_model_attributes
WHERE  model_name = 'DOC_MODEL'
ORDER BY attribute_name;

Using ONNX models from SQL: where inference placement becomes real

4

The strongest reason to put ONNX inside Oracle is not that the database can call a model. It is that the call happens close to the governed data, through native SQL semantics, with less movement across service boundaries.

Direct SQL embedding

Oracle documents invoking an imported ONNX embedding model directly through VECTOR_EMBEDDING. This is the cleanest illustration of what first-class model objects buy you: SQL references the published model name rather than an external model endpoint.

SQL · Generate an embedding through the imported model object
SELECT VECTOR_EMBEDDING(doc_model USING 'how do I rotate credentials safely?')
FROM   dual;

Utility path with explicit provider metadata

Oracle also documents a utility path that asks DBMS_VECTOR.UTL_TO_EMBEDDING to use the database itself as the provider, with the model name supplied in JSON parameters. This makes the serving location explicit and can be useful in chain-style workflows.

SQL · Ask the vector utility layer to use the database-resident model
SELECT TO_VECTOR(
         DBMS_VECTOR.UTL_TO_EMBEDDING(
           'how do I rotate credentials safely?',
           JSON('{
             "provider" : "database",
             "model"    : "DOC_MODEL"
           }')
         )
       )
FROM dual;
!
Inference placement implication

When embedding generation moves into SQL, the main win is contract consistency. The same model object can be used when populating a vector column and again when embedding user queries. Oracle’s own examples make this point explicitly. That reduces a common failure mode in vector systems: documents embedded with one pipeline and queries embedded with a subtly different one.

ONNX versus feature extraction: Oracle’s vector stack can produce vectors through more than one path, but imported ONNX models are the right fit when the vector semantics must come from a specific model artifact with a known tokenizer, preprocessing contract, and output space. That is different from a more general feature-extraction workflow. ONNX support matters most when the model itself is part of the application contract, not just a convenient way to manufacture numeric arrays.

A small but important end-to-end pattern

For vector search, the clean pattern is to generate stored document embeddings and query embeddings from the same published model. That does not guarantee retrieval quality by itself, but it removes one whole class of preventable mismatch.

SQL · Populate a vector column with the same model later used for queries
-- Example table shape only; adjust vector dimensions to your model.
CREATE TABLE kb_chunks (
  chunk_id        NUMBER PRIMARY KEY,
  chunk_text      CLOB,
  chunk_embedding VECTOR
);

INSERT INTO kb_chunks (chunk_id, chunk_text, chunk_embedding)
SELECT chunk_id,
       chunk_text,
       VECTOR_EMBEDDING(doc_model USING chunk_text)
FROM   staged_chunks;

Good practice: keep the model name behind a database view, package constant, or rollout convention so that applications do not hard-code too many object names. First-class objects help, but they do not replace release hygiene.

Larger ONNX models: why the 1 GB milestone matters operationally

5

The “larger ONNX models” feature is not just a bigger import limit. It is Oracle acknowledging that practically useful transformer models may require model packaging patterns that separate graph structure from large weight payloads.

What changed

External initializers

The 26ai feature guide says larger ONNX models are enabled through external initializers, which separate constant weights from the ONNX graph representation. That is the key packaging mechanism behind the new size support.

Who enables it

OML4Py conversion path

Oracle documents OML4Py as the toolchain that can convert Hugging Face or local models into ONNX artifacts suitable for database use, including models that are fine-tuned and packaged with external data.

What it really means

Model choice widens, not infinitely

The database can now host a broader set of models, but teams should still evaluate memory usage, throughput expectations, concurrent scoring demand, and whether the database tier is the right serving location for that model size.

Bigger model does not automatically mean better system design. Oracle’s guide notes that larger models can improve accuracy and capture subtler relationships, but that is only one side of the trade-off. In-database inference is attractive when co-location with data matters enough to justify runtime cost in the database estate.

QuestionWhy it mattersWhat to inspect before rollout
How is the model packaged?Large models may rely on external initializers rather than a single small ONNX file.Confirm the artifact set is complete, versioned together, and reproducible from the conversion pipeline.
Will it be loaded in memory?Oracle exposes in-memory ONNX options and related views because memory behavior is operationally significant.Review ALL_MINING_MODELS in-memory-related columns and the runtime views V$IM_ONNX_MODEL and V$IM_ONNX_MODEL_SEGMENT.
What concurrency do you expect?A model that is fine for batch embedding may be painful for interactive scoring under concurrent load.Test realistic request rates and watch process memory, latency, and database service impact.
Do you need the database to serve it?The closer the model needs to be to governed data, the stronger the in-database case becomes.Separate architectural necessity from “it is possible,” especially for very large or frequently changing models.

Useful catalog signals

Oracle’s documentation for mining model views calls out model size, in-memory settings, and external-data indicators for ONNX models. Those columns are the first place to look when you need to prove what was actually deployed.

SQL · Inspect model size and in-memory metadata
SELECT model_name,
       model_size,
       inmemory_size,
       inmemory_onnx_model,
       external_data
FROM   all_mining_models
WHERE  model_name = 'DOC_MODEL';

Runtime visibility

Oracle documents V$IM_ONNX_MODEL and V$IM_ONNX_MODEL_SEGMENT specifically so administrators can verify runtime presence and memory usage of in-memory ONNX segments. If you are betting on in-memory behavior, validate it instead of assuming a parameter choice had the intended effect.

SQL · Check runtime visibility for in-memory ONNX segments
SELECT *
FROM   v$im_onnx_model;

SELECT *
FROM   v$im_onnx_model_segment;

Image transformer models and vector workflows: where multimodal support is precise, not generic

6

Oracle’s 26ai guide extends the in-database ONNX runtime to image transformer models, but the requirement is strict: the ONNX pipeline must include the required image decoding and preprocessing. That single sentence has big implications.

What the requirement really says

  • Oracle is not promising to infer or auto-build the image preprocessing stack around an arbitrary ONNX model.
  • The model artifact must already encode the transformations the runtime needs.
  • For multimodal retrieval, the packaging boundary is part of the correctness boundary.

That is a healthy constraint. It keeps the serving contract explicit and makes it more likely that training-time and inference-time preprocessing remain aligned.

Why this matters for AI Vector Search

Oracle positions imported image transformers as directly useful for vectorizing text and image data in the database, avoiding a separate embedding environment and the data movement that goes with it. For teams already indexing data in Oracle, that can simplify both the architecture and the control surface.

Text or image inputRows, files, orapplication payloadsONNX pipeline contractModel plus required decodingand preprocessing embeddedinside the ONNX workflowIn-database runtimeGenerate embeddingsinside OracleAI Vector Search pathStore vectors in a column,index them if appropriate,and use the same model familyfor query-time embedding

Important caveat: Oracle’s 26ai feature guide clearly states the capability, but the exact invocation pattern you use in your system still needs environment-level validation. In current Oracle vector utility documentation, examples for image-to-vector utility calls are narrower than the broader 26ai feature statement. Treat multimodal SQL paths as something to verify concretely in your target release rather than something to infer loosely from adjacent examples.

eBook
Exadata DBA Guide
A comprehensive PDF guide for Oracle DBAs covering Exadata architecture, Smart Scan, Flash Cache, Storage HA and performance tuning.
Get the PDF →

Operational concerns: what to validate before calling ONNX support production-ready

7

The feature is real, but production value comes only when teams validate the model object, input mapping, embedding behavior, and runtime economics in the same way they validate SQL plans, indexes, and security posture.

Implementation checklist

Pre-production readiness review

  • Verify the imported model appears in mining model views with the expected function and size profile.
  • Confirm that input attributes, output tensor names, and metadata still match the exported ONNX artifact.
  • Prove that ingestion-time and query-time embeddings come from the same effective model contract.
  • Test memory behavior for large or in-memory ONNX models under realistic concurrency.
  • Decide how model object names will be versioned, promoted, and retired.
  • Define who is allowed to import, replace, and invoke production models.
Governance angle

Why DBAs and architects should care

In-database ONNX models blend ML serving concerns into the database control plane. That affects privilege design, capacity planning, release coordination, and operational observability. Treat model objects as deployable database assets, not as ad hoc developer conveniences.

A small amount of naming discipline goes a long way. For example, a stable consumer-facing name can point to a currently approved model version while an internal promotion workflow stages candidate names for validation.

SymptomLikely causeWhat to inspectNext action
Model imports but embedding calls fail or look wrongInput/output metadata does not match the exported ONNX graph, or preprocessing assumptions changed.Import metadata JSON, model attribute views, and a small gold-set validation sample.Re-export or re-import with corrected metadata; do not patch around it in application code.
Document vectors and query vectors behave inconsistentlyDifferent model versions or preprocessing pipelines were used between indexing and query time.Published model object names, rollout history, and embedding generation SQL on both paths.Re-embed one side or standardize on a single released model contract.
Large model works in test but hurts service behaviorRuntime cost or memory footprint is too high for production concurrency.In-memory ONNX views, model size metadata, service latency, and concurrent session behavior.Resize, limit concurrency, change serving placement, or choose a smaller model.
Image model imports but multimodal flow is incompleteThe ONNX pipeline does not carry the required image preprocessing or the invocation path is not the one you assumed.The exported model pipeline, Oracle image-model documentation for your environment, and a tiny reproducible test case.Fix packaging first; only then revisit SQL or utility invocation details.

Focused validation lab

A serious rollout should include a tiny, deterministic acceptance lab. The goal of the lab is to prove that the model object is callable, cataloged, and semantically coherent.

SQL · Minimal acceptance checks after model import
-- 1. Confirm the model exists and inspect its size/function metadata.
SELECT model_name, mining_function, algorithm, model_size
FROM   user_mining_models
WHERE  model_name = 'DOC_MODEL';

-- 2. Generate one embedding from a fixed text sample.
SELECT VECTOR_EMBEDDING(doc_model USING 'reset password token rotation')
FROM   dual;

-- 3. Compare behavior across two known-similar phrases.
SELECT VECTOR_DISTANCE(
         VECTOR_EMBEDDING(doc_model USING 'rotate secrets safely'),
         VECTOR_EMBEDDING(doc_model USING 'credential rotation procedure')
       ) AS distance_value
FROM dual;

Do not over-read the distance number. You are not proving recall quality here. You are proving that the imported object behaves coherently, returns embeddings, and is usable in ordinary vector functions.

FAQ for architects, DBAs, and database-centric developers

8
Is ONNX support in 26ai mainly about vector embeddings?

No. Oracle’s feature guide explicitly frames ONNX support across classification, regression, clustering, and embeddings. Current vector-search documentation gives the clearest concrete examples for embedding models, so those are often the most straightforward entry point.

Why is the phrase “first-class model object” more important than it sounds?

Because it moves the model into the same governable space as other database objects. Teams can reason about naming, visibility, and lifecycle inside the schema rather than depending on an application-side reference to a file or remote endpoint.

Should every ONNX model now be served from inside Oracle?

No. In-database serving is strongest when co-location with governed data, transactional context, or vector-generation consistency matters more than keeping model serving outside the database tier. Some larger or rapidly changing models may still belong elsewhere.

What is the biggest correctness risk in an ONNX rollout?

Usually not the import step itself. The bigger risk is a contract mismatch: wrong tensor names, changed preprocessing assumptions, or using one model contract when indexing and another when serving queries.

What should I verify for multimodal models before announcing success?

Verify that the ONNX pipeline includes the necessary image decoding and preprocessing, that your target release supports the invocation path you intend to use, and that the resulting vectors behave plausibly on a tiny labeled sample before scaling out.

Quick quiz

?

Five questions on ONNX models in Oracle AI Database 26ai. Pick one answer then hit Submit.

Q1. When Oracle imports a supported ONNX model in 26ai, what database object does it become?

Q2. What is the key metadata requirement for an embedding model import?

Q3. What packaging mechanism enables ONNX models larger than 1 GB in 26ai?

Q4. What must an image transformer ONNX pipeline include for Oracle’s in-database runtime?

Q5. Which setup best preserves vector consistency between indexing and query time?

No comments:

Post a Comment