非常好用,只要记得建目录授权就行了,我贴一段:SQL> CREATE DIRECTORY log_dir AS '/appl/gl/log'; SQL> GRANT READ ON DIRECTORY log_dir TO DBA; SQL> CREATE DIRECTORY out_dir AS '/appl/gl/user''; SQL> GRANT READ ON DIRECTORY user_dir TO PUBLIC; --删除的方法及参数介绍 FREMOVE Procedure This procedure deletes a disk file, assuming that you have sufficient privileges.SyntaxUTL_FILE.FREMOVE ( location IN VARCHAR2, filename IN VARCHAR2); --复制的介绍 FCOPY Procedure This procedure copies a contiguous portion of a file to a newly created file. By default, the whole file is copied if the start_line and end_line parameters are omitted. The source file is opened in read mode. The destination file is opened in write mode. A starting and ending line number can optionally be specified to select a portion from the center of the source file for copying.SyntaxUTL_FILE.FCOPY ( location IN VARCHAR2, filename IN VARCHAR2, dest_dir IN VARCHAR2, dest_file IN VARCHAR2, start_line IN PLS_INTEGER DEFAULT 1, end_line IN PLS_INTEGER DEFAULT NULL);官方文档及例子如下: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#BABDEJDH
host move
host copy等unix里可以使用!也可以使用host
create directory ORACLETEST as 'f:\oracletest'
1,文件删除:
exec utl_file.fremove('ORACLETEST','1.bad');
2,文件移动:
exec utl_file.FRENAME('ORACLETEST','1.log','ORACLETEST','2.log');
非常好用,只要记得建目录授权就行了,我贴一段:SQL> CREATE DIRECTORY log_dir AS '/appl/gl/log';
SQL> GRANT READ ON DIRECTORY log_dir TO DBA; SQL> CREATE DIRECTORY out_dir AS '/appl/gl/user'';
SQL> GRANT READ ON DIRECTORY user_dir TO PUBLIC; --删除的方法及参数介绍
FREMOVE Procedure
This procedure deletes a disk file, assuming that you have sufficient privileges.SyntaxUTL_FILE.FREMOVE (
location IN VARCHAR2,
filename IN VARCHAR2);
--复制的介绍
FCOPY Procedure
This procedure copies a contiguous portion of a file to a newly created file. By default, the whole file is copied if the start_line and end_line parameters are omitted. The source file is opened in read mode. The destination file is opened in write mode. A starting and ending line number can optionally be specified to select a portion from the center of the source file for copying.SyntaxUTL_FILE.FCOPY (
location IN VARCHAR2,
filename IN VARCHAR2,
dest_dir IN VARCHAR2,
dest_file IN VARCHAR2,
start_line IN PLS_INTEGER DEFAULT 1,
end_line IN PLS_INTEGER DEFAULT NULL);官方文档及例子如下:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#BABDEJDH
----他非常厉害,一般问题都能回答上来 ,而且很详细。我原先的问题老是他回答的。
本地文件的删除和移动都用c实现就好,为什么一定要用oracle的UTL_FILE包?
oracle的UTL_FILE包处理文件比c处理起来低效很多