重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1340|回复: 0
打印 上一主题 下一主题

[参考文档] 使用dbms_files_transfer来传输文件

[复制链接]
跳转到指定楼层
楼主
发表于 2021-9-26 18:03:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 刘泽宇 于 2021-9-26 18:07 编辑

[td]
Subprogram
Description
Reads a file from a source directory and creates a copy of it in a destination directory. The source and destination directories can both be in a local file system, or both be in an Automatic Storage Management (ASM) disk group, or between local file system and ASM with copying in either direction.
Contacts a remote database to read a remote file and then creates a copy of the file in the local file system or ASM
Reads a local file or ASM and contacts a remote database to create a copy of the file in the remote file system
DBMS_FILE_TRANSFER.COPY_FILE(
   source_directory_object       IN  VARCHAR2,
   source_file_name              IN  VARCHAR2,
   destination_directory_object  IN  VARCHAR2,
   destination_file_name         IN  VARCHAR2);
Parameters
Table 42-2 COPY_FILE Procedure Parameters
[td]
Parameter
Description
source_directory_object
The directory object that designates the source directory. The directory object must already exist. (You create directory objects with the CREATE DIRECTORY command).
source_file_name
The name of the file to copy. This file must exist in the source directory.
destination_directory_object
The directory object that designates the destination directory. The directory object must already exist. If the destination is ASM, the directory object must designate either a disk group name (for example, +diskgroup1) or a directory created for alias names. In the case of a directory, the full path to the directory must be specified (for example: +diskgroup1/dbs/control).
destination_file_name
The name to assign to the file in the destination directory. A file with the same name must not exist in the destination directory. If the destination is ASM:
  • The file is given a fully qualified ASM filename and created in the appropriate directory (depending on the database name and file type)
  • The file type tag assigned to the file is COPY_FILE
  • The value of the destination_file_name argument becomes the file's alias name in the designated destination directory

The file name can be followed by an ASM template name in parentheses. The file is then given the attributes specified by the template.
DBMS_FILE_TRANSFER.GET_FILE
   source_directory_object      IN  VARCHAR2,   
   source_file_name             IN  VARCHAR2,  
   source_database              IN  VARCHAR2,  
   destination_directory_object IN  VARCHAR2,
   destination_file_name        IN  VARCHAR2);
Parameters
Table 42-3 GET_FILE Procedure Parameters
[td]
Parameter
Description
source_directory_object
The directory object from which the file is copied at the source site. This directory object must exist at the source site.
source_file_name
The name of the file that is copied in the remote file system. This file must exist in the remote file system in the directory associated with the source directory object.
source_database
The name of a database link to the remote database where the file is located.
destination_directory_object
The directory object into which the file is placed at the destination site. This directory object must exist in the local file system.
destination_file_name
The name of the file copied to the local file system. A file with the same name must not exist in the destination directory in the local file system.
DBMS_FILE_TRANSFER.PUT_FILE(
   source_directory_object       IN  VARCHAR2,   
   source_file_name              IN  VARCHAR2,
   destination_directory_object  IN  VARCHAR2,
   destination_file_name         IN  VARCHAR2,  
   destination_database          IN  VARCHAR2);
Parameters
Table 42-4 PUT_FILE Procedure Parameters
[td]
Parameter
Description
source_directory_object
The directory object from which the file is copied at the local source site. This directory object must exist at the source site.
source_file_name
The name of the file that is copied from the local file system. This file must exist in the local file system in the directory associated with the source directory object.
destination_directory_object
The directory object into which the file is placed at the destination site. This directory object must exist in the remote file system.
destination_file_name
The name of the file placed in the remote file system. A file with the same name must not exist in the destination directory in the remote file system.
destination_database
The name of a database link to the remote database to which the file is copied.




分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-5-19 21:34 , Processed in 0.093108 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表