使用DBMS_FILE_TRANSFER包拷贝文件
来源:互联网 发布:农村淘宝服务站收费吗 编辑:程序博客网 时间:2024/05/04 16:00
This section includes an example that uses the COPY_FILE
procedure in theDBMS_FILE_TRANSFER
package to copy a file on a local file system. The following example copies a binary file nameddb1.dat
from the /usr/admin/source
directory to the /usr/admin/destination
directory as db1_copy.dat
on a local file system:
In SQL*Plus, connect as an administrative user who can grant privileges and create directory objects using SQL.(如sys用户)
Use the SQL command
CREATE DIRECTORY SOURCE_DIR AS '/usr/admin/source';CREATE DIRECTORY
to create a directory object for the directory from which you want to copy the file. A directory object is similar to an alias for the directory. For example, to create a directory object calledSOURCE_DIR
for the/usr/admin/source
directory on your computer system, execute the following statement:Use the SQL command
CREATE DIRECTORY DEST_DIR AS '/usr/admin/destination';CREATE
DIRECTORY
to create a directory object for the directory into which you want to copy the binary file. For example, to create a directory object calledDEST_DIR
for the/usr/admin/destination
directory on your computer system, execute the following statement:Grant the required privileges to the user who will run the
GRANT EXECUTE ON DBMS_FILE_TRANSFER TO strmadmin;GRANT READ ON DIRECTORY source_dir TO strmadmin;GRANT WRITE ON DIRECTORY dest_dir TO strmadmin;COPY_FILE
procedure. In this example, thestrmadmin
user runs the procedure.Connect as
CONNECT strmadmin/strmadminpwstrmadmin
user:Run the
BEGIN DBMS_FILE_TRANSFER.COPY_FILE( source_directory_object => 'SOURCE_DIR', source_file_name => 'db1.dat', destination_directory_object => 'DEST_DIR', destination_file_name => 'db1_copy.dat');END;/COPY_FILE
procedure to copy the file:
Caution:
Do not use the DBMS_FILE_TRANSFER package to copy or transfer a file that is being modified by a database because doing so may result in an inconsistent file.- 使用DBMS_FILE_TRANSFER包拷贝文件
- 使用 dbms_file_transfer 包在asm 和文件系统间拷贝文件
- 使用Oracle包DBMS_FILE_TRANSFER进行copy文件
- DBMS_FILE_TRANSFER文件拷贝命令介绍
- dbms_file_transfer使用简介
- 使用递归拷贝文件
- 使用SCP拷贝文件
- 使用ant拷贝文件
- 使用buffer拷贝文件
- 使用DBMS_FILE_TRANSFER迁移ASM中的表空间和数据文件
- 使用dbms_file_transfer传输ASM file出现ORA-15001
- 使用 dbms_file_transfer 方式测试增量传输表空间XTTS
- 使用IO完成文件拷贝
- 理解dbms_file_transfer
- 运行xml文件进行项目打包,拷贝jar包
- 将Jar包中的文件拷贝到本地文件
- 文件快速拷贝工具FastCopy 使用教程
- 使用mmap实现文件的拷贝
- Opencart_1.5.5.1简体中文语言包
- 图形布局-Layout 之js设计实现
- 电脑象棋开发-vc界面图形绘制
- 僵尸进程与孤儿进程
- OpenCart后台新闻显示
- 使用DBMS_FILE_TRANSFER包拷贝文件
- Linux下面如何的proc文件--------编写Linux资源管理器
- ※设计模式※→☆结构型模式☆============Bridge模式(七)
- Image 控件显示二进制图片
- 解决faplayer在android4.1上只有图像没有声音的问题
- Flex对象的疑惑的解决
- 表闪回操作及解决闪回表时出现的ORA-08189故障
- 简单工厂模式、工厂方法模式和抽象工厂模式的区别
- 安装Facebook Like 【赞】按钮在自己的网站页面上