How To Create DBA Directories
1. create folder on Unix, /u01mkdir test1
mkdir test2
2. create dba_directories with sysdba,
create DIRECTORY directory_name1 AS ‘/u01/test1';
create DIRECTORY directory_name2 AS ‘/u01/test2';
3.show created dba directories:
select * from dba_directories;
SYS directory_name1 /u01/test1
SYS directory_name2 /u01/test2
4. Privilege for other user:
GRANT READ,WRITE,EXECUTE ON DIRECTORY directory_name1 TO user_name;
GRANT READ,WRITE,EXECUTE ON DIRECTORY directory_name2 TO user_name;
5. test
DECLARE
fhandle UTL_FILE.file_type;
BEGIN
fhandle := UTL_FILE.fopen (‘directory_name1', ‘test_file.txt’, ‘w’);
UTL_FILE.put (fhandle, ‘This is the first line’);
UTL_FILE.fclose (fhandle);
END;
/
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment
Note: only a member of this blog may post a comment.