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

The following 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

You can specify a SharePoint URI in the following 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.

  1. Create a SharePoint credential
    Create 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;
    /
  2. Generate the SharePoint URI
    Run DBMS_CLOUD.INIT_SHAREPOINT_URI to 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.

  3. List objects and review metadata

    Run DBMS_CLOUD.LIST_OBJECTS_EXTENDED to identify the files available in SharePoint and details of the SharePoint identifiers in the METADATA column.

    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 METADATA column with SharePoint specific JSON attributes such as tenantid, siteid, listid, and itemid.

    See DBMS_CLOUD.LIST_OBJECTS_EXTENDED for more information.

  4. Download a Single File
    After you identify the item you want, run DBMS_CLOUD.GET_OBJECT to download a single file from SharePoint. For GET_OBJECT, the SharePoint URI must include the itemid.
    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.

  5. Download an object into a directory
    Run GET_OBJECT and include directory_name in 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>.

  1. Create a download pipeline

    Create a DOWNLOAD pipeline 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.

  2. Set pipeline attributes
    Specify 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.

  3. 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.

  4. 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_FILES to 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.

When you specify the SharePoint URI, the system first builds a metadata table from the lists under the target site or subsite, then uses LIST_OBJECTS output to populate the status table, fetches object content with GET_OBJECT, and stores generated embeddings in the target vector table.
  1. Create an OCI credential for the AI profile
    Create 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;
    /
  2. Create the AI profile
    Create a DBMS_CLOUD_AI profile 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;
    /
  3. Create the vector index

    Create the vector index where you point the location attribute 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.