Oracle 26ai & AI

An Old DBA Learns AI: Embeddings, Vectors and Oracle 26ai

My first hands-on experiment with an embedding model and Vector Search — and what surprised me most.

Gökhan Dedeler
Gökhan Dedeler
Senior Principal Oracle DBA • Founder @ DBADoctor.com
Aug 16, 2026• 7 min read

I've been an Oracle DBA for many years.

I've worked with RAC, ASM, Exadata, Data Guard, performance tuning and all the usual DBA stuff.

But AI is changing the database world, and at some point I realized I couldn't just watch from the side.

So I decided to stop reading about Vector Search and actually build something.

The Goal Was Simple:

Take an embedding model, put it inside Oracle 26ai, generate vectors, and see what Vector Search actually does. And I wanted to understand it from the very beginning.

1. Starting with Oracle 26ai

I already had Docker running on Windows, so I started by checking it:

PS C:\Users\gokha> docker --version

Docker version 29.4.3, build 055a478

PS C:\Users\gokha> docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Then I pulled the Oracle Free image:

PS C:\Users\gokha> docker pull container-registry.oracle.com/database/free:latest

After the image was downloaded, I started the container:

PS C:\Users\gokha> docker run -d `

>> --name oracle26ai `

>> -p 1521:1521 `

>> -p 5500:5500 `

