DBA Blogs

Building Stateful AI Agents That Actually Remember : Moving Beyond RAG in Oracle AI

Pakistan's First Oracle Blog - Mon, 2026-06-08 00:32

RAG (Retrieval-Augmented Generation) is great for looking things up. But it’s not memory. Real AI agents need continuity — they need to remember user preferences, past decisions, policies, and completed work across sessions. That’s where a proper memory system comes in.

This guide shows how to evolve basic RAG into a production-grade memory layer that gives your agents true statefulness, continuity, and governance.

Why Basic RAG Falls Short
  • No multi-turn continuity — agents forget what was just discussed
  • No resumability — close the tab and everything is lost
  • No long-term recall of user preferences or policies
  • Prompts grow uncontrollably, leading to higher costs and lost-in-the-middle problems

RAG is retrieval. Memory is a write path + retrieval + governance loop.

What a Real Memory System Looks Like

A memory system adds a durable write path and a manager that decides what to store, how to retrieve it, and how to rebuild the prompt on every turn. It turns one-time lookup into reusable, governed knowledge.

Core loop per turn:

  1. Append user message to trace
  2. Retrieve relevant typed memory (policy, preferences, facts, episodes)
  3. Reassemble prompt from memory (never accumulate transcript)
  4. Call the model
  5. Extract and promote new artifacts through a gate
The Five Types of Memory

Don’t throw everything into one vector store. Separate concerns:

1. Policy Memory

Rules, guardrails, compliance constraints. Exact-match lookup, never similarity.

2. Preference Memory

User settings and personalization (“always return JSON”, “use DD/MM/YYYY”). Fast keyed lookup.

3. Fact Memory

Durable assertions with provenance (“Acme’s production DB is in us-east-1”). Hybrid lexical + semantic retrieval.

4. Episodic Memory

Summaries of completed tasks. Reusable patterns for similar future work.

5. Trace Memory

Raw execution log for replay, debugging, and audit. Append-only, high volume.

Storage Tradeoffs That Matter
  • Short-term vs Long-term — Keep working set in RAM, durable state in the database
  • Filesystem vs Database — Files are great for single-tenant prototypes; databases are required for multi-tenant production
  • Typed tables vs single store — Separate tables per memory type give you the right indexes, retention, and access patterns
Two Retrieval Paths You Need
  1. Known-scope lookup — Policy and preferences (exact match, runs every turn)
  2. Semantic discovery — Facts and episodes (hybrid lexical + vector search)

Always filter by scope before ranking — never after.

How to Add Memory to Your Agent (Practical Steps)
  1. Type your memory — label everything as policy, preference, fact, episodic, or trace
  2. Scope every record (tenant_id, user_id, agent_id)
  3. Build a promotion gate that decides what gets stored durably
  4. Reassemble the prompt on every turn from memory (don’t accumulate transcript)
  5. Instrument the entire loop for replay and audit
Conclusion

RAG gives you lookup. A memory system gives you continuity, personalization, and governed recall. The difference is the write path, typed storage, scoped retrieval, and a manager that reassembles context intelligently on every turn.

Once you have a real memory layer, your agents stop feeling stateless and generic. They start to feel like they actually know the user, remember past work, and follow the right rules — every single time.

Models are shared. Your memory system is what makes your AI product yours.

Start small, type your memory early, and build the promotion gate before you scale. The investment pays off the moment your users come back for a second conversation.

Categories: DBA Blogs

Oracle Deep Data Security in AI Database 26ai: Secure AI Agents at the Source

Pakistan's First Oracle Blog - Sat, 2026-06-06 09:30

AI agents are powerful, but they introduce a serious new risk: they act as autonomous insiders with broad database access. Traditional application-layer security can’t keep up. Oracle Deep Data Security changes that by enforcing end-user authorization directly inside the database — even when AI agents, vibe-coded apps, or analytics tools query data on a user’s behalf.

Now available in Oracle AI Database 26ai, Deep Data Security brings true “security at the source” to the agentic era.

The Problem: Privileged Access in the AI Era

Most applications use highly privileged database connections. The app layer is supposed to filter data for each user. But AI agents don’t follow predefined queries — they generate their own. This creates massive risk of unauthorized data exposure, especially with prompt injection or unexpected agent behavior.

Even vibe-coded or rapidly evolving applications can’t be trusted to enforce security perfectly every time.

How Oracle Deep Data Security Solves It

Deep Data Security lets you propagate the real end-user identity and context (via OAuth tokens or direct authentication) into the database at runtime. Declarative data grants then enforce row-level, column-level, and cell-level access based on who the user is — not on what the application or agent asks for.

The database automatically rewrites every query to apply the correct authorization rules before any data is returned. This works consistently whether the request comes from a traditional app, an AI agent, or a direct SQL query.

