SharePoint Support in Autonomous AI Database using DBMS_CLOUD
With SharePoint support, you can access files stored in Microsoft SharePoint using DBMS_CLOUD and DBMS_CLOUD_PIPELINE packages with provider-specific URIs and credential objects.
If you store files in SharePoint, you can use DBMS_CLOUD Package to list and retrieve data in a way that is consistent with existing cloud object store integrations.
The SharePoint support enables listing, downloading, and downstream processing of external content in the Autonomous AI Database.
With DOWNLOAD pipeline type in DBMS_CLOUD_PIPELINE package, Autonomous AI Database can retrieve external files for further analysis and indexing.
Before you Begin
Before using SharePoint with DBMS_CLOUD, you must make sure that you have the client credentials required to create a database credential object. You can create a credential with the client ID and client secret of either the SharePoint user or an Azure application that has access to the SharePoint content.
Supported Packages
DBMS_CLOUD operations support SharePoint URIs:
- GET_OBJECT
- LIST_OBJECTS
- LIST_OBJECTS_EXTENDED
- DBMS_CLOUD_AI.CREATE_VECTOR_INDEX
Note:
SharePoint is supported only with the DOWNLOAD pipeline type in the DBMS_CLOUD_PIPELINE procedure.
SharePoint URI Format
SharePoint://tenant_id=<tenant_id>/site_id=<site_id>/sites/<subsite_id>/list_id=<list_id>/<item_id>You can generate a valid SharePoint URI, using DBMS_CLOUD.INIT_SHAREPOINT_URI.
Topics:
- Example: Retrieve and List Files from SharePoint
Run the following steps to access files stored in SharePoint to load data into Autonomous AI Database for analysis. - Example: Download SharePoint Content with a Pipeline
You can use a pipeline when you want the Autonomous AI Database to discover content and download it in a workflow. - Example: Create a Vector Index from SharePoint Files
You can create vector indexes directly from SharePoint usingDBMS_CLOUD_AI.CREATE_VECTOR_INDEX.
Parent topic: Develop
Example: Retrieve and List Files from SharePoint
Run the following steps to access files stored in SharePoint to load data into Autonomous AI Database for analysis.
- Create a SharePoint credentialCreate a credential with the SharePoint client ID and client secret and specify a credential name.
BEGIN DBMS_CLOUD.CREATE_CREDENTIAL( credential_name => 'SHAREPOINT_CRED', username => '<client-id>', password => '<client-secret>' ); END; / - Generate the SharePoint URIRun
DBMS_CLOUD.INIT_SHAREPOINT_URIto generate the SharePoint URI for the SharePoint site, subsite, list, or item that you want to access.DECLARE l_location_uri varchar2(4000); BEGIN l_location_uri := DBMS_CLOUD.INIT_SHAREPOINT_URI( tenant_id => 'Tenant ID', site_id => 'Site ID', sub_site_id => 'Sub Site ID', list_id => 'List ID', item_id => 'Item ID' ); END; /This procedure returns the correct URI format for the SharePoint location you want to access.
- List objects and review metadata
Run
DBMS_CLOUD.LIST_OBJECTS_EXTENDEDto identify the files available in SharePoint and details of the SharePoint identifiers in theMETADATAcolumn.SELECT * FROM DBMS_CLOUD.LIST_OBJECTS_EXTENDED( location_uri => DBMS_CLOUD.INIT_SHAREPOINT_URI( tenant_id => 'Tenant ID', site_id => 'Site ID', sub_site_id => 'Sub Site ID', list_id => 'List ID', item_id => 'Item ID'), credential_name => 'SHAREPOINT_CRED');The output includes a
METADATAcolumn with SharePoint specific JSON attributes such astenantid,siteid,listid, anditemid.See DBMS_CLOUD.LIST_OBJECTS_EXTENDED for more information.
- Download a Single FileAfter you identify the item you want, run
DBMS_CLOUD.GET_OBJECTto download a single file from SharePoint. ForGET_OBJECT, the SharePoint URI must include theitemid.DBMS_CLOUD.GET_OBJECT( object_uri => DBMS_CLOUD.INIT_SHAREPOINT_URI( tenant_id => 'Tenant ID', site_id => 'Site ID', sub_site_id => 'Sub Site ID', list_id => 'List ID', item_id => 'Item ID'), credential_name => 'SHAREPOINT_CRED');Run the above statement when you want the object returned directly rather than written to a database directory.
- Download an object into a directoryRun
GET_OBJECTand includedirectory_namein the procedure.DBMS_CLOUD.GET_OBJECT( object_uri => DBMS_CLOUD.INIT_SHAREPOINT_URI( tenant_id => 'Tenant ID', site_id => 'Site ID', sub_site_id => 'Sub Site ID', list_id => 'List ID', item_id => 'Item ID'), credential_name => 'SHAREPOINT_CRED', directory_name => 'STAGING');Since you specify the directory name, files are downloaded to that database directory.
See DBMS_CLOUD.GET_OBJECT for more information.
Example: Download SharePoint Content with a Pipeline
You can use a pipeline when you want the Autonomous AI Database to discover content and download it in a workflow.
The system creates Pipelines at the SharePoint site level, not at the individual list or library level. Oracle recommends using one pipeline per site.
If a site has a subsite, create a separate pipeline by specifying the combined site and subsite identifier in the form <site_id>/sites/<sub-site_id>.
- Create a download pipeline
Create a
DOWNLOADpipeline to load data from SharePoint.BEGIN DBMS_CLOUD_PIPELINE.CREATE_PIPELINE( pipeline_name => 'MY_PIPE2', pipeline_type => 'DOWNLOAD', description => 'Downloads data from SharePoint to Autonomous Database' ); END; /This pipeline type is the only pipeline type supported for SharePoint.
- Set pipeline attributesSpecify the credential, SharePoint location, priority, and interval values for the pipeline.
BEGIN DBMS_CLOUD_PIPELINE.SET_ATTRIBUTE( pipeline_name => 'MY_PIPE2', attributes => JSON_OBJECT( 'credential_name' VALUE 'SHAREPOINT_CRED', 'location' VALUE DBMS_CLOUD.INIT_SHAREPOINT_URI( tenant_id => 'Tenant ID', site_id => 'Site ID'), 'priority' VALUE 'HIGH', 'interval' VALUE '5') ); END; /If you also specify the
directory_name, the pipeline downloads files into that directory instead of storing file data in the pipeline status table.See DBMS_CLOUD_PIPELINE Attributes for more information.
-
Start the pipeline
After you have set the attributes, you can start the pipeline:EXEC DBMS_CLOUD_PIPELINE.START_PIPELINE('MY_PIPE2');When the pipeline starts, it validates the URI and gathers lists items from the target site or subsite. The pipeline downloads data to the specified directory. If you do not specify a directory, the pipeline stores it in the data column of the pipeline status table.
- Review pipeline results
Review the pipeline status table to confirm that objects were processed successfully and to inspect status, timestamps, and downloaded content details. If the pipeline writes files to a directory, run
DBMS_CLOUD.LIST_FILESto verify the downloaded files.
Example: Create a Vector Index from SharePoint Files
You can create vector indexes directly from SharePoint using DBMS_CLOUD_AI.CREATE_VECTOR_INDEX.
LIST_OBJECTS output to populate the status table, fetches object content with GET_OBJECT, and stores generated embeddings in the target vector table.
- Create an OCI credential for the AI profileCreate an OCI credential that the AI profile uses.
BEGIN DBMS_CLOUD.CREATE_CREDENTIAL( credential_name => 'OCI_CRED', user_ocid => 'USER_OCID', tenancy_ocid => 'TENANCY_OCID', private_key => '<private_key>', fingerprint => '<fingerprint>' ); END; / - Create the AI profileCreate a
DBMS_CLOUD_AIprofile to work with the newly created credential for the embedding model.BEGIN DBMS_CLOUD_AI.CREATE_PROFILE( profile_name => 'GENAI', attributes => '{"provider":"oci","credential_name":"OCI_CRED","oci_compartment_id":"ocid1.compartment.oc1...","model":"meta.llama-3.1-405b-instruct"}' ); END; / - Create the vector index
Create the vector index where you point the
locationattribute to the SharePoint URI.BEGIN DBMS_CLOUD_AI.CREATE_VECTOR_INDEX( index_name => 'SUPPORT', attributes => '{ "vector_db_provider": "oracle", "location": "SharePoint://tenant_id=<tenant_id>/site_id=<site_id>/", "object_storage_credential_name": "SHAREPOINT_CRED", "profile_name": "GENAI", "vector_table_name": "test_SharePoint_table", "vector_distance_metric": "cosine", "vector_dimension": 1024, "chunk_overlap": 128, "chunk_size": 1024 }' ); END; /This way Autonomous AI Database transforms files stored in SharePoint into vector embeddings for semantic search scenarios.