ATTACH_FILE_SYSTEM Procedure
This procedure attaches a file system in the database.
The DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM
procedure attaches a file system in your database and stores information about the file
system in the DBA_CLOUD_FILE_SYSTEMS
view.
Syntax
DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM
(
file_system_name IN VARCHAR2,
file_system_location IN VARCHAR2,
directory_name IN VARCHAR2,
description IN VARCHAR2 DEFAULT NULL,
params IN CLOB DEFAULT NULL
);
Parameters
Parameter | Description |
---|---|
|
Specifies the name of the file system. This parameter is mandatory. |
|
Specifies the location of the file system. The value you supply with For example:
This parameter is mandatory. |
|
Specifies the directory name for the attached file system. The directory must exist. This parameter is mandatory. |
|
(Optional) Provides a description of the task. |
|
A JSON string that provides an additional parameter for the file system.
|
Examples:
Attach to an NFSv3 file system:
BEGIN
DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM
(
file_system_name => 'FSS',
file_system_location => 'myhost.sub000445.myvcn.oraclevcn.com:/results',
directory_name => 'FSS_DIR',
description => 'Source NFS for sales data'
);
END;
/
Attach to an NFSv4 file system:
BEGIN
DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM
(
file_system_name => 'FSS',
file_system_location => 'myhost.sub000445.myvcn.oraclevcn.com:/results',
directory_name => 'FSS_DIR',
description => 'Source NFS for sales data',
params => JSON_OBJECT('nfs_version' value 4)
);
END;
/
Usage Notes
-
To run this procedure you must be logged in as the ADMIN user or have the
EXECUTE
privilege onDBMS_CLOUD_ADMIN
. -
You must have
WRITE
privilege on the directory object in the database to attach a file system usingDBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM
. -
The
DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM
procedure can only attach a private File Storage Service in databases with Private Endpoints enabled.See OCI File Storage Service and Configure a Development System to Access the Database for more information.
-
The
DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM
procedure looks up the Network File System hostname on the customer's virtual cloud network (VCN). The error"ORA-20000: Mounting NFS fails"
is returned if the hostname specified in the location cannot be located. -
Oracle Cloud Infrastructure File Storage uses NFSv3 to share
-
If you attach to non-Oracle Cloud Infrastructure File Storage systems, the procedure supports NFSv3 and NFSv4
-
If you have an attached NFS server that uses NFSv3 and the NFS version is updated to NFSv4 in the NFS server, you must run
DBMS_CLOUD_ADMIN.DETACH_FILE_SYSTEM
and thenDBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM
(using theparams
parameter withnfs_version
set to 4). This attaches NFS with the matching protocol so that Autonomous Database can access the NFSv4 Server. Without detaching and then reattaching, the NFS server will be inaccessible and you may see an error such as:"Protocol not supported"
.
Parent topic: Summary of DBMS_CLOUD_ADMIN Subprograms