Real-World Example: Human Capital Management (HCM)

Consider an HR table containing sensitive employee data (SSN, salary, phone number, etc.).

  • Emma (employee) should only see her own record.
  • Marvin (her manager) should see his own record plus his direct reports, but not SSN or home address.

With Deep Data Security, both users (or any AI agent acting on their behalf) can query the same table. The database automatically returns only the data each person is authorized to see — no application code required.

Key Capabilities
  • End users (distinct from schema users) authenticate directly to the database
  • Data roles + data grants define precise row/column access using predicates
  • ORA_END_USER_CONTEXT.username resolves the current user’s identity at runtime
  • Works for AI agents, traditional apps, analytics tools, and direct SQL
  • Centralized policy management — no duplication of security logic across layers
Getting Started (FastLab Highlights)

Oracle provides a complete LiveLab to explore Deep Data Security in minutes. Here’s the core flow:

  1. Create end users (Emma and Marvin)
  2. Define data roles (HRAPP_EMPLOYEES and HRAPP_MANAGERS)
  3. Create data grants with predicates like:
    WHERE upper(user_name) = upper(ORA_END_USER_CONTEXT.username)
    or manager lookup logic
  4. Connect as each user and run queries — the database enforces boundaries automatically

Even if an AI agent generates unexpected SQL, the results are still correctly restricted.

Analyst Perspective

Leading analysts agree this is a critical shift for the agentic era:

“Oracle Deep Data Security introduces identity-aware, fine-grained access control enforced at the database layer… This is a big step up from application-layer controls that are hard to enforce consistently across rapidly evolving agentic workflows.” — Steve McDowell, NAND Research Conclusion

In the age of autonomous AI agents, security at the application layer is no longer enough. Oracle Deep Data Security moves enforcement to the database — where the data lives — giving you consistent, trustworthy, and auditable protection regardless of how data is accessed.

Categories: DBA Blogs

Cloudflare@OCI: Edge Security & Performance for Your OCI Applications and AI Workloads

Pakistan's First Oracle Blog - Sat, 2026-06-06 00:28

Modern applications and AI workloads demand global speed, strong security, and simple operations. Cloudflare@OCI delivers exactly that by combining Oracle Cloud Infrastructure’s powerful compute and AI platform with Cloudflare’s massive global edge network (330+ cities worldwide).

This strategic partnership lets you accelerate and protect your OCI workloads without managing multiple vendors or complex integrations.

Key Benefits of Cloudflare@OCI
  • Significantly reduce latency for users worldwide with Cloudflare’s global CDN
  • Protect against DDoS, bots, and API threats at the edge — before traffic reaches OCI
  • Apply consistent security policies across hybrid, multicloud, and on-premises environments
  • Simplify procurement and billing — everything is available directly in the OCI Console
  • Lower data transfer costs through the Bandwidth Alliance (zero egress fees for OCI Object Storage in North America)
Four Service Bundles to Match Your Needs

Choose the right level of edge protection and performance:

  • Cloudflare Business Services — Essential CDN, DDoS protection, WAF, and basic rate limiting
  • Cloudflare Enterprise Entry — Advanced certificate management, load balancing, and logging
  • Cloudflare Enterprise Essential — Optimized routing, enhanced DDoS protection, and accelerated DNS
  • Cloudflare Enterprise Advanced — Full security suite including Bot Management, advanced rate limiting, content scanning, and client-side protection
Perfect for AI Workloads

AI applications require low latency, strong security, and reliable global delivery. Cloudflare@OCI helps you:

  • Accelerate AI inference and model serving at the edge
  • Secure AI APIs and vector search endpoints
  • Protect against prompt injection and other emerging AI threats
  • Deliver consistent performance for distributed AI systems across regions
How to Get Started
  1. Log in to the OCI Console
  2. Navigate to Identity & Security
  3. Browse and select the Cloudflare@OCI package that fits your needs
  4. Purchase and connect your OCI workloads to Cloudflare
  5. Configure policies and deploy in minutes
Conclusion

Cloudflare@OCI gives you the best of both worlds: OCI’s high-performance cloud infrastructure paired with Cloudflare’s industry-leading edge security and global performance platform — all managed through a single, Oracle-led experience.

Whether you’re building traditional web apps, modern microservices, or production AI systems, this partnership helps you deliver faster, safer, and more reliable experiences to users everywhere.


Categories: DBA Blogs

Master Regular Expressions in Oracle AI Database: Powerful Pattern Matching for Developers

Pakistan's First Oracle Blog - Fri, 2026-06-05 00:25

Regular expressions (regex) are one of the most powerful tools for working with text in Oracle AI Database. Whether you need to validate phone numbers, extract email addresses, clean messy data, or enforce complex business rules, Oracle’s built-in regex support makes it fast, efficient, and easy to implement directly in SQL.

