JavaScript must be enabled to correctly display this content
Export Data to a Directory Using DBMS_CLOUD.EXPORT_DATA
Use DBMS_CLOUD.EXPORT_DATA to export files to a
directory.
The directory to which you export files can be in the Autonomous Database file system or an attached external file system. See the following pages for more information:
Run DBMS_CLOUD.EXPORT_DATA and specify the format parameter type with the value json to export the results as CSV files to a directory. Do not include the credential parameter when sending output to a directory.
BEGIN
DBMS_CLOUD.EXPORT_DATA(
file_uri_list => 'export_dir:sales.csv',
format => JSON_OBJECT('type' value 'csv'),
query => 'SELECT * FROM sales'
);
END;
/
When record delimiters include escape characters, such as \r\n or \t, enclose the record delimiters in double quotes. For example, to use the record delimiter \r\n, enclose the value in double quotes:"\r\n".
BEGIN
DBMS_CLOUD.EXPORT_DATA(
file_uri_list => 'export_dir:sales.csv',
query => 'SELECT * FROM sales',
format => JSON_OBJECT('type' value 'json', 'recorddelimiter' value '"\r\n"' format json));
END;
/
The directory name is case-sensitive when the directory name is enclosed in double quotes. For example:
BEGIN
DBMS_CLOUD.EXPORT_DATA(
file_uri_list => '"export_dir":sales.csv',
format => JSON_OBJECT('type' value 'csv'),
query => 'SELECT * FROM sales'
);
END;
/
file_uri_list: is a comma delimited list of the export file(s). Use of wildcard and substitution characters is not supported in the file_uri_list.
format: specifies the required type parameter. The valid values are json, xml, and csv.
query: specifies a SELECT statement so that only the required data is exported. The query determines the contents of the dump file(s).
Note:
The DBMS_CLOUD.EXPORT_DATA procedure creates the dump file(s) that you specify in the file_uri_list. The procedure does not overwrite files. If a dump file in the file_uri_list exists, DBMS_CLOUD.EXPORT_DATA generates another file with a unique name. DBMS_CLOUD.EXPORT_DATA does not create directories.
Run DBMS_CLOUD.EXPORT_DATA and specify the format parameter type with the value json to export the results as JSON files to a directory. Do not include the credential parameter when sending output to a directory.
BEGIN
DBMS_CLOUD.EXPORT_DATA(
file_uri_list => 'export_dir:sales.dmp',
format => json_object('type' value 'json'),
query => 'SELECT * FROM sales'
);
END;
/
When record delimiters include escape characters, such as \r\n or \t, enclose the record delimiters in double quotes. For example, to use the record delimiter \r\n, enclose the value in double quotes:"\r\n".
BEGIN
DBMS_CLOUD.EXPORT_DATA(
file_uri_list => 'export_dir:sales.dmp',
query => 'SELECT * FROM sales',
format => JSON_OBJECT('type' value 'json', 'recorddelimiter' value '"\r\n"' format json));
END;
/
The directory name is case-sensitive when the directory name is enclosed in double quotes. For example:
BEGIN
DBMS_CLOUD.EXPORT_DATA(
file_uri_list => '"export_dir":sales.dmp',
format => json_object('type' value 'json'),
query => 'SELECT * FROM sales'
);
END;
/
file_uri_list: is a comma delimited list of the export file(s). Use of wildcard and substitution characters is not supported in the file_uri_list.
format: specifies the required type parameter. The valid values are json, xml, and csv.
query: specifies a SELECT statement so that only the required data is exported. The query determines the contents of the dump file(s).
Note:
The DBMS_CLOUD.EXPORT_DATA procedure creates the dump file(s) that you specify in the file_uri_list. The procedure does not overwrite files. If a dump file in the file_uri_list exists, DBMS_CLOUD.EXPORT_DATA generates another file with a unique name. DBMS_CLOUD.EXPORT_DATA does not create directories.
Run DBMS_CLOUD.EXPORT_DATA and specify the format parameter type with the value json to export the results as Parquet files to a directory. Do not include the credential parameter when sending output to a directory.
BEGIN
DBMS_CLOUD.EXPORT_DATA(
file_uri_list => 'export_dir:sales.parquet',
format => JSON_OBJECT('type' value 'parquet'),
query => 'SELECT * FROM sales'
);
END;
/
The directory name is case-sensitive when the directory name is enclosed in double quotes. For example:
BEGIN
DBMS_CLOUD.EXPORT_DATA(
file_uri_list => '"export_dir":sales.parquet',
format => JSON_OBJECT('type' value 'parquet'),
query => 'SELECT * FROM sales'
);
END;
/
file_uri_list: is a comma delimited list of the export file(s). Use of wildcard and substitution characters is not supported in the file_uri_list.
format: specifies the required type parameter. The valid values are datapump, json, xml, csv and parquet and it also optionally defines the options you can specify for the export with the ORACLE_DATAPUMP Access Driver.
query: specifies a SELECT statement so that only the required data is exported. The query determines the contents of the dump file(s).
Run DBMS_CLOUD.EXPORT_DATA and specify the format parameter type with the value json to export the results as XML files to a directory. Do not include the credential parameter when sending output to a directory.
BEGIN
DBMS_CLOUD.EXPORT_DATA(
file_uri_list => 'export_dir:sales.csv',
format => JSON_OBJECT('type' value 'csv'),
query => 'SELECT * FROM sales'
);
END;
/
The directory name is case-sensitive when the directory name is enclosed in double quotes. For example:
BEGIN
DBMS_CLOUD.EXPORT_DATA(
file_uri_list => '"export_dir":sales.xml',
format => JSON_OBJECT('type' value 'xml'),
query => 'SELECT * FROM sales'
);
END;
/
file_uri_list: is a comma delimited list of the export file(s). Use of wildcard and substitution characters is not supported in the file_uri_list.
format: specifies the required type parameter. The valid values are json, xml, and csv.
query: specifies a SELECT statement so that only the required data is exported. The query determines the contents of the dump file(s).
Note:
The DBMS_CLOUD.EXPORT_DATA procedure creates the dump file(s) that you specify in the file_uri_list. The procedure does not overwrite files. If a dump file in the file_uri_list exists, DBMS_CLOUD.EXPORT_DATA generates another file with a unique name. DBMS_CLOUD.EXPORT_DATA does not create directories.