alter session set container=freepdb1;
DBMS_VECTOR.LOAD_ONNX_MODEL (
directory => 'DATA_DIR',
file_name => 'all_MiniLM_L12_v2.onnx',
model_name => 'ALL_MINILM_L12_V2');
END;
/
VECTOR_EMBEDDING (
ALL_MINILM_L12_V2 USING 'It is a pleasure to be here at LAOUC Tour 2024!' as DATA
) AS embedding;
Now you're ready to create your first table, load the data and vectors and start using Vector Search
id NUMBER PRIMARY KEY,
name VARCHAR2(50),
vector_coord VECTOR
);
(1, 'Mr. Morcego' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mr. Bat' as data)),
(2, 'Mr. 7 Mountains' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mr. 7 Mountains' as data)),
(3, 'Mr. Martin' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mr. Martin' as data)),
(4, 'Mrs. Maria Padilha' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mrs. Maria Padilha' as data)),
(5, 'Mr. Litle Fire' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mr. Litle Fire' as data)),
(6, 'Mrs. Maria Quiteria' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mrs. Maria Quiteria' as data)),
(7, 'Mr. Seven' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mr. Seven' as data)),
(8, 'Mr. World Spinner' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mr. World Spinner' as data)),
(9, 'Mr. White Stone' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mr. White Stone' as data)),
(10, 'Mr. Litle Darkness' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mr. Litle Darkness' as data)),
(11, 'Mr. Marian' , VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING 'Mr. Marian' as data));
COMMIT;
SELECT * FROM laouc24.vector1 where id = 4;
And that's it. Your database is ready for testing using Vector Search.
For more examples and information, you can access this posts here and here.
Mario