What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
To access an OCI Object Storage bucket from Oracle Database using a resource principal, enable the principal for the database or target schema, then pass the resulting OCI$RESOURCE_PRINCIPAL credential to the appropriate DBMS_CLOUD operation. Use COPY_DATA to load file records into a table; use LIST_OBJECTS to enumerate objects. The steps below are documented for Autonomous Database. Other database services and releases may require version-specific checks.
Choose the operation for what you need to do
“Read bucket files” can mean loading their contents into database rows or simply checking which objects are in a bucket. These are separate tasks:
As an Amazon Associate I earn from qualifying purchases.
| Goal | Operation | Result |
|---|---|---|
| Load file data into a database table | DBMS_CLOUD.COPY_DATA |
Reads the specified file or files and loads records into a table. See Oracle’s COPY_DATA guidance. |
| Inspect objects in a bucket | DBMS_CLOUD.LIST_OBJECTS |
Returns object information for the specified location. See Oracle’s DBMS_CLOUD package documentation. |
Enable the resource principal
An administrator enables the resource principal with DBMS_CLOUD_ADMIN.ENABLE_RESOURCE_PRINCIPAL. With no username, Oracle documents enabling it for ADMIN; a schema username can be supplied to enable it for that schema. The operation creates the OCI$RESOURCE_PRINCIPAL credential used in subsequent DBMS_CLOUD calls. See Oracle’s resource-principal setup instructions.
For example, to enable the principal for a particular schema, use the documented procedure with that schema’s username:
#1 Best Overall
BEGIN
DBMS_CLOUD_ADMIN.ENABLE_RESOURCE_PRINCIPAL(
username => 'SCHEMA_NAME'
);
END;
/
Replace SCHEMA_NAME with the target schema. If the intended caller is ADMIN, follow Oracle’s instructions for the no-username form instead.
Confirm the OCI identity has bucket access
Enabling the credential in the database is not, by itself, proof that the identity can read every object in OCI. The database resource principal needs applicable OCI IAM permissions for the intended bucket and operation. The correct policy depends on the database service, compartment, bucket, and tenancy configuration, so do not assume that one policy statement fits every deployment.
Rank #2
Oracle documents resource-principal identities for database cloud services, including Autonomous Database and Base Database Service, and describes schema-specific principals as a way to scope access more narrowly. Verify the identity and policy scope for your own deployment in Oracle’s resource-principal identity documentation.
Recommended Free Tools
Build an HTTPS URI for the bucket object
The URI must identify the Object Storage namespace, bucket, and object, and Oracle’s Autonomous Database instructions require HTTPS. The endpoint form depends on the OCI realm. Oracle recommends the dedicated endpoint form for the commercial OC1 realm; for other realms it documents the standard Object Storage endpoint. See Oracle’s Autonomous Database URI formats.
| Realm | Documented URI pattern |
|---|---|
| Commercial realm OC1 | https://namespace-string.objectstorage.region.oci.customer-oci.com/n/namespace-string/b/bucketname/o/filename |
| Other realms | https://objectstorage.region.oraclecloud.com/n/namespace-string/b/bucket/o/filename |
Replace the namespace, region, bucket, and filename with values from your OCI environment. Use the URI for the actual object when loading a file. For listing, provide the appropriate bucket location URI and follow the target package signature.
Load a file into a table with COPY_DATA
Oracle’s documented resource-principal pattern passes OCI$RESOURCE_PRINCIPAL as the credential to DBMS_CLOUD.COPY_DATA. This illustrative PL/SQL block uses a CSV-style delimiter format:
Rank #4
BEGIN
DBMS_CLOUD.COPY_DATA(
table_name => 'CHANNELS',
credential_name => 'OCI$RESOURCE_PRINCIPAL',
file_uri_list => 'https://objectstorage.<region>.oraclecloud.com/n/<namespace>/b/<bucket>/o/<file>',
format => json_object('delimiter' value ',')
);
END;
/
Adapt the table name, URI, and format to your schema and file. The example’s delimiter setting is for a comma-separated format; it is not a universal parser configuration. Check Oracle’s COPY_DATA documentation for supported options and the requirements of the target database.
List bucket objects with LIST_OBJECTS
If you want object metadata rather than table rows, use DBMS_CLOUD.LIST_OBJECTS with the resource-principal credential and a bucket location URI. Conceptually, the call has this form:
Best Value
SELECT *
FROM DBMS_CLOUD.LIST_OBJECTS(
'OCI$RESOURCE_PRINCIPAL',
'https://objectstorage.<region>.oraclecloud.com/n/<namespace>/b/<bucket>/o/'
);
Confirm the exact function signature in the package documentation for your database service and release: DBMS_CLOUD subprograms.
Check service and release compatibility
The step-by-step setup and URI guidance here is based on Oracle’s Autonomous Database documentation. Oracle’s identity material also covers Base Database Service, but the available guidance does not establish that every database service or self-managed Oracle Database release uses identical setup steps, package signatures, or permissions. Before applying the examples elsewhere, check the target service’s documentation and installed DBMS_CLOUD package version.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




