{"id":31573,"date":"2026-01-06T08:41:25","date_gmt":"2026-01-06T08:41:25","guid":{"rendered":"http:\/\/kovaion-new1.local\/ai-vector-search-in-oracle-database-23ai\/"},"modified":"2026-01-06T10:10:26","modified_gmt":"2026-01-06T10:10:26","slug":"ai-vector-search-in-oracle-database-23ai","status":"publish","type":"post","link":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/ai-vector-search-in-oracle-database-23ai\/","title":{"rendered":"AI Vector Search in Oracle Database 23ai"},"content":{"rendered":"<p>Oracle&#8217;s 23ai release introduces a groundbreaking feature: Vector Search. This innovation empowers Oracle Database to seamlessly integrate diverse data types, enabling you to perform powerful, semantic searches alongside traditional business data queries within a single system.<\/p>\n<p>Unlike keyword-based searches, Oracle AI Vector Search leverages AI to understand the meaning behind your queries. This eliminates the need for separate vector databases, streamlining your data infrastructure and reducing complexity.<\/p>\n<p>Furthermore, Vector Search seamlessly integrates with other Oracle Database features, ensuring robust security, optimal performance, and high availability. You can directly access and manipulate data using standard SQL, without requiring any data format conversions. The ability to effortlessly combine disparate data types through simple joins further enhances the power and flexibility of Vector Search.<\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"text-decoration: underline;\"><strong>Introduction<\/strong><\/span><\/h2>\n<p>Vector search is an advanced technology that enables searches by analyzing the similarity or distance between data points represented as multidimensional vectors. Unlike traditional keyword-based search, vector search dives deeper by focusing on the underlying meaning and context of words rather than relying solely on exact word matches. This approach makes vector search a highly effective solution for delivering more accurate and relevant results, enhancing search experiences by aligning with the intent behind the query.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12353\" aria-describedby=\"caption-attachment-12353\" style=\"width: 804px\" class=\"wp-caption alignnone\"><img decoding=\"async\" class=\"wp-image-12353 \" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/1.jpg\" alt=\"\" \/><figcaption id=\"caption-attachment-12353\" class=\"wp-caption-text\"><strong>Fig 1: Overview of Oracle AI Vector Search<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h2><span style=\"text-decoration: underline;\"><strong>The main process of the vector search<\/strong><\/span><\/h2>\n<p>These three are the main processes of vector search:<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>1. Generating Vector Embeddings:<\/strong><\/h3>\n<p>Use a vector embedding model to create a vector representation model and load it into the database.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>2. Storing Vector Embeddings:<\/strong><\/h3>\n<p>Create a column in the table with datatype as a vector where we going to do the vector search and update the added column with the loaded model.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>3. Similarity Search:<\/strong><\/h3>\n<p>Performing similarity searches using SQL.<\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"text-decoration: underline;\"><strong>Defining and Utilizing Vectors for Enhanced Data Representation in Oracle Database<\/strong><\/span><\/h2>\n<p>&nbsp;<\/p>\n<h3><strong>VECTOR Data Type:<\/strong><\/h3>\n<ul>\n<li>The VECTOR data type represents a vector as a series of numbers.<\/li>\n<li>We need to define the number of dimensions for the vector.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><strong>Vector Embeddings:<\/strong><\/h3>\n<ul>\n<li>Vector embeddings capture the meaning of content like words, documents, audio, or images.<\/li>\n<li>They represent how similar objects are by placing them close together in a mathematical space.<\/li>\n<li>You can use different pre trained, open-source models to create these embeddings.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><strong>Using Open Neural Network Exchange (ONNX):<\/strong><\/h3>\n<ul>\n<li>You can import compatible models into Oracle Database using ONNX.<\/li>\n<li>This allows you to generate vector embeddings directly in the database using SQL.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><span style=\"text-decoration: underline;\"><strong>Choose the Model:<\/strong><\/span><\/h2>\n<p>We can&#8217;t use vectors effectively unless we can create them from our data. We can either generate them outside and load them into the database or use a model in the database to create vectors from our data. I don\u2019t know how to make my own model, so I\u2019ll use one from pre-loaded model developed by Hugging Face called <strong><a href=\"https:\/\/huggingface.co\/sentence-transformers\/all-MiniLM-L12-v2\" target=\"_blank\" rel=\"noopener\">all-MiniLM-L12-v2<\/a><\/strong>. We will utilize it to create vectors from regular text.<\/p>\n<p>You can use the predefined ONNX model from <strong><a href=\"https:\/\/adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com\/p\/VBRD9P8ZFWkKvnfhrWxkpPe8K03-JIoM5h_8EJyJcpE80c108fuUjg7R5L5O7mMZ\/n\/adwc4pm\/b\/OML-Resources\/o\/all_MiniLM_L12_v2_augmented.zip\" target=\"_blank\" rel=\"noopener\">here<\/a><\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>What is all-MiniLM-L12-v2?<\/strong><\/h3>\n<p>Hugging Face\u2019s all-MiniLM-L12-v2 model is a compact yet highly effective tool for natural language processing (NLP) tasks. It is designed for efficiency and works well for tasks like checking sentence similarity and classifying text. This model has 12 layers, making it faster and less demanding on resources than larger models, while still maintaining high accuracy. It&#8217;s a great option for developers working on NLP projects.<\/p>\n<p>We have a normal table with data and now here we are going to load the vector data model(all-MiniLM-L12-v2) into the database and going to create a new column in the present table with vector datatype. After this, we need to update the new column with a loaded model from the old column of the table which we are going to use to do vector search.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Current table (IPL_CRI_MATCHES) with the columns:<\/strong><\/h3>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12352\" aria-describedby=\"caption-attachment-12352\" style=\"width: 797px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12352\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/2-7-300x61.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"797\" height=\"162\" \/><figcaption id=\"caption-attachment-12352\" class=\"wp-caption-text\"><strong>Fig 2<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>we have loaded the IPL matches details with Summery on the IPL_CRI_MATCHES Table.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12351\" aria-describedby=\"caption-attachment-12351\" style=\"width: 798px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12351\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/3-7-300x123.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"798\" height=\"327\" \/><figcaption id=\"caption-attachment-12351\" class=\"wp-caption-text\"><strong>Fig 3<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h3><strong>To Import the Model:<\/strong><\/h3>\n<p>We create a folder to store the model, download it, and extract it into that folder.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12350\" aria-describedby=\"caption-attachment-12350\" style=\"width: 800px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12350\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/4-7-300x90.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"800\" height=\"240\" \/><figcaption id=\"caption-attachment-12350\" class=\"wp-caption-text\"><strong>Fig 4<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>We can now load the model into the database using the DBMS_VECTOR package.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12349\" aria-describedby=\"caption-attachment-12349\" style=\"width: 800px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12349\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/5-4-300x75.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"800\" height=\"200\" \/><figcaption id=\"caption-attachment-12349\" class=\"wp-caption-text\"><strong>Fig 5<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>We check the model information in the USER_MINING_MODELS view.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12348\" aria-describedby=\"caption-attachment-12348\" style=\"width: 796px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12348\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/6-4-300x75.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"796\" height=\"199\" \/><figcaption id=\"caption-attachment-12348\" class=\"wp-caption-text\"><strong>Fig 6<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h3><strong>Updating the table IPL_CRI_MATCHES with Vector column:<\/strong><\/h3>\n<p>We are going to add a new column as IPL_MATCH_VECTOR with vector datatype in the current IPL_CRI_MATCHES table<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12347\" aria-describedby=\"caption-attachment-12347\" style=\"width: 798px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12347\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/7-4-300x53.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"798\" height=\"141\" \/><figcaption id=\"caption-attachment-12347\" class=\"wp-caption-text\"><strong>Fig 7<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12346\" aria-describedby=\"caption-attachment-12346\" style=\"width: 796px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12346\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/8-6-300x92.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"796\" height=\"244\" \/><figcaption id=\"caption-attachment-12346\" class=\"wp-caption-text\"><strong>Fig 8<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Now we are going to update the added column with the loaded model using the present column MATCH_SUMMARY where we are going to do vector search.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12345\" aria-describedby=\"caption-attachment-12345\" style=\"width: 794px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12345\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/9-300x51.jpg\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"794\" height=\"135\" \/><figcaption id=\"caption-attachment-12345\" class=\"wp-caption-text\"><strong>Fig 9<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Now the IPL_MATCH_VECTOR column has loaded with the vector values generated.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12344\" aria-describedby=\"caption-attachment-12344\" style=\"width: 790px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12344\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/10-3-300x68.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"790\" height=\"179\" \/><figcaption id=\"caption-attachment-12344\" class=\"wp-caption-text\"><strong>Fig 10<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h3><strong>Vector search:<\/strong><\/h3>\n<p>Now we are going to search the IPL_MATCH with BAT in them.<\/p>\n<p>The output will show a similarity search related to the matche_summary column containing the word &#8220;bat&#8221; displaying the first 5 rows.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12343\" aria-describedby=\"caption-attachment-12343\" style=\"width: 785px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12343\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/11-300x136.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"785\" height=\"356\" \/><figcaption id=\"caption-attachment-12343\" class=\"wp-caption-text\"><strong>Fig 11<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Next the IPL_MATCH with BOWLER in them,<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_12342\" aria-describedby=\"caption-attachment-12342\" style=\"width: 788px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12342\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/12-300x88.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"788\" height=\"231\" \/><figcaption id=\"caption-attachment-12342\" class=\"wp-caption-text\"><strong>Fig 12<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h2><strong>Difference Between Query Search and Vector Search:<\/strong><\/h2>\n<p>&nbsp;<\/p>\n<table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>Query Search<\/th>\n<th>Vector Search<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Data<\/td>\n<td>Structured data<\/td>\n<td>Unstructured data<\/td>\n<\/tr>\n<tr>\n<td>Data Type<\/td>\n<td>Uses regular data types (e.g., integers, strings)<\/td>\n<td>Uses vector data types (e.g., float arrays) for embeddings<\/td>\n<\/tr>\n<tr>\n<td>Query Language<\/td>\n<td>SQL<\/td>\n<td>SQL with extensions for vectors<\/td>\n<\/tr>\n<tr>\n<td>Search Type<\/td>\n<td>Exact matches, range queries<\/td>\n<td>Similarity searches (e.g., cosine)<\/td>\n<\/tr>\n<tr>\n<td>Use Cases<\/td>\n<td>Transaction databases, CRM<\/td>\n<td>Recommendation systems, NLP<\/td>\n<\/tr>\n<tr>\n<td>Performance<\/td>\n<td>Fast for structured data<\/td>\n<td>Efficient for large unstructured datasets<\/td>\n<\/tr>\n<tr>\n<td>Complexity<\/td>\n<td>Simpler query structure<\/td>\n<td>May require ML models for embeddings<\/td>\n<\/tr>\n<tr>\n<td>Integration<\/td>\n<td>Standard database features<\/td>\n<td>Machine learning integration<\/td>\n<\/tr>\n<tr>\n<td>Result Interpretation<\/td>\n<td>Clear, precise results<\/td>\n<td>Results based on similarity<\/td>\n<\/tr>\n<tr>\n<td>SQL QUERY for example<\/td>\n<td>SELECT teams,<br \/>\nstadium,<br \/>\ncity,<br \/>\nyear,<br \/>\nMATCH_SUMMARY<br \/>\nFROM HR.IPL_CRI_MATCHES<br \/>\nWHERE MATCH_SUMMARY LIKE &#8216;%bowling%&#8217;<br \/>\nORDER BY MATCH_SUMMARY<br \/>\nFETCH FIRST 5 ROWS ONLY;<\/td>\n<td>Variable search_text varchar2(100);<br \/>\nexec :search_text := &#8216;bowling&#8217;;<br \/>\nset linesize 200<br \/>\ncolumn teams format a50<br \/>\ncolumn match_summary format a100<br \/>\nSELECT vector_distance(IPL_MATCH_VECTOR, (vector_embedding(all_minilm_l12_v2 using :search_text as data))) as distance,<br \/>\nteams,<br \/>\nstadium,<br \/>\ncity,<br \/>\nyear,<br \/>\nMATCH_SUMMARY<br \/>\nFROM HR.IPL_CRI_MATCHES<br \/>\norder by 1<br \/>\nfetch approximately first 5 rows only;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3><strong>Q<\/strong><strong>uery search output:<\/strong><\/h3>\n<figure id=\"attachment_12341\" aria-describedby=\"caption-attachment-12341\" style=\"width: 788px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12341\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/13-300x107.png\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"788\" height=\"281\" \/><figcaption id=\"caption-attachment-12341\" class=\"wp-caption-text\"><strong>Fig 13<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h3><strong>Vector search output:<\/strong><\/h3>\n<figure id=\"attachment_12340\" aria-describedby=\"caption-attachment-12340\" style=\"width: 789px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-12340\" src=\"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-content\/uploads\/2026\/01\/14-300x116.jpg\" alt=\"AI VECTOR SEARCH IN Oracle Database 23ai\" width=\"789\" height=\"305\" \/><figcaption id=\"caption-attachment-12340\" class=\"wp-caption-text\"><strong>Fig 14<\/strong><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h2><span style=\"text-decoration: underline;\"><strong>Conclusion:<\/strong><\/span><\/h2>\n<p>In summary, the query search is good for finding exact words, while the vector search is better in finding related ideas. But if you&#8217;re looking for specific words, the query search works well. If you need to understand the context and find similar items, vector search is usually more helpful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oracle&#8217;s 23ai release introduces a groundbreaking feature: Vector Search. This innovation empowers Oracle Database to seamlessly integrate diverse data types, enabling you to perform powerful, semantic searches alongside traditional business data queries within a single system. Unlike keyword-based searches, Oracle AI Vector Search leverages AI to understand the meaning behind your queries. This eliminates the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":23610,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[23],"tags":[],"class_list":["post-31573","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general"],"acf":[],"_links":{"self":[{"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/posts\/31573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/comments?post=31573"}],"version-history":[{"count":1,"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/posts\/31573\/revisions"}],"predecessor-version":[{"id":31574,"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/posts\/31573\/revisions\/31574"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/media\/23610"}],"wp:attachment":[{"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/media?parent=31573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/categories?post=31573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stage.kovaionplay.com\/stage-kovaion\/wp-json\/wp\/v2\/tags?post=31573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}