Why Use Regular Expressions in Oracle?
  • Centralize complex pattern-matching logic in the database instead of the application layer
  • Enforce data quality and business rules with CHECK constraints
  • Search, replace, and transform text with simple SQL functions
  • Greatly simplify data validation, extraction, and cleansing tasks
Oracle SQL Regex Functions

Oracle provides five powerful functions/conditions for regular expressions:

Function / ConditionDescription REGEXP_LIKEReturns TRUE if the string matches the pattern (perfect for WHERE clauses and CHECK constraints) REGEXP_COUNTCounts how many times the pattern appears REGEXP_INSTRReturns the position where the pattern starts REGEXP_SUBSTRExtracts the matching substring REGEXP_REPLACEReplaces matching text with new content Basic Syntax and Options
REGEXP_LIKE(source_string, pattern [, match_parameter])

Common match parameters:

  • 'i' — case-insensitive
  • 'c' — case-sensitive (default)
  • 'n' — dot (.) matches newline
  • 'm' — multiline mode (^ and $ match start/end of lines)
  • 'x' — ignore whitespace in pattern
Practical Examples Example 1: Enforce Phone Number Format with a CHECK Constraint
CREATE TABLE contacts (
    last_name  VARCHAR2(30),
    phone      VARCHAR2(30)
    CONSTRAINT valid_phone 
    CHECK (REGEXP_LIKE(phone, '^\(\d{3}\) \d{3}-\d{4}$'))
);
Example 2: Count Occurrences (Case-Insensitive)
SELECT REGEXP_COUNT('Albert Einstein', 'e', 1, 'i') AS count_e
FROM dual;
Example 3: Extract Email Addresses
SELECT REGEXP_SUBSTR(email, '\w+@\w+(\.\w+)+') AS email_address
FROM employees;
Example 4: Reposition Characters with Back References
SELECT 
    names,
    REGEXP_REPLACE(names, '^(\S+)\s(\S+)\s(\S+)$', '\3, \1 \2') AS formatted_name
FROM famous_people;
POSIX and PERL-Influenced Operators

Oracle supports the full set of POSIX operators plus useful PERL-style shortcuts:

  • \d — digit
  • \w — word character (alphanumeric + underscore)
  • \s — whitespace
  • \A, \Z, \z — string anchors
  • Nongreedy quantifiers (+?, *?, etc.)
Best Practices
  • Use regex in CHECK constraints to enforce data quality at the database level
  • Prefer regex over complex string functions when pattern matching is involved
  • Test thoroughly — regex can be tricky with edge cases
  • Use the 'x' flag to make complex patterns more readable
  • Combine with other SQL features (e.g., REGEXP_REPLACE inside UPDATE statements)
Conclusion

Regular expressions in Oracle AI Database give you enterprise-grade text processing power directly in SQL. From simple validation to complex data transformation, regex lets you solve real-world text problems efficiently without leaving the database.

Whether you’re cleaning data, enforcing business rules, or building sophisticated search features, mastering Oracle regex will make you a much more effective developer.

Categories: DBA Blogs

Real-World Performance Best Practices for Oracle AI Database Applications

Pakistan's First Oracle Blog - Thu, 2026-06-04 00:23

Building applications on Oracle AI Database that scale, stay fast, and remain secure in production requires deliberate design choices. The Oracle Real-World Performance group has proven over years of testing that three simple practices make the biggest difference: **bind variables**, **instrumentation**, and **set-based processing**.


These techniques are even more critical in the AI era, where applications often combine transactional workloads with AI agents, vector search, and MCP Server interactions.

1. Always Use Bind Variables

Bind variables are one of the easiest ways to dramatically improve scalability and security.

Instead of concatenating strings into SQL (which causes hard parsing, latch contention, and SQL injection risks), use placeholders:

