欢迎光临
我们一直在努力

utl_file包的应用-数据库专栏,SQL Server

建站超值云服务器,限时71元/月

第一步:以管理员用户登陆
如:conn sys/password@sid as sysdba
第二步:设置可操作目录
需要指定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了。

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » utl_file包的应用-数据库专栏,SQL Server
分享到: 更多 (0)