utl_file包中的fremove过程可以删除某个目录下的文件
[oracle@centos tmp]$ touch haha
[oracle@centos tmp]$ ll haha
-rw-r--r-- 1 oracle oinstall 0 Aug 14 20:12 haha
SQL> exec utl_file.fremove('/tmp','haha');
PL/SQL procedure successfully completed.
[oracle@centos tmp]$ ll haha
ls: haha: No such file or directory
执行以上过程之前,需要设置utl_file_dir参数。UTL_FILE_DIR lets you specify one or more directories that Oracle should use for PL/SQL file I/O.
SQL> show parameter utl
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
create_stored_outlines string
utl_file_dir string /tmp