ITPub博客

首页 > Linux操作系统 > Linux操作系统 > utl_file包的应用

utl_file包的应用

原创 Linux操作系统 作者:tolywang 时间:2007-07-25 00:00:00 0 删除 编辑
需要指定utl_file包可以操作的目录。在oracle 10g以前,可以用以下方法:
1、alter system set utl_file_dir='e:utl' scope=spfile;

2、在init.ora文件中,配置如下:
UTL_FILE=E:utl或者UTL_FILE_DIR=E:utl
在oracle 10g中建议用以下方法配置:CREATE DIRECTORY utl AS 'E:utl';
参见oracle online:
In the past, accessible directories for the UTL_FILE functions were specified in the initialization file using the UTL_FILE_DIR parameter. However, UTL_FILE_DIR access is not recommended. It is recommended that you use the CREATE DIRECTORY feature, which replaces UTL_FILE_DIR. Directory objects offer more flexibility and granular control to the UTL_FILE application administrator, can be maintained dynamically (that is, without shutting down the database), and are consistent with other Oracle tools. CREATE DIRECTORY privilege is granted only to SYS and SYSTEM by default.

第三步:授权给指定用户,以便执行utl_file
GRANT EXECUTE ON utl_file TO scott;

第四步:conn scott/tiger
就可以正常使用utl_file了。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-84819/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。

注册时间:2007-12-10

  • 博文量
    5595
  • 访问量
    13169968