DBMS_CLOUD for Bulk File Management
The subprograms for bulk file operations within the DBMS_CLOUD package.
Subprogram | Description |
---|---|
BULK_COPY Procedure |
This procedure copies files from one Cloud Object Storage bucket to another. |
BULK_DELETE Procedure |
The procedure deletes files from Cloud Object Storage bucket or folder. |
BULK_DOWNLOAD Procedure |
This procedure downloads files from Cloud Object store bucket to a directory in Autonomous Database. |
BULK_MOVE Procedure |
This procedure moves files from one Cloud Object Storage bucket to another. |
BULK_UPLOAD Procedure |
This procedure uploads files from a directory in Autonomous Database to the Cloud Object Storage. |
- Prerequisites
- BULK_COPY Procedure
This procedure bulk copies files from one Cloud Object Storage bucket to another. The overloaded form enables you to use theoperation_id
parameter. - BULK_DELETE Procedure
This procedure bulk deletes files from the Cloud Object Storage. The overloaded form enables you to use theoperation_id
parameter. You can filter the list of files to be deleted using a regular expression pattern compatible withREGEXP_LIKE
operator. - BULK_DOWNLOAD Procedure
This procedure downloads files into an Autonomous Database directory from Cloud Object Storage. The overloaded form enables you to use theoperation_id
parameter. You can filter the list of files to be downloaded using a regular expression pattern compatible withREGEXP_LIKE
operator. - BULK_MOVE Procedure
This procedure bulk moves files from one Cloud Object Storage bucket or folder to another. The overloaded form enables you to use theoperation_id
parameter. - BULK_UPLOAD Procedure
This procedure copies files into Cloud Object Storage from an Autonomous Database directory. The overloaded form enables you to use theoperation_id
parameter.
Parent topic: DBMS_CLOUD Package Reference
Prerequisites
As a developer, you can use DBMS_CLOUD procedures with Autonomous Databases deployed on Oracle Public Cloud or Exadata Cloud@Customer.
Depending on the deployment choice, the following prerequisites must be met to use the DBMS_CLOUD procedures with Amazon S3, Azure Blob Storage, and Google Cloud Storage service providers.
- Create a NAT gateway in the Virtual Cloud Network (VCN) where your Autonomous Database resources reside by following the instructions in Create a NAT Gateway in Oracle Cloud Infrastructure Documentation.
- After creating the NAT gateway, add a route rule and an egress security rule to each subnet (in the VCN) where Autonomous Database resources reside so that these resources can use the gateway to obtain a public key from your Azure AD instance:
- Go to the Subnet Details page for the subnet.
- In the Subnet Information tab, click the name of the subnet's Route Table to display its Route Table Details page.
- In the table of existing Route Rules, check whether there is already a rule with the following characteristics:
- Destination: 0.0.0.0/0
- Target Type: NAT Gateway
- Target: The name of the NAT gateway you just created in the VCN
If such a rule does not exist, click Add Route Rules and add a route rule with these characteristics.
- Return to the Subnet Details page for the subnet.
- In the subnet's Security Lists table, click the name of the subnet's security list to display its Security List Details page.
- In the side menu, under Resources, click Egress Rules.
- In the table of existing Egress Rules, check whether there is already a rule with the following characteristics:
- Destination Type: CIDR
- Destination: 0.0.0.0/0
- IP Protocol: TCP
- Source Port Range: 443
- Destination Port Range: All
If such a rule does not exist, click Add Egress Rules and add an egress rule with these characteristics.
The HTTP Proxy settings in your environment must allow the database to access the cloud service provider.
The network configuration including the HTTP Proxy can only be edited until the Exadata Infrastructure is in Requires Activation state. Once it is activated, you cannot edit those settings.
Setting up an HTTP Proxy for an already provisioned Exadata Infrastructure needs a Service Request (SR) in My Oracle Support. See Create a Service Request in My Oracle Support for details.
Parent topic: DBMS_CLOUD for Bulk File Management
BULK_COPY Procedure
This
procedure bulk copies files from one Cloud Object Storage bucket to another. The overloaded
form enables you to use the operation_id
parameter.
You can filter the list of files to be deleted using a regular expression pattern compatible with REGEXP_LIKE
operator.
The source and target bucket or folder can be in the same or different Cloud Object store provider.
When the source and target are in distinct Object Stores or have different accounts with the same cloud provider, you can give separate credential names for the source and target locations.
The source credential name is by default also used by the target location.
Syntax
DBMS_CLOUD.BULK_COPY
(
source_credential_name IN VARCHAR2 DEFAULT NULL,
source_location_uri IN VARCHAR2,
target_location_uri IN VARCHAR2,
target_credential_name IN VARCHAR2 DEFAULT NULL,
regex_filter IN VARCHAR2 DEFAULT NULL,
format IN CLOB DEFAULT NULL
);
DBMS_CLOUD.BULK_COPY
(
source_credential_name IN VARCHAR2 DEFAULT NULL,
source_location_uri IN VARCHAR2,
target_location_uri IN VARCHAR2,
target_credential_name IN VARCHAR2 DEFAULT NULL,
regex_filter IN VARCHAR2 DEFAULT NULL,
format IN CLOB DEFAULT NULL,
operation_id OUT NUMBER
);
Parameters
Parameter | Description |
---|---|
|
The name of the credential to access the Cloud Object Storage. If you do not supply a |
|
Specifies URI, that point to the source Object Storage bucket or folder location. This parameter is mandatory. The format of the URIs depends on the Cloud Object Storage service. See DBMS_CLOUD Package File Cloud Object Storage URI Formats for more information. |
|
Specifies the URI for the target Object Storage bucket or folder, where the files need to be copied. This parameter is mandatory. The format of the URIs depends on the Cloud Object Storage service. See DBMS_CLOUD Package File Cloud Object Storage URI Formats for more information. |
|
The name of the credential to access the target Cloud Object Storage location. If you do not supply a |
|
Specifies the REGEX expression to filter files. The REGEX expression pattern must be compatible with the If you do not supply a See REGEXP_LIKE Condition for more information. |
|
Specifies the additional configuration options for the file operation. These options are specified as a JSON string. The supported format options are:
If you do not supply a |
|
Use this parameter to track the progress and final
status of the load operation as the corresponding ID in the
|
Usage Notes
-
An error is returned when the source and target URI point to the same Object Storage bucket or folder.
Example
BEGIN
DBMS_CLOUD.BULK_COPY
(
source_credential_name => 'OCI_CRED',
source_location_uri => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname1/o',
target_location_uri => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname2/o',
format => JSON_OBJECT ('logretention' value 7, 'logprefix' value 'BULKOP')
);
END;
/
Parent topic: DBMS_CLOUD for Bulk File Management
BULK_DELETE Procedure
This
procedure bulk deletes files from the Cloud Object Storage. The overloaded form enables you
to use the operation_id
parameter. You can filter the list of files to be
deleted using a regular expression pattern compatible with REGEXP_LIKE
operator.
Syntax
DBMS_CLOUD.BULK_DELETE
(
credential_name IN VARCHAR2 DEFAULT NULL,
location_uri IN VARCHAR2,
regex_filter IN VARCHAR2 DEFAULT NULL,
format IN CLOB DEFAULT NULL
);
DBMS_CLOUD.BULK_DELETE
(
credential_name IN VARCHAR2 DEFAULT NULL,
location_uri IN VARCHAR2,
regex_filter IN VARCHAR2 DEFAULT NULL,
format IN CLOB DEFAULT NULL,
operation_id OUT NUMBER
);
Parameters
Parameter | Description |
---|---|
|
The name of the credential to access the Cloud Object Storage. If you do not supply a |
|
Specifies URI, that point to an Object Storage location in the Autonomous Database. This parameter is mandatory. The format of the URIs depends on the Cloud Object Storage service. See DBMS_CLOUD Package File Cloud Object Storage URI Formats for more information. |
|
Specifies the REGEX expression to filter files. The REGEX expression pattern must be compatible with the If you do not supply a See REGEXP_LIKE Condition for more information. |
|
Specifies the additional configuration options for the file operation. These options are specified as a JSON string. The supported format options are:
If you do not supply a |
|
Use this parameter to track the progress and final
status of the load operation as the corresponding ID in the
|
Example
BEGIN
DBMS_CLOUD.BULK_DELETE
(
credential_name => 'OCI_CRED',
location_uri => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname/o',
format => JSON_OBJECT ('logretention' value 5, 'logprefix' value 'BULKDEL')
);
END;
/
Parent topic: DBMS_CLOUD for Bulk File Management
BULK_DOWNLOAD Procedure
This
procedure downloads files into an Autonomous Database directory from Cloud Object Storage.
The overloaded form enables you to use the operation_id
parameter. You can
filter the list of files to be downloaded using a regular expression pattern compatible with
REGEXP_LIKE
operator.
Syntax
DBMS_CLOUD.BULK_DOWNLOAD
(
credential_name IN VARCHAR2 DEFAULT NULL,
location_uri IN VARCHAR2,
directory_name IN VARCHAR2,
regex_filter IN VARCHAR2 DEFAULT NULL,
format IN CLOB DEFAULT NULL
);
DBMS_CLOUD.BULK_DOWNLOAD
(
credential_name IN VARCHAR2 DEFAULT NULL,
location_uri IN VARCHAR2,
directory_name IN VARCHAR2,
regex_filter IN VARCHAR2 DEFAULT NULL,
format IN CLOB DEFAULT NULL,
operation_id OUT NUMBER
);
Parameters
Parameter | Description |
---|---|
|
The name of the credential to access the Cloud Object Storage. If you do not supply a |
|
Specifies URI, that point to an Object Storage location in the Autonomous Database. This parameter is mandatory. The format of the URIs depends on the Cloud Object Storage service. See DBMS_CLOUD Package File Cloud Object Storage URI Formats for more information. |
|
The name of the directory on the Autonomous Database from where you want to download the files. This parameter is mandatory. |
|
Specifies the REGEX expression to filter files. The REGEX expression pattern must be compatible with the If you do not supply a See REGEXP_LIKE Condition for more information. |
|
Specifies the additional configuration options for the file operation. These options are specified as a JSON string. The supported format options are:
If you do not supply a |
|
Use this parameter to track the progress and final
status of the load operation as the corresponding ID in the
|
Example
BEGIN
DBMS_CLOUD.BULK_DOWNLOAD
(
credential_name => 'OCI_CRED',
location_uri => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname/o',
directory_name => 'BULK_TEST',
format => JSON_OBJECT ('logretention' value 7, 'logprefix' value 'BULKOP')
);
END;
/
Parent topic: DBMS_CLOUD for Bulk File Management
BULK_MOVE Procedure
This
procedure bulk moves files from one Cloud Object Storage bucket or folder to another. The
overloaded form enables you to use the operation_id
parameter.
You can filter the list of files to be deleted using a regular expression pattern compatible with REGEXP_LIKE
operator.
The source and target bucket or folder can be in the same or different Cloud Object store provider.
When the source and target are in distinct Object Stores or have different accounts with the same cloud provider, you can give separate credential names for the source and target locations.
The source credential name is by default also used by the target location when target credential name is not provided.
The first step in moving files is copying them to the target location, then deleting the source files, once they are successfully copied.
The object is renamed rather than moved if Object Store allows renaming operations between source and target locations.
Syntax
DBMS_CLOUD.BULK_MOVE
(
source_credential_name IN VARCHAR2 DEFAULT NULL,
source_location_uri IN VARCHAR2,
target_location_uri IN VARCHAR2,
target_credential_name IN VARCHAR2 DEFAULT NULL,
regex_filter IN VARCHAR2 DEFAULT NULL,
format IN CLOB DEFAULT NULL
);
DBMS_CLOUD.BULK_MOVE
(
source_credential_name IN VARCHAR2 DEFAULT NULL,
source_location_uri IN VARCHAR2,
target_location_uri IN VARCHAR2,
target_credential_name IN VARCHAR2 DEFAULT NULL,
regex_filter IN VARCHAR2 DEFAULT NULL,
format IN CLOB DEFAULT NULL,
operation_id OUT NUMBER
);
Parameters
Parameter | Description |
---|---|
|
The name of the credential to access the source Cloud Object Storage. If you do not supply a |
|
Specifies URI, that point to the source Object Storage bucket or folder location. This parameter is mandatory. The format of the URIs depends on the Cloud Object Storage service. See DBMS_CLOUD Package File Cloud Object Storage URI Formats for more information. |
|
Specifies the URI for the target Object Storage bucket or folder, where the files need to be moved. This parameter is mandatory. The format of the URIs depends on the Cloud Object Storage service. See DBMS_CLOUD Package File Cloud Object Storage URI Formats for more information. |
|
The name of the credential to access the target Cloud Object Storage location. If you do not supply a |
|
Specifies the REGEX expression to filter files. The REGEX expression pattern must be compatible with the If you do not supply a See REGEXP_LIKE Condition for more information. |
|
Specifies the additional configuration options for the file operation. These options are specified as a JSON string. The supported format options are:
If you do not supply a |
|
Use this parameter to track the progress and final
status of the load operation as the corresponding ID in the
|
Example
BEGIN
DBMS_CLOUD.BULK_MOVE
(
source_credential_name => 'OCI_CRED',
source_location_uri => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname1/o',
target_location_uri => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname2/o',
format => JSON_OBJECT ('logretention' value 7, 'logprefix' value 'BULKMOVE')
);
END;
/
An error is returned when the source and target URI point to the same Object Storage bucket or folder.
Parent topic: DBMS_CLOUD for Bulk File Management
BULK_UPLOAD Procedure
This
procedure copies files into Cloud Object Storage from an Autonomous Database directory. The
overloaded form enables you to use the operation_id
parameter.
Syntax
DBMS_CLOUD.BULK_UPLOAD
(
credential_name IN VARCHAR2 DEFAULT NULL,
location_uri IN VARCHAR2,
directory_name IN VARCHAR2,
regex_filter IN VARCHAR2 DEFAULT NULL,
format IN CLOB DEFAULT NULL
);
DBMS_CLOUD.BULK_UPLOAD
(
credential_name IN VARCHAR2 DEFAULT NULL,
location_uri IN VARCHAR2,
directory_name IN VARCHAR2,
regex_filter IN VARCHAR2 DEFAULT NULL,
format IN CLOB DEFAULT NULL,
operation_id OUT NUMBER
);
Parameters
Parameter | Description |
---|---|
|
The name of the credential to access the Cloud Object Storage. If you do not supply a |
|
Specifies URI, that points to an Object Storage location to upload files. This parameter is mandatory. The format of the URIs depends on the Cloud Object Storage service. See DBMS_CLOUD Package File Cloud Object Storage URI Formats for more information. |
|
The name of the directory on the Autonomous Database from where you upload files. This parameter is mandatory. |
regex_filter |
Specifies the REGEX expression to filter files. The REGEX expression pattern must be compatible with If you do not supply a See REGEXP_LIKE Condition for more information. |
|
Specifies the additional configuration options for the file operation. These options are specified as a JSON string. The supported format options are:
If you do not supply a |
|
Use this parameter to track the progress and final
status of the load operation as the corresponding ID in the
|
Example
BEGIN
DBMS_CLOUD.BULK_UPLOAD
(
credential_name => 'OCI_CRED',
location_uri => 'https://objectstorage.us-phoenix-1.oraclecloud.com/n/namespace-string/b/bucketname/o',
directory_name => 'BULK_TEST',
format => JSON_OBJECT ('logretention' value 5, 'logprefix' value 'BULKUPLOAD')
);
END;
/
Parent topic: DBMS_CLOUD for Bulk File Management