1 PACKAGE dbms_file_transfer AUTHID CURRENT_USER AS
2
3 invalid_parameter EXCEPTION;
4 PRAGMA exception_init(invalid_parameter, -31600);
5 invalid_parameter_num NUMBER := -31600;
6
7 package_flag BINARY_INTEGER;
8
9 PROCEDURE get_file(source_directory_object IN VARCHAR2,
10 source_file_name IN VARCHAR2,
11 source_database IN VARCHAR2,
12 destination_directory_object IN VARCHAR2,
13 destination_file_name IN VARCHAR2);
14 -- The procedure get_file contacts a remote database to read a remote
15 -- file and then creates a copy in the local file system. The parameter
16 -- source_database is a database link to the remote database. The source
17 -- file must exist at the source database with the name given by
18 -- source_file_name in the directory associated with source directory object.
19 -- The new copy has a name given by destination_file_name in the directory
20 -- associated with destination directory object. The destination file
21 -- must not already exist at the local database. If the destination file
22 -- already exists, get_file raises an exception. The destination file is
23 -- not closed until the operation completes successfully. The current user
24 -- needs write privileges at the local database on the
25 -- destination directory object. The connected user at the source database,
26 -- which depends on the database link details, needs read privileges at the
27 -- source database on the directory object. All parameters to
28 -- get_file must be non-NULL.
29 -- Directory objects are automatically converted to upper case unless
30 -- protected by double quotes. File names are not converted to upper case.
31 -- The file size must be a multiple of 512 bytes and must be no more than
32 -- 2 TB. Transferring the file is not transactional. The file is
33 -- treated as a binary file and no character set conversion is done. For
34 -- long transfers, progress is displayed in the v$session_longops view.
35
36 PROCEDURE put_file(source_directory_object IN VARCHAR2,
37 source_file_name IN VARCHAR2,
38 destination_directory_object IN VARCHAR2,
39 destination_file_name IN VARCHAR2,
40 destination_database IN VARCHAR2);
41 -- The procedure put_file reads a local file and contacts a remote
42 -- database to create a copy in a remote file system. The parameter
43 -- destination_database is a database link to the remote database. The
44 -- local file must exist with the name given by source_file_name in the
45 -- directory associated with source directory object. The new copy has a
46 -- name given by destination_file_name in the directory associated with
47 -- destination_file_object. The destination file must not already exist
48 -- at the destination database. If the destination file already exists,
49 -- put_file raises an exception. The destination file is not closed until the
50 -- operation completes successfully. The current user needs read privileges
51 -- at the local database on the source directory object. The connected user
52 -- at the destination database, which depends on the database link details,
53 -- needs write privileges at the destination database on the
54 -- destination directory object. All parameters to put_file must be non-NULL.
55 -- Directory objects are automatically converted to upper case unless
56 -- protected by double quotes. File names are not converted to upper case.
57 -- The file size must be a multiple of 512 bytes and must be no more than 2
58 -- TB. Transferring the file is not transactional. The file is treated
59 -- as a binary file and no character set conversion is done. For long
60 -- transfers, progress is displayed in the v$session_longops view.
61
62 PROCEDURE copy_file(source_directory_object IN VARCHAR2,
63 source_file_name IN VARCHAR2,
64 destination_directory_object IN VARCHAR2,
65 destination_file_name IN VARCHAR2);
66 -- The procedure copy_file reads a local file and creates a copy in the
67 -- local file system. The source file must exist with the name given by
68 -- source_file_name in the directory associated with source directory object.
69 -- The new copy has a name given by destination_file_name in the directory
70 -- associated with destination directory object. The destination file must
71 -- not already exist. If the destination file already exists, copy_file
72 -- raises an exception. The destination file is not closed until the
73 -- operation completes successfully. The current user needs read privileges
74 -- on the source directory object. The current user needs write privileges on
75 -- the destination directory object. All parameters to copy_file must be
76 -- non-NULL. Directory objects are automatically converted to upper case
77 -- unless protected by double quotes. File names are not converted to upper
78 -- case. The file size must be a multiple of 512 bytes and must be
79 -- no more than 2 TB. Copying the file is not transactional. The file
80 -- is treated as a binary file and no character set conversion is done.
81 -- For long copy operations, progress is displayed in the
82 -- v$session_longops view.
83
84 END dbms_file_transfer;