Oracle Analytics Cloud (OAC) empowers organizations with modern, AI-powered analytics — enabling dynamic visualizations, interactive dashboards, and real-time insights.
Imagine extracting detailed insights from your OAC usage data without writing a single SQL query. Instead of wrestling with complex joins and hunting through data dictionaries, you could simply ask questions in plain English and get instant, AI-powered answers.
This is now possible with the Oracle SQLcl Model Context Protocol (MCP) Server, which bridges the gap between your OAC usage tracking database and natural language queries. This powerful combination transforms how administrators and analysts interact with usage data, making insights accessible to everyone regardless of their SQL expertise.
Understand Usage Tracking in Oracle Analytics Cloud
Usage tracking is a powerful enterprise feature that captures granular data at the detailed user query level. When you enable usage tracking in Oracle Analytics Cloud, it provides comprehensive insights to answer critical business questions about user engagement, time allocation, session analytics, query relationships, navigation patterns, and incident correlation.
Usage tracking collects data records for every query that users run, capturing both logical and physical queries in separate database tables. The system tracks query execution times, data processing metrics, user session details, system performance indicators, and error analytics for comprehensive monitoring.
This granular data helps organizations monitor system performance, predict user behavior, and proactively increase efficiency while reducing errors. The collected data is stored in dedicated schema tables, typically in an Oracle Autonomous Data Warehouse (ADW) for optimal security and performance.
For detailed configuration and implementation guidance, see the Oracle Analytics Cloud Usage Tracking documentation.
The Power of Natural Language Analytics
Traditional usage analysis requires SQL expertise and time-consuming query development. The SQLcl MCP Server eliminates these barriers by enabling natural language interactions with your usage data.
Instead of complex SQL, you can simply ask:
- “Who are the top ten most active users this quarter?”
- “Which dashboards are taking longer than 30 seconds to run?”
- “List all failed queries in the last seven days with their error messages”
- “Show subject areas with declining usage over the past 90 days”
- “Which users are the top AI Assistant adopters?”
- “What are the most frequently accessed reports in the Finance department?”
These queries are translated into efficient SQL behind the scenes, delivering results quickly and accurately.
Enhanced Insights with Anomaly Detection
Beyond static metrics, you can leverage your usage tracking data to detect unusual patterns that may require immediate action. Anomaly detection helps you identify issues before they escalate, ensuring optimal system performance.
Examples of anomaly detection queries in natural language:
- “Identify dashboards or reports whose average runtime has suddenly spiked in the last week.”
- “Spot dashboards with declining usage over the past three months.”
- “Detect an unexpected surge in AI Assistant queries by specific users.”
- “Find unusual error spikes that may indicate data source or configuration issues.”
- “Highlight users with abnormally high query failure rates compared to the average.”
These insights can prevent performance degradation, optimize workloads, and enhance overall user experience. For advanced users, you can combine this with custom SQL thresholds or integrate with alerting tools.
About the Model Context Protocol
The Model Context Protocol (MCP) is an open standard that defines a consistent way for applications to provide contextual information to AI models.
MCP standardizes the connection between AI systems and external tools or data sources, such as databases and APIs. To learn more about MCP, see Model Context Protocol.
About the SQLcl MCP Server
The SQLcl MCP Server extends Oracle SQLcl to support MCP-based communication. It enables AI applications to interact with Oracle databases using the standardized MCP interface, giving those applications a structured way to discover and use your databases.
How the SQLcl MCP Server Works
The Oracle SQLcl MCP Server acts as a bridge between your database and AI clients:
- Connects to your usage tracking schema in Oracle Autonomous Data Warehouse (ADW).
- Translates your natural language question into SQL.
- Executes the SQL and returns results instantly.
- Logs all interactions for auditing.
Step-by-Step Implementation
In this article, we use Windows for a quick setup. In my next article, I’ll show you how to host SQLcl MCP on Linux for a central, always-on deployment.
Architecture Overview
Prerequisites
Before you begin, ensure you have:
- ✅ OAC usage tracking enabled (Setup Guide)
- ✅ Java Runtime Environment (JRE) 17 or higher
- ✅ Oracle SQLcl version 25.2.0 or higher
- ✅ Claude Desktop or another MCP-compatible client
- ✅ ADW wallet file for database connectivity
- ✅ Database user with SELECT permissions on usage tracking tables
Set Up a Database User
Create a dedicated read-only user for MCP access with minimal privileges:
— As an admin user, create the MCP reader account
CREATE USER OAC_READER IDENTIFIED BY “StrongPassword!23”;
GRANT CREATE SESSION TO OAC_READER;
GRANT SELECT ON USAGE_TRACKING.LOGICALQUERIES TO OAC_READER;
GRANT SELECT ON USAGE_TRACKING.PHYSICALQUERIES TO OAC_READER;
GRANT SELECT ON USAGE_TRACKING.INITBLOCK_INFO TO OAC_READER;
This approach follows security best practices by granting only the minimum permissions required for usage tracking analysis.
Step 1: Set Up a Java Environment
Download and install Java 17 from Oracle’s Java Downloads page:
setx JAVA_HOME “C:\jdk-17.0.16”
setx PATH “%JAVA_HOME%\bin;%PATH%”
java -version
Why: SQLcl MCP requires Java 17 or higher for AI model integration and database connectivity.
Step 2: Install SQLcl
a. Download SQLcl from Oracle’s SQLcl Downloads page.
b. Extract to: C:\sqlcl-latest\sqlcl\
c. Verify the installation. From Windows PowerShell:
& “C:\sqlcl-latest\sqlcl\bin\sql.exe” -v
Expected output:
SQLcl: Release 25.2.2.0 Production Build: 25.2.2.199.0918
Why: SQLcl is your CLI for Oracle Database and the engine for MCP mode.
Step 3: Configure the Database Connection
From PowerShell:
# Keep the wallet as a ZIP; do not extract
$wallet = “C:\Users\<You>\Downloads\UT_ADW_Wallet.zip”
& “C:\sqlcl-latest\sqlcl\bin\sql.exe” `
-cloudconfig $wallet `
OAC_READER/<YourPassword>@adw_low
If you see Connected to: Oracle Database …, type exit;.
Why: Proves that the wallet path, user, and TNS alias are correct before you automate anything.
If you experience these errors:
- no ocijdbc23: You’re in thick mode; always use -cloudconfig <wallet.zip> (forces thin+wallet).
- Cloud Wallet is empty or invalid: You need to point to the ZIP file, not a folder.
Step 4: Create a Named Connection
Create a named connection in SQLcl for MCP access.
From PowerShell:
& “C:\sqlcl-latest\sqlcl\bin\sql.exe” `
-cloudconfig $wallet `
-save adw_mcp -savepwd OAC_READER/<Password>@adw_low
Quick validation from PowerShell:
& “C:\sqlcl-latest\sqlcl\bin\sql.exe” /nolog
At SQL>:
conn -n adw_mcp
select user, sysdate from dual;
exit;
You should connect without a password prompt.
Step 5: Validate the Usage Tracking Tables
Verify your usage tracking data is accessible using the OAC_READER connection:
— Existence / row counts (adjust owner if different)
SELECT COUNT(*) FROM USAGE_TRACKING.LOGICALQUERIES;
SELECT COUNT(*) FROM USAGE_TRACKING.PHYSICALQUERIES;
SELECT COUNT(*) FROM USAGE_TRACKING.INITBLOCK_INFO;
— Recent activity
SELECT * FROM USAGE_TRACKING.LOGICALQUERIES
WHERE START_TIME > SYSDATE – 7
ORDER BY START_TIME DESC
FETCH FIRST 10 ROWS ONLY;
Note: You’re connecting as the OAC_READER user but querying tables in the USAGE_TRACKING schema. This works because OAC_READER is granted SELECT permissions on these specific tables. When the MCP client is configured, you can run these same queries directly or ask natural language questions like “How many logical queries are in the tracking database?”
Why: Confirms usage tracking data is flowing and your user has the correct privileges.
Step 6: Wire the SQLcl MCP Server into Your MCP Client
Follow these steps to configure Claude Desktop for SQLcl MCP Server. After configuration, Claude Desktop automatically manages the SQLcl MCP Server which allows you to perform Oracle Database operations through your conversations with Claude.
a. Install Claude Desktop. See Installing Claude for Desktop.
b. Edit the configuration file at:
C:\Users\<You>\AppData\Roaming\Claude\claude_desktop_config.json
c. Add the MCP Server configuration:
{
“mcpServers”: {
“oac-usage-tracking”: {
“command”: “C:\\sqlcl-latest\\sqlcl\\bin\\sql.exe”,
“args”: [“-mcp”, “-n”, “adw_mcp”]
}
}
}
d. Restart Claude Desktop and verify the server appears under Local MCP Servers — it should show as running.
The SQLcl MCP Server offers tools such as:
- list-connections: Lists saved Oracle Database connections.
- connect: Establishes a connection.
- disconnect: Terminates the connection.
- run-sql: Executes SQL queries and PL/SQL.
- run-sqlcl: Executes SQLcl-specific commands.
Step 7: Ask Questions in Natural Language
From Claude Desktop, you can use natural language to ask questions:
- “Show me the list of users using AI Assistant feature.”
- “Give me list of AI Ready datasets”
- “Show me a summary of query performance patterns”
What’s happening under the hood?
The client interprets your question, generates the required SQL, and calls the SQLcl MCP tool. Then, SQLcl executes the SQL against your usage tracking tables, and the results come back summarized in a table. Power users can still directly run the SQL. For example:
/sqlcl run “select count(*) from USAGE_TRACKING.LOGICALQUERIES”
Security Best Practices
When you grant a large language model (LLM) access to your database, it introduces significant security risks. LLMs use the data you input to generate responses, so you might inadvertently expose tables or sensitive details.
To mitigate these risks, implement the following safeguards:
- Assign minimum permissions: Configure the database user account used by the LLM with the absolute minimum permissions required for its tasks. This approach limits what the LLM can access.
- Avoid production database access: Don’t grant LLMs direct access to production databases. Instead, you should use a sanitized, read-only replica or a dedicated data subset.
- Audit LLM activity: Regularly audit the queries executed by the LLM. This helps you detect anomalies or the attempts to access restricted data. To support your auditing efforts, the SQLcl MCP Server provides the following built-in monitoring capabilities:
- Session tracking: It populates V$SESSION.MODULE with the MCP client in use, and V$SESSION.ACTION with the LLM’s name.
- Activity logging: It creates a table named DBTOOLS$MCP_LOG that records every interaction and SQL execution.
- Query identification: All LLM-generated queries through the SQLcl MCP Server’s tools include the following comment for easy identification in the logs: /* LLM in use … */.
To learn more about monitoring, see Monitoring the SQLcl MCP Server.
Monitor What the LLM is Doing
SQLcl MCP helps you audit LLM activity:
— Every interaction & SQL execution
SELECT * FROM DBTOOLS$MCP_LOG
WHERE TIMESTAMP > SYSDATE – 1
ORDER BY TIMESTAMP DESC;
— Active sessions show client/model
SELECT MODULE, ACTION, USERNAME, LOGON_TIME
FROM V$SESSION
WHERE MODULE LIKE ‘%MCP%’;
Extend Beyond Usage Tracking – Include OCI Logs
If you ingest OAC’s audit and diagnostic logs from OCI into same ADW instance, the same SQLcl MCP setup can answer questions such as:
- “Who exported workbooks yesterday?”
- “Which dataflows failed this week?”
- “Show security/role changes last month.”
One MCP server… multiple operational datasets… instant answers.
The Payoff
With OAC usage tracking and SQLcl MCP Server, you can transform complex query analysis into simple conversations.
You gain:
- Faster insights: No manual query writing required.
- Increased adoption: Administrators and analysts can self-serve usage data easily.
- Proactive monitoring: Detect anomalies before they become critical issues.
- Better optimization: Make decisions based on real, current usage patterns.
💡 Next: In my follow-up article, I’ll show you how to run SQLcl MCP Server on Linux so that multiple analysts can connect and ask questions without the need to set up their own local environments.
Call to Action
Now that you’ve seen how the SQLcl MCP Server can unlock OAC Usage Tracking with natural language queries and anomaly detection, here are a few ways to take this further:
🔗 Learn More
💬 Join the Community
- Have questions or want to share your journey?
- Join the conversation in the Oracle Analytics Community — connect with other practitioners and get expert insights.
🛠️ Try it Yourself
- Set up your own SQLcl MCP Server, connect it to OAC Usage Tracking, Audit and Diagnostic logs, and start asking natural language questions to uncover insights instantly.
- To learn more about OAC, visit the Oracle Analytics product page and follow twitter@OracleAnalytics.
