Oracle 23ai and the Cloud: AI-Powered Cloud Services for Developers and DBAs
Artificial intelligence is accelerating at a fast speed for businesses all over the world. It has launched a new era in technology that promises both greater productivity and new ways to solve business problems that simply were not previously possible. AI and Cloud computing offers Generative AI, Machine Learning, and Statistical tools capable of performing advanced calculations that industries are using to create dynamic applications, deploy algorithms for advanced app functionality, analyze big data, and predict and forecast future growth that helps with business profitability and longevity.
I will review some of the key features related to AI in Oracle 23ai and OCI.
AI Vector Search
Oracle 23ai introduces the VECTOR data type, which enables vector similarity searches within the database. It can be combined with relational search on business data in one single system.
Oracle 23ai Vector Search allows you to easily build with the vector data type, enabling the rapid development of AI-driven applications.
Example of a VECTOR column data type:
CREATE TABLE docs (doc_id INT, doc_text CLOB, doc_vector VECTOR);
VECTOR data type allows the database to store vector embeddings along with business data in the Oracle database.
What are Vector Similarity Searches in AI?
If you have ever used applications such as voice assistants, chatbots, language translators, recommendation systems, anomaly detection, or video search and recognition, you have implicitly used vector search embedding features.
In the following example, all points represent a vectorized value. AI can classify and identify values and determine whether they are all fruits, animals, or U.S. states.
Oracle 23ai Vector Search uses the clause VECTOR_DISTANCE to find values between the vector type column, and everything inside the SELECT statement:
With Vector search, there is no need for a specialized vector database, which eliminates the problem of data fragmentation across multiple systems.
Oracle 23ai introduces Vector Indexes, a class of specialized indexing data structures used to efficiently store and search high-dimensional vector data. It also provides SQL execution support for vector indexes built on vector columns inside the database. In addition, it provides support for SQL Functions related to the vector type and allows for row-level restriction capabilities in SQL queries for partitions.
APEX Assistant
APEX Assistant introduces AI-powered chat capability to all APEX code editors, making it easier to write SQL queries, debug code, and more. To provide a continuous chat experience, the chat widget retains the context of the conversation until the Clear Chat button is pressed.
The APEX Assistant contains two options:
- Query Builder – We use Query Builder to get a simple query. In Query Builder mode, the AI assumes that all questions are in the context of the customer’s schema in the database. For example, if we ask the AI to create SQL queries for tables that don’t exist in the database, the APEX Assistant’s answers won't be very helpful.
- General Support – We use General Support for general conversations or technical questions like “Explain this” or “Improve this code.” In General Support mode, the APEX Assistant gives us default options like Use Selection, Improve Selection, and Explain Selection.
Autonomous Database Select AI
The Select AI feature allows Autonomous Database to use generative AI with Large Language Models (LLMs) to convert user input text into Oracle SQL.
Select AI relies on generative AI and Large Language Models (LLMs) to convert natural language text directly into Oracle SQL queries. This means that users can ask simple questions like “How many customers do we have?” The AI will generate the corresponding SQL query, automatically execute it, and provide the results accurately and efficiently.
The following examples from Oracle documentation illustrate actions such as runsql, showsql, narrate, chat, and explainsql that you can perform with SELECT AI.
SQL> select ai how many customers exist;
CUSTOMER_COUNT
--------------
55500
SQL> select ai showsql how many customers exist;
RESPONSE
----------------------------------------------------
SELECT COUNT(*) AS total_customers
FROM SH.CUSTOMERS
SQL> select ai narrate how many customers exist;
RESPONSE
------------------------------------------------------
There are a total of 55,500 customers in the database.
SQL> select ai chat how many customers exist;
RESPONSE
--------------------------------------------------------------------------------
It is impossible to determine the exact number of customers that exist as it con
stantly changes due to various factors such as population growth, new businesses
, and customer turnover. Additionally, the term "customer" can refer to individu
als, businesses, or organizations, making it difficult to provide a specific num
ber.
SQL> select ai explainsql how many customers in San Francisco are married;
RESPONSE
--------------------------------------------------------------------------------
SELECT COUNT(*) AS customer_count
FROM SH.CUSTOMERS AS c
WHERE c.CUST_STATE_PROVINCE = 'San Francisco' AND c.CUST_MARITAL_STATUS = 'Married';
Explanation:
- We use the 'SH' table alias for the 'CUSTOMERS' table for better readability.
- The query uses the 'COUNT(*)' function to count the number of rows that match the given conditions.
- The 'WHERE' clause is used to filter the results:
- 'c.CUST_STATE_PROVINCE = 'San Francisco'' filters customers who have 'San Francisco' as their state or province.
- 'c.CUST_MARITAL_STATUS = 'Married'' filters customers who have 'Married' as their marital status.
The result of this query will give you the count of customers in San Francisco who are married, using the column alias 'customer_count' for the result.
Remember to adjust the table and column names based on your actual schema if they differ from the example.
Feel free to ask if you have more questions related to SQL or database in general.
This capability is available through any SQL IDE, SQL Developer Web, Oracle Application Express (APEX), and Oracle Machine Learning Notebooks. Any application that invokes SQL and has an AI provider account also has access to Select AI.
The integration of artificial intelligence into Oracle Autonomous Database through Select AI represents a significant advancement in the way users can interact with their data. While there are certain limitations in terms of its availability, the ability to perform complex queries using natural language through DBMS_CLOUD_AI.GENERATE allows a greater number of users to leverage the power of databases without the need for advanced technical skills.
Without a data strategy for AI, an organization's efforts will be greater than necessary, risks will be magnified, and chances of success will be reduced. Oracle Cloud provides several AI Services embedded in the mentioned tools. You can review the complete list here: Generative AI Services.
Remember you can build, test, and deploy applications on Oracle Cloud for free in the following link: Start for Free.
Conclusion
Oracle 23ai and Oracle Cloud Infrastructure (OCI) are reshaping the way developers and DBAs approach modern challenges. With cutting-edge features like vector search, APEX Assistant, and Select AI, Oracle has created tools that bridge the gap between technical complexity and user-friendly innovation.
These advancements make it easier to harness the power of AI directly within the database, reducing data fragmentation and enabling seamless integration with cloud services. Whether you're streamlining your workflows, exploring new possibilities with generative AI, or delivering smarter applications, Oracle 23ai empowers you to take your projects to the next level.
Dive into Oracle’s AI-powered ecosystem today and see how these tools can transform the way you build, query, and innovate!
Happy Holidays! 🎄
SUBMIT YOUR COMMENT