>> -e ORACLE_PWD=Oracle123 `

>> container-registry.oracle.com/database/free:latest

af1ac5c1bb6d441a85313d478c40b9db35a2cfd240de2ceadd62a8b26001b086

A little later:

#########################
DATABASE IS READY TO USE!
#########################

Oracle reported: Oracle AI Database 26ai Free Release 23.26.2.0.0

The database was running with FREEPDB1 open read/write.

2. First, What Is an Embedding?

Before doing anything with Vector Search, I wanted to understand one basic question: What is actually inside a vector?

The simplest explanation that worked for me was:

Embedding is the process of converting text into numbers.
"BMW is a German car"
↓ [ Embedding Model ] ↓
[0.0075, 0.1846, -0.0394, ...]

Those numbers are the vector.

  • Embedding = the conversion process
  • Vector = the numerical representation produced by that process

The interesting part is that we can compare those numerical representations.

3. Getting an Embedding Model

For this experiment I used the all_MiniLM_L12_v2 ONNX model.

I went inside the container and created a directory:

PS C:\Users\gokha> docker exec -it oracle26ai bash

bash-4.4$ mkdir -p /tmp/models

bash-4.4$ ls -ld /tmp/models

drwxr-xr-x 2 oracle oinstall 4096 Aug 15 16:42 /tmp/models

Downloaded the ONNX model via curl:

bash-4.4$ curl -L "https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/eLddQappgBJ7jNi6Guz9m9LOtYe2u8LWY19GfgU8flFK4N9YgP4kTlrE9Px3pE12/n/adwc4pm/b/OML-Resources/o/all_MiniLM_L12_v2.onnx" -o /tmp/models/all_MiniLM_L12_v2.onnx

total 128M

-rw-r--r-- 1 oracle oinstall 128M Aug 15 16:47 all_MiniLM_L12_v2.onnx

4. Loading the Model into Oracle

Next I created an Oracle DIRECTORY pointing to the model and loaded it using DBMS_VECTOR:

SQL> CREATE OR REPLACE DIRECTORY MODEL_DIR AS '/tmp/models';

SQL> GRANT READ, WRITE ON DIRECTORY MODEL_DIR TO dba_lab;

SQL> BEGIN

DBMS_VECTOR.LOAD_ONNX_MODEL(

directory => 'MODEL_DIR',

file_name => 'all_MiniLM_L12_v2.onnx',

model_name => 'ALL_MINILM_L12_V2',

metadata => JSON('{"function":"embedding","embeddingOutput":"embedding","input":{"input":["DATA"]}}')

);

END;

/

PL/SQL procedure successfully completed.

And verified it in USER_MINING_MODELS:

SQL> SELECT model_name, mining_function, algorithm, model_size FROM user_mining_models WHERE model_name = 'ALL_MINILM_L12_V2';

ALL_MINILM_L12_V2 | EMBEDDING | ONNX | 133322334

So now Oracle knew the model as an EMBEDDING model using ONNX.

5 & 6. Generating Vectors & Cosine Distance

Now for the fun part. I asked Oracle to convert "BMW is a German car" into a vector:

SQL> SELECT VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'BMW is a German car' AS DATA) AS embedding FROM dual;

EMBEDDING: [7.53478426E-003, 1.84654191E-001, -3.94271314E-002, ...]

Then I compared sentences using COSINE DISTANCE:

Comparison 1

BMW is a German car ↔ Audi is a German car

Distance: 0.2047
Comparison 2

BMW is a German car ↔ Toyota is a Japanese car

Distance: 0.5093

In cosine-distance comparisons, smaller distance means the vectors are closer in meaning.

Think of the vector as a point in a huge mathematical multi-dimensional space. Texts with similar meanings tend to end up closer together, while less related meanings tend to be farther apart. BMW and Audi ended up much closer than BMW and Toyota.

That was the moment Vector Search started making sense to me.

7 & 8. Building a Real Semantic Search

Comparing two sentences is interesting, but that's not really a search application. So I created a table and stored 10 car descriptions along with their vector embeddings:

CREATE TABLE cars (

id NUMBER PRIMARY KEY,

description VARCHAR2(500),

embedding VECTOR

);

Now I asked Oracle: "German luxury SUV" (Not WHERE brand = 'BMW', just natural language):

SELECT c.id, c.description,

VECTOR_DISTANCE(c.embedding, VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'German luxury SUV' AS DATA), COSINE) AS distance

FROM cars c ORDER BY distance FETCH FIRST 5 ROWS ONLY;

DESCRIPTIONDISTANCE
Mercedes GLC0.2712
BMW X50.3095
Audi Q50.3186
Porsche Cayenne0.3301
Toyota RAV40.3790

The German luxury SUVs naturally appeared at the top. This was the first time I thought: "Okay... I get it now."

9 & 10. What If Exact Words Don't Exist? (Adding Togg)

I searched for: "comfortable family car for a long trip". None of my records contained that exact phrase, but vector search doesn't require keyword matching.

Then I inserted a Togg T10X record with the description: "Togg T10X is a Turkish electric family SUV designed for comfortable long trips".

When running the query again, Togg jumped to number 1 with distance 0.6138.

An Important Distinction for DBAs:

I didn't train the model. I simply gave the model a description containing ideas like Turkish, electric, family SUV, comfortable, long trips.

So this does not mean "I taught AI that Togg is the most comfortable car." It means "The description I gave Togg is semantically close to my query."

11. Traditional SQL vs Vector Search

Traditional SQL

"Find BMW" → WHERE brand = 'BMW'

Requires structured, exact match database keywords and specific metadata.

Vector Search

"German luxury SUV" → EMBEDDING → VECTOR_DISTANCE()

The query doesn't have to match stored words. Ranks results by semantic similarity.

EMBEDDING MODEL
│ ("German luxury SUV")
▼ VECTOR
│
Oracle 26ai (VECTOR_DISTANCE)
│
▼ Ranked Results

12. One Small DBA Lesson Along the Way

I also managed to hit one very normal DBA problem. My first attempt to populate the table failed with:

ORA-40284: model does not exist

The reason was simple: the model was loaded under a different schema. The fix was:

GRANT CREATE MINING MODEL TO dba_lab;

Then I loaded the model into the DBA_LAB schema and everything worked. I actually kept this little mistake in the article because... that's what a real DBA lab looks like!

Final Thoughts

What started as "What the hell is a vector?" ended with a working Oracle 26ai database that could take a natural-language query and rank cars based on semantic similarity.

Oracle 26ai + ONNX Embedding Model + VECTOR + VECTOR_EMBEDDING() + VECTOR_DISTANCE() = Semantic Search

No separate vector database. No complicated AI application. Just Oracle, SQL, an embedding model and a few cars.

I'm still an Oracle DBA. But I guess I'm slowly becoming an Oracle DBA who understands a little bit more about AI. 😄

Don't just read about the new technology. Build something with it!

Resources