Sign Up

Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Sorry, you do not have permission to add post.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Oraask Logo Oraask Logo
Sign InSign Up

Oraask

  • Write
    • Add A New Post
    • Ask A Question

Oraask Navigation

Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Dev Tools
    • Online Compiler
    • Base64 Converter
  • Wiki
    • SQL Tutorials
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
Home/ Questions/Q 5074
Next
Answered
Question
albert
  • 0
albertExplorer
Asked: June 10, 20172017-06-10T07:47:09+03:00 2017-06-10T07:47:09+03:00In: PL/SQL

How to check and test read/write permissions of Oracle directory?

  • 0

suppose we have created new directory on database server and give it required privileges like :

[code]CREATE OR REPLACE DIRECTORY TEST_DIR AS ‘/usr/tmp’;
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO MYUSER;[/code]

Now i want to know if oracle has capable to read and write into this directory or not ?

 

thanks in advance.

databasedirectoryoraclepl/sqlread/write
  • 3 3 Answers
  • 10k Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    Related Questions

    • Export query result to Oracle Server
    • What is the difference between Implicit and Explicit Cursor in Oracle
    • How many triggers can I create on a single table in Oracle Database
    • How many types of collections are there in Oracle
    • Can we extend Varray in Oracle PL/SQL

    3 Answers

    • Voted
    • Oldest
    • Recent
    1. Best Answer
      Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
      2018-09-19T08:33:18+03:00Added an answer on September 19, 2018 at 8:33 am
      This answer was edited.

      You can use the UTL_FILE package. For example, this will verify that you can create a new file named your_test_file_name.txt in the directory and write data to it

      [code]
      DECLARE
      l_file utl_file.file_type;
      BEGIN
      l_file := utl_file.fopen (‘UR_DIR’, ‘some_new_file_name.txt’, ‘W’);
      utl_file.put_line (l_file, ‘Content of the file’);
      utl_file.fclose (l_file);
      EXCEPTION
      WHEN utl_file.invalid_path THEN
      dbms_output.put_line (‘File location is invalid’);
      END;
      [/code]

      Also you can use UTL_FILE.FGETATTR to check if your file is exist and readable or not for more info about UTL_FILE click here.

      If you are looking for How to grant read and write on directory in oracle you can check my answer here

      Regards.

      • 0
      • Reply
      • Share
        Share
        • Share onFacebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. Gorakh
      2020-10-11T21:49:58+03:00Added an answer on October 11, 2020 at 9:49 pm

      It helps me a lot….Thanks,Gorakh

      • 0
      • Reply
      • Share
        Share
        • Share onFacebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    3. Mmorsy Junior mahmoudmorsymm1985@gmail.com
      2017-07-09T18:28:41+03:00Added an answer on July 9, 2017 at 6:28 pm

      Check the below query :

      SELECT * FROM all_tab_privs WHERE table_name = ‘your_directory’;

      • -1
      • Reply
      • Share
        Share
        • Share onFacebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    Adv 250x250

    Explore

    • Categories
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Dev Tools
      • Online Compiler
      • Base64 Converter
    • Wiki
      • SQL Tutorials
      • Java Tutorials
      • Python Tutorials
      • JavaScript Tutorials

    Footer

    Oraask

    About

    Oraask is a website for developers and software engineers who want to learn new skills, share their knowledge, and solve their coding problems. Oraask provides free content on various programming languages and topics, such as Oracle, Python, Java, etc. Oraask also allows users to ask questions and get answers from other members of the community.

    About Us

    • About Us
    • Contact Us

    Legal Stuff

    • Privacy Policy
    • Terms & Conditions

    Follow

    Oraask is licensed under CC BY-NC-SA 4.0Oraask CopyrightOraask CopyrightOraask CopyrightOraask Copyright

    © 2019 Oraask. All Rights Reserved
    With Love by Oraask.

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.