Oracle APEX on ATP: Real-World Integration with OCI Services
๐งญ Introduction
Oracle APEX on Autonomous Transaction Processing (ATP) is a powerful low-code platform that enables rapid application development, directly on Oracle Cloud. But its real strength is unlocked when integrated with other OCI services such as Object Storage, Functions, Monitoring, and Email Delivery.
In this blog, we’ll walk through real-world use cases and demonstrate how APEX applications can seamlessly connect, consume, and extend OCI services to build modern cloud-native solutions.
๐งฉ Why Integrate APEX with OCI Services?
Feature | Benefit |
---|---|
๐ง Native cloud access | Direct interaction with OCI APIs from APEX |
⚙️ Serverless compute | Extend APEX logic using Oracle Functions |
๐ฆ Object Storage | Store & retrieve documents, images, reports |
๐ Monitoring & Alerts | App-level observability & automation |
✉️ Email Delivery | Send user notifications or alerts |
๐ง Prerequisites
-
ATP instance with APEX enabled
-
Access to OCI tenancy with appropriate permissions
-
Authenticated access using OCI REST APIs
-
Auth via Resource Principal (preferred on ATP)
-
Or using API signing keys (if external access is needed)

๐งช Use Case 1: Upload & Access Files in OCI Object Storage
๐น Step 1: Create a Bucket in OCI
๐น Step 2: Use PL/SQL to Upload Files
Create a PL/SQL Web Source Module in APEX using OCI Object Storage REST API:
declare
l_blob BLOB := :P1_FILE;
l_resp CLOB;
begin
apex_web_service.g_request_headers(1).name := 'Authorization';
apex_web_service.g_request_headers(1).value := 'Bearer ' || get_auth_token();
l_resp := apex_web_service.make_rest_request(
p_url => 'https://objectstorage.<region>.oraclecloud.com/n/<namespace>/b/apex-bucket/o/myfile.jpg',
p_http_method => 'PUT',
p_body_blob => l_blob,
p_wallet_path => 'file:/wallet',
p_content_type => 'image/jpeg'
);
:P1_RESPONSE := l_resp;
end;
๐ Use Case 2: Triggering Oracle Functions from APEX
๐น Step 1: Deploy a Function
Use Fn Project or OCI Console:
๐น Step 2: Call Function via REST from APEX
Use APEX_WEB_SERVICE.MAKE_REST_REQUEST
:
✅ Example Use Cases:
-
Sending SMS/Email via function
-
Backend image processing
-
Serverless workflow triggers
๐ก Use Case 3: Monitoring APEX App Events via OCI Monitoring
๐น Step 1: Enable Custom Metrics in Your PL/SQL
Push custom metrics from APEX:
declare
l_response clob;
begin
l_response := apex_web_service.make_rest_request(
p_url => 'https://telemetry-ingestion.<region>.oraclecloud.com/20180401/metrics',
p_http_method => 'POST',
p_body => '{
"namespace": "apex_metrics",
"compartmentId": "<compartment_ocid>",
"name": "UserLogins",
"dimensions": {
"app": "HelpDesk"
},
"datapoints": [
{
"timestamp": "' || to_char(systimestamp, 'YYYY-MM-DD"T"HH24:MI:SS.FF3"Z"') || '",
"value": 1
}
]
}',
p_content_type => 'application/json'
);
end;
๐ Then build alarms in OCI Monitoring Dashboard for:
-
Login spikes
-
Failed transactions
-
Custom thresholds
๐ง Use Case 4: Send Emails via OCI Email Delivery
๐น Step 1: Set Up Email Delivery in OCI
-
Create approved sender email
-
Generate SMTP credentials
๐น Step 2: Use APEX_MAIL with SMTP
๐ Authentication: Resource Principals (ATP-Only)
If using ATP, you can use resource principal authentication with DBMS_CLOUD.SEND_REQUEST
.
BEGIN
DBMS_CLOUD.SEND_REQUEST(
credential_name => 'OCI_RESOURCE_PRINCIPAL',
uri => 'https://objectstorage.<region>.oraclecloud.com/n/...'
);
END;
✅ Recommended for secure, managed integration directly from ATP without API keys.
๐ก Bonus: Use Oracle AI Services
Combine APEX forms with:
-
OCI Vision (image classification)
-
OCI Speech (transcription)
-
OCI Language (text sentiment, NER)
Invoke via REST API using pre-authenticated headers from within PL/SQL.
๐ Summary
OCI Service | APEX Use Case |
---|---|
Object Storage | File upload/download |
Functions | Business logic extension |
Monitoring | Custom metrics & alerts |
Email Delivery | Notifications & password resets |
AI Services | Intelligent app features |
๐งญ Final Thoughts
Oracle APEX + ATP + OCI = a low-code cloud-native development powerhouse. With just PL/SQL and a few clicks, you can tap into enterprise-grade services and build modern, secure, and intelligent apps without needing to manage infrastructure or deploy code.
๐ Resources
Comments
Post a Comment