-- Bad: String concatenation
INSERT INTO test (x, y) VALUES (''' || REPLACE(x, '''', '''''') || ''', ''' || REPLACE(y, '''', '''''') || '''');

-- Good: Bind variables
INSERT INTO test (x, y) VALUES (:x, :y);

Benefits:

  • Only one statement is parsed and cached in the shared pool
  • Massive reduction in latches and CPU overhead
  • Supports thousands of users without performance degradation
  • Protects against SQL injection attacks
2. Add Instrumentation Everywhere

Instrumentation means adding debug/trace code that helps you understand exactly what your application is doing at runtime.

In Oracle, this is as simple as setting MODULE and ACTION in V$SESSION or enabling SQL Trace. When something goes wrong in a multi-tier or AI-augmented application, trace files quickly show you which tier is causing the issue.

Good practice in PL/SQL or application code:

DBMS_APPLICATION_INFO.SET_MODULE(module_name => 'AI_AGENT_WORKFLOW', 
                                 action_name => 'PROCESS_CUSTOMER_DATA');

Instrumentation is essential when working with AI agents, MCP Server, or Private Agent Factory — it lets you trace exactly what the LLM is doing in the database.

3. Prefer Set-Based Processing Over Iterative (Row-by-Row)

For large data volumes, set-based SQL is orders of magnitude faster than row-by-row processing.

Row-by-Row (Slow)
DECLARE
  CURSOR c IS SELECT * FROM ext_scan_events;
BEGIN
  FOR r IN c LOOP
    INSERT INTO stage1_scan_events VALUES r;
    COMMIT;   -- Very expensive!
  END LOOP;
END;
Set-Based (Fast)
ALTER SESSION ENABLE PARALLEL DML;

INSERT /*+ APPEND */ INTO stage1_scan_events
SELECT * FROM ext_scan_events;

COMMIT;

Why set-based wins:

  • Eliminates network round-trips and repeated parsing
  • Leverages Oracle’s parallel execution and direct-path loads
  • Reduces commits dramatically
  • Handles billions of rows efficiently

Array processing and manual parallelism are better than pure row-by-row, but set-based SQL remains the clear winner for performance.

Summary: Three Rules for Real-World Performance
  1. Use bind variables everywhere — for security and scalability
  2. Instrument your code — so you can debug and monitor AI-augmented workflows
  3. Think in sets, not rows — let the database do the heavy lifting
Conclusion

In the AI era, applications are more complex than ever — mixing OLTP, vector search, agents, and analytics. Following these three real-world performance practices will keep your Oracle AI Database applications fast, scalable, and easy to maintain.

Small design decisions made early (bind variables, instrumentation, set-based SQL) deliver massive returns in production.

Categories: DBA Blogs

Aggregation Filters in Oracle AI Database 26ai: Cleaner Conditional Aggregates

Pakistan's First Oracle Blog - Wed, 2026-06-03 00:22

Need to calculate different aggregates based on conditions in a single query — without multiple subqueries or CASE statements? Oracle AI Database 26ai introduces **Aggregation Filters**, a clean and powerful new feature that makes conditional SUM, COUNT, AVG, and other aggregates much simpler.

What Are Aggregation Filters?

Aggregation filters let you apply a WHERE condition directly inside an aggregate function. Only rows that match the condition are included in that specific calculation.

Syntax
aggregate_function ( expression ) FILTER ( WHERE condition )

Works with any aggregate function: SUM, COUNT, AVG, MAX, MIN, etc.

Practical Examples Example 1: Count Only Active Records
SELECT COUNT(*) FILTER (WHERE status = 'ACTIVE') AS active_count
FROM employees;
Example 2: Sum Salaries for a Specific Department
SELECT SUM(salary) FILTER (WHERE department = 'SALES') AS sales_total
FROM employees;
Example 3: Multiple Conditional Counts in One Query
SELECT
    COUNT(*) FILTER (WHERE status = 'ACTIVE')   AS active_count,
    COUNT(*) FILTER (WHERE status = 'INACTIVE') AS inactive_count
FROM employees;
Example 4: Quarterly Sales Breakdown in One Pass
SELECT
    year,
    SUM(sales)                                   AS year_sales,
    SUM(sales) FILTER (WHERE qtr_num IN (1, 2)) AS q1q2_sales,
    SUM(sales) FILTER (WHERE qtr_num IN (3, 4)) AS q3q4_sales
FROM sales_fact f
LEFT OUTER JOIN time_dim t ON (f.time_id = t.month_id)
GROUP BY year
ORDER BY year;
Key Notes
  • Aggregation filters are evaluated after the main WHERE clause of the query.
  • They provide a much cleaner alternative to writing separate subqueries or complex CASE expressions.
  • You can combine multiple filtered aggregates in the same SELECT list.
Best Practices
  • Use aggregation filters whenever you need different conditional totals in the same result set
  • They are especially powerful for reporting, dashboards, and analytics queries
  • Combine with GROUP BY for even more flexible breakdowns
  • Great for simplifying queries that previously required multiple CTEs or subqueries
Conclusion

Aggregation filters are a small but incredibly useful enhancement in Oracle AI Database 26ai. They make your SQL cleaner, more readable, and more performant by eliminating unnecessary subqueries and complex logic.

Whether you’re building reports, dashboards, or analytical applications, aggregation filters will quickly become one of your favorite new SQL features.


Categories: DBA Blogs

How to Create JSON-Relational Duality Views in Oracle AI Database 26ai

Pakistan's First Oracle Blog - Mon, 2026-06-01 19:42

JSON-Relational Duality Views let you expose your relational tables as flexible JSON documents — and update them both ways — without any data duplication. Here’s a practical, step-by-step guide to creating them.


Why Create Duality Views?
  • Developers get simple JSON documents for modern apps
  • DBAs keep normalized, relational tables for consistency and analytics
  • Both views work on the exact same underlying data
Simple Duality View Example (Department)
-- 1. Create the underlying relational table
CREATE TABLE dept_tab (
    deptno    NUMBER(2,0) PRIMARY KEY,
    dname     VARCHAR2(14),
    code      NUMBER(13,0),
    state     VARCHAR2(15),
    country   VARCHAR2(15)
);

-- 2. Create the Duality View
CREATE JSON RELATIONAL DUALITY VIEW dept_dv AS
  SELECT JSON { '_id'      : d.deptno,
                'deptName' : d.dname,
                'location' : { 'zipcode' : d.code,
                               'country' : d.country }
    FROM dept_tab d
    WITH UPDATE INSERT DELETE;

This view now supports clean JSON documents while the data stays normalized in the table.

More Complex Example: Orders with Nested Data
CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW orders_ov AS
SELECT JSON { '_id'          : ord.order_id,
              'orderTime'    : ord.order_datetime,
              'orderStatus'  : ord.order_status,
              'customerInfo' : (SELECT JSON { 'customerId'   : cust.customer_id,
                                             'customerName' : cust.full_name,
                                             'customerEmail': cust.email_address }
                                FROM customers cust 
                                WHERE cust.customer_id = ord.customer_id),
              'orderItems'   : (SELECT JSON_ARRAYAGG(
                                   JSON { 'orderItemId' : oi.line_item_id,
                                          'quantity'    : oi.quantity,
                                          'productInfo' : ...,
                                          'shipmentInfo': ... }
                                 ) 
                                 FROM order_items oi 
                                 WHERE ord.order_id = oi.order_id)
    }
FROM orders ord
WITH INSERT UPDATE DELETE;
Controlling Updatability

Use the WITH clause to control what operations are allowed:

  • WITH INSERT UPDATE DELETE — Fully updatable (default for root table)
  • WITH NOINSERT NODELETE NOUPDATE — Read-only
  • You can override at column level: WITH NOUPDATE or WITH UPDATE
Key Rules for Duality Views
  • Every underlying table needs at least one identifying column (primary key, unique key, or identity column)
  • Use nested subqueries for 1-to-N relationships → becomes a JSON array
  • Use UNNEST for 1-to-1 relationships to merge into the same object
  • Supported column types include VARCHAR2, NUMBER, DATE, JSON, VECTOR, etc.
  • Each duality view has a single DATA column of type JSON
Automatic Metadata Fields

Every document automatically includes:

{
  "_metadata": {
    "etag": "abc123...",     -- for optimistic concurrency
    "asof": 1234567890       -- system change number (SCN)
  }
}
Best Practices
  • Start with simple single-table views to learn the pattern
  • Use meaningful field names in JSON (not just column names)
  • Combine with AI Vector Search or Private Agent Factory for powerful AI apps
  • Always test updates through both the document view and relational tables
Conclusion

Creating JSON-Relational Duality Views is straightforward with a simple SQL statement. You get the best of both worlds: document flexibility for modern apps and relational power for analytics and integrity — all on the same data.

Categories: DBA Blogs

JSON-Relational Duality Views in Oracle AI Database: The Best of Documents and Tables

Pakistan's First Oracle Blog - Sun, 2026-05-31 20:00

Oracle AI Database 26ai introduces **JSON-Relational Duality Views** — a powerful feature that lets you access the exact same data as either relational tables **or** JSON documents, without any data duplication or complex synchronization.


It gives you the flexibility of documents and the power of relational databases at the same time.

Why Duality Views Matter
  • Developers love JSON documents for their simplicity and hierarchy
  • DBAs and analysts love relational tables for normalization, consistency, and analytics
  • Duality views let both teams work on the **same underlying data** using whichever model fits their needs
How Duality Views Work

A duality view is a declarative mapping between relational tables and JSON documents. The data is stored **relationally** (in tables), but you can read and write it as JSON documents — the database automatically handles the assembly and disassembly.

Changes made through the document view instantly appear in the tables, and vice versa.

Simple Example
-- 1. Create the underlying relational table
CREATE TABLE dept_tab (
    deptno    NUMBER(2,0) PRIMARY KEY,
    dname     VARCHAR2(14),
    code      NUMBER(13,0),
    state     VARCHAR2(15),
    country   VARCHAR2(15)
);

-- 2. Create the Duality View
CREATE JSON RELATIONAL DUALITY VIEW dept_dv AS
  SELECT JSON { '_id'      : d.deptno,
                'deptName' : d.dname,
                'location' : { 'zipcode' : d.code,
                               'country' : d.country }
    FROM dept_tab d
    WITH UPDATE INSERT DELETE;

This single view now supports a collection of JSON documents like this:

{
  "_id"      : 200,
  "deptName" : "HR",
  "location" : {
    "zipcode" : 94065,
    "country" : "USA"
  }
}
Key Benefits
  • Document-centric apps can use MongoDB API, ORDS, or SQL/JSON functions
  • Relational apps can query the underlying tables directly with SQL
  • No data duplication — everything stays normalized and consistent
  • Full updatability (INSERT, UPDATE, DELETE) on the document side
  • Multiple duality views can be built on the same tables for different use cases
Advanced Capabilities
  • Some columns can be left unmapped (not exposed in JSON)
  • You can store parts of the document as native JSON columns for maximum flexibility
  • Fields can be generated automatically or hidden for internal use
  • Views can be fully updatable, partially updatable, or read-only
Best Practices
  • Use duality views for applications that need both flexible documents and strong relational integrity
  • Start simple — map one or two tables first
  • Leverage JSON columns for complex nested structures that don’t need normalization
  • Combine with Oracle AI Vector Search, Private Agent Factory, or MCP Server for powerful AI use cases
Conclusion

JSON-Relational Duality Views eliminate the traditional trade-off between document and relational models. You get the best of both worlds in a single, high-performance, secure Oracle Database engine.

Whether you’re building modern microservices, AI-powered applications, or traditional enterprise systems, duality views give you maximum flexibility without compromising on data integrity or performance.

Categories: DBA Blogs

WAIT Clause for DMLs in 26.2

Hemant K Chitale - Sun, 2026-05-24 09:26

 Oracle 26ai 26.2 now introduces the WAIT (and NOWAIT) Clause for INSERT / UPDATE / DELETE / MERGE DMLs.  We have had a WAIT Clause for SELECT FOR UPDATE statements but not for these "simple" DML statements.


This is my Video Demo :  Wait Clause for DMLs in 26.2




Categories: DBA Blogs

AI Enrichment in Oracle SQL Developer for VS Code: Make Your Database AI-Ready

Pakistan's First Oracle Blog - Sun, 2026-05-24 02:26

Want your AI tools and LLMs to generate accurate SQL queries and truly understand your database? AI Enrichment lets you add business context, descriptions, and metadata to your schema — without changing any data or structure.

This powerful feature turns opaque database schemas into clear, AI-friendly assets.

What is AI Enrichment?

AI Enrichment is the process of adding human-readable descriptions, synonyms, business context, and logical groupings to your database objects (schemas, tables, and columns).

It helps LLMs and AI agents understand the real meaning and relationships in your data, dramatically improving the quality of generated SQL and natural language responses.

Why AI Enrichment Matters
  • Raw table/column names (like T1, C123, EMP_ID) are ambiguous to LLMs
  • Enrichment provides the missing business context
  • Leads to more accurate, efficient, and trustworthy AI-generated queries
  • Makes your database truly AI-ready for tools like Select AI, MCP Server, and Agent Factory
How It Works with LLMs

When you ask an AI tool a question, it automatically pulls your enrichment metadata and injects it into the prompt sent to the LLM. This gives the model rich context such as:

“The table EMPLOYEE contains current and former staff. EMP_ID is also known as employee number or worker id...” Getting Started Prerequisites
  • VS Code 1.101.0 or higher
  • Oracle SQL Developer for VS Code 25.3.0 or higher
  • Active connection to your Oracle Database
  • User with CREATE VIEW, CREATE TABLE, CREATE SEQUENCE, CREATE PROCEDURE privileges
Step 1: Enable AI Enrichment
  1. Open your database connection in SQL Developer for VS Code
  2. Expand the connection → Click the AI Enrichment folder
  3. Click Yes to create the required metadata objects
Step 2: Use the AI Enrichment Dashboard

The dashboard is your central command center. It shows:

  • Schema-level description
  • Table groups and enrichment percentage
  • Intelligent suggestions for missing context
Enrich Your Schema Step-by-Step 1. Define Schema Business Context

In the dashboard, add a high-level description under “About this schema”, for example:

This schema manages core HR processes including employees, departments, payroll, and benefits.
2. Create Table Groups

Group related tables by business domain (e.g., “Employee Management”, “Payroll”, “Recruitment”). This helps LLMs understand logical relationships even without foreign keys.

3. Enrich Tables & Columns
  • Add clear natural language descriptions
  • Create key-value annotations (synonyms, business rules, valid values, etc.)
  • Mark tables as “Enrichment Complete” when done
Best Practices
  • Start with the most important / frequently queried tables
  • Use consistent, concise language in descriptions
  • Add synonyms and common business terms as annotations
  • Keep enrichment up-to-date as your schema evolves
  • Use Table Groups to reflect real business domains
Conclusion

AI Enrichment is one of the highest-ROI steps you can take to make your Oracle Database truly intelligent and AI-ready. By investing a little time in adding context today, you unlock much more accurate and useful AI interactions tomorrow.

Whether you're using Select AI, MCP Server, Private Agent Factory, or any LLM-powered tool — enriched schemas deliver dramatically better results. 

Categories: DBA Blogs

Unable to Perform ONLINE DDLs on tables when Supplemental Logging is enabled

Tom Kyte - Fri, 2026-05-15 16:28
Dear Tom, In our ERP, we are actively consuming both EBR & Supplemental Logging. EBR is for upgrades with a near zero downtime while Supplemental Logging is mainly for CDC, LogMiner & GoldenGate. But we encounter errors when ALTER TABLE statements are executed for normal tables in ONLINE mode while Supplemental Logging is enabled. The error we are getting is: <i>ORA-14416: Online DDL's cannot be used with certain types of tables.</i> Quick Test Steps: -- enable minimal supplemental logging (from CDB) <code> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;</code> -- create first table and its constraints <code> CREATE TABLE ORDER_TABLE ( ID VARCHAR2(50), DESCRIPTION VARCHAR2(100), ORDER_DATE DATE, CUSTOMER_ID VARCHAR2(50), CF_ID VARCHAR2(50) ); ALTER TABLE ORDER_TABLE ADD CONSTRAINT ORDER_PK PRIMARY KEY (ID); ALTER TABLE ORDER_TABLE ADD CONSTRAINT ORDER_CFK UNIQUE (CF_ID) USING INDEX; </code> -- create second table and its constraints <code> CREATE TABLE ORDER_CF_TABLE ( CF_ID VARCHAR2(50), AUTH_ID VARCHAR2(100), AUTH_DATE DATE ); ALTER TABLE ORDER_CF_TABLE ADD CONSTRAINT ORDER_CF_PK PRIMARY KEY (CF_ID); ALTER TABLE ORDER_CF_TABLE ADD CONSTRAINT ORDER_CF_RK FOREIGN KEY (CF_ID) REFERENCES ORDER_TABLE (CF_ID) ON DELETE CASCADE; ALTER TABLE ORDER_CF_TABLE ADD CONSTRAINT ORDER_CF_TABLE_CF_ID_NN CHECK ("CF_ID" IS NOT NULL); </code> Now try to execute below: <code>ALTER TABLE ORDER_CF_TABLE DROP CONSTRAINT ORDER_CF_RK KEEP INDEX ONLINE;</code> Error ORA-14416 is raised. Since both ONLINE mode for table DDLs & Supplemental Logging are key functionalities in Oracle database, what we believe is, it should be possible to use them at the same time. Could you please explain this behavior & any possible ways to achieve ONLINE DDLs on tables for upgrades while supplementary logging is enabled? Thanks & Kind Regards, Navinth
Categories: DBA Blogs

Authid current user functionality

Tom Kyte - Fri, 2026-05-15 16:28
Hi Connor, Let me describe the situation. Our client is running a warehouse management system. There are two schemas wh1 and wh2. All the packages and procedures are created in schema wh1 with authid current user. Today I have faced the issue with the SKU master. Both the schemas have the SKU master, which should be ideally identical. When a particular procedure of a package is called from schema wh2 and was looking for an SKU which was present in schema wh2 but was missing from wh1 it flagged an error that the SKU is missing. When I created the SKU in schema wh1 it processed successfully. This is really puzzling. To best of my knowledge when the procedure is being called from schema wh2 it should access schema wh2 tables by default when we are not prefixing the table name with schema name. Am I missing something. Please share your view. Let me try with a sample code: tablename : sku schemas : wh1 and wh2 The said table is created in both the schemas. Lets sku 'SAMPLE1' is in schema wh2. But this sku does not exist in schema wh1. create or replace package wh1.sync_sku is authid current_user; begin upsert_sku(p_sku varchar2); end; create or replace package body wh1.sync_sku is begin procedure upsert_sku(p_sku varchar2) is declare v_found char(1) := 'N'; begin select 'Y' into v_found from sku where sku = p_sku; exception when no_data_found then raise_appliocation_error(-20001, 'SKU does not exist'); when others then raise; end; end; When the procedure upsert_sku is executed from schema wh2 with parameter 'SAMPLE1' its showing the error 'SKU does not exist' although the sku is exist in schema wh2. As soon as we insert the sku in schema wh1 the procedure executes successfully. The schema wh2 have all the required rights to execute the procedure of schema wh1.
Categories: DBA Blogs

segregration of duties template for Oracle Database

Tom Kyte - Fri, 2026-05-15 16:28
Oracle has published following document for MySQL: https://blogs.oracle.com/mysql/why-your-application-should-not-use-one-mysql-user-for-everything. I have not found similar document for Oracle Database: I would like to know if Oracle has documented something similar for Oracle Database ? Thanks.
Categories: DBA Blogs

oracle error 1408 and 6502

Tom Kyte - Fri, 2026-05-15 16:28
how to find which field raise the error 6502 or 1408?
Categories: DBA Blogs

include heading while downloading an interactive report into pdf

Tom Kyte - Fri, 2026-05-15 16:28
hi I have created an interactive report I want to include heading e.g. Amountwise advances as on how can I do this Also I want to include heding while downloading as pdf please help
Categories: DBA Blogs

Index logging

Tom Kyte - Fri, 2026-05-15 16:28
what is the difference between logging and nologging when creating an index
Categories: DBA Blogs

add a new column to table The column will be of type NUMBER(19,0) and nullable (null by default).

Tom Kyte - Fri, 2026-05-15 16:28
My question is if they add the column the table will be block during the coluum add because it's not enteprise but standard edition
Categories: DBA Blogs

Pour the Water: A Mental Health Month Note for Those of Us in Tech

DBASolved - Tue, 2026-05-12 06:09

A Mental Health Month note for those of us in tech: help anyway. Even when you're tired. Even when they can't help back.

The post Pour the Water: A Mental Health Month Note for Those of Us in Tech appeared first on DBASolved.

Categories: DBA Blogs

Oracle AI Database 26ai: The Complete Guide to Key Features

Pakistan's First Oracle Blog - Sun, 2026-05-10 01:47

Oracle AI Database 26ai is a converged, AI-native platform that brings together transactional, analytical, and AI workloads in one secure, high-performance engine. It eliminates data movement, reduces complexity, and delivers enterprise-grade capabilities for modern AI-powered applications.


AI Designed for Data Foundational AI Technologies
  • Unified Hybrid Vector Search — Combine semantic vector search with relational, JSON, graph, spatial, and text search in a single query.
  • Model Context Protocol (MCP) Server — Enables AI agents and LLMs to interact directly with the database for iterative reasoning and accurate results.
  • Built-in Data Privacy Protection — Row, column, and cell-level security with dynamic masking so agents only see authorized data.
  • Oracle Unified Memory Core — Low-latency reasoning across all data types (vector, JSON, graph, relational, etc.) in one engine.
  • Oracle Exadata for AI — Hardware + software co-engineered for massive acceleration of vector queries via AI Smart Scan and offload.
  • NVIDIA Integration — Support for NVIDIA NIM containers and future GPU acceleration via Private AI Services Container.
AI for Application Development
  • Private Agent Factory — No-code visual builder to create, deploy, and manage secure data-centric AI agents (Knowledge Agent, Data Analysis Agent, etc.).
  • Select AI Agent — In-database framework for building and orchestrating agentic workflows.
  • AI Semantic Modeling — Helps AI understand data context for better code generation and answers.
  • Unified Data Model — Access the same data as relational, JSON document, or graph using SQL.
End Data Chaos – Converged Data Architecture
  • Native support for relational, vector, JSON, graph, spatial, and more — all in one database
  • Unified support for OLTP, analytics, AI Vector Search, Agentic AI, IoT, and streaming
  • Single management plane via Oracle Enterprise Manager and OCI Database Management
End Data Lock-in – Open & Multicloud
  • Autonomous AI Lakehouse with full Apache Iceberg support
  • Oracle Vectors on Ice — Run AI Vector Search directly on Iceberg tables in your data lake
  • Available on OCI, AWS, Azure, Google Cloud, and on-premises (Exadata, etc.)
  • Oracle APEX for rapid low-code development
End Data Risk – Mission-Critical Security & Availability
  • Oracle Database Vault, Label Security, SQL Firewall, Deep Data Security
  • Flashback Technologies and Zero Data Loss Cloud Protect
  • Real Application Clusters (RAC), Active Data Guard, Globally Distributed Database with RAFT replication
  • Post-quantum cryptography support
  • True Cache for consistent mid-tier caching
Conclusion

Oracle AI Database 26ai is more than just a database — it’s a complete AI-powered data platform that brings together vectors, agents, analytics, and mission-critical OLTP in one secure, high-performance engine.

Whether you’re building RAG applications, agentic workflows, or modern data lakehouses, Oracle AI Database gives you the convergence, security, and performance enterprises demand — without data movement or lock-in.


Categories: DBA Blogs

Pages

Subscribe to Oracle FAQ aggregator - DBA Blogs