{"id":4123,"date":"2025-06-08T09:06:45","date_gmt":"2025-06-08T09:06:45","guid":{"rendered":"https:\/\/w3buddy.com\/?post_type=cposts&#038;p=4123"},"modified":"2026-09-26T13:10:53","modified_gmt":"2026-09-26T07:40:53","slug":"create-directory","status":"publish","type":"post","link":"https:\/\/w3buddy.com\/blog\/create-directory\/","title":{"rendered":"Create Directory"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Directory objects in Oracle map to physical server paths and are required for file operations like <code>expdp<\/code> \/ <code>impdp<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Create Physical Directory on Server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run on: <strong>DB server as oracle user<\/strong><br>Use case: Create a location to store dump\/log files.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code># Create physical path\nmkdir -p \/u01\/dpump_dir\n\n# Set proper ownership and permissions\nchown oracle:oinstall \/u01\/dpump_dir\nchmod 755 \/u01\/dpump_dir<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note: <code>-p<\/code> = create parent directories automatically if they don&#8217;t exist.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Create Directory Object in Database<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run in: <strong>SQL*Plus as SYSDBA or privileged user<\/strong><br>Use case: Map DB object to OS directory for Data Pump.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>-- Create DB directory object\nCREATE DIRECTORY DPUMP_DIR AS '\/u01\/dpump_dir';<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. Grant Permissions to User<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run in: <strong>SQL*Plus<\/strong><br>Use case: Allow user to access directory during export\/import.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>-- Grant directory access to Data Pump user\nGRANT READ, WRITE ON DIRECTORY DPUMP_DIR TO hr;<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also grant to multiple users:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>GRANT READ, WRITE ON DIRECTORY DPUMP_DIR TO SYS, PUBLIC;<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udccc <strong>Notes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Directory names in Oracle are <strong>case-insensitive<\/strong>, but by convention, keep them <strong>UPPERCASE<\/strong> for clarity.<\/li>\n\n\n\n<li>The <strong>directory path<\/strong> must be on the <strong>database server<\/strong>, not on the client machine.<\/li>\n\n\n\n<li>Users need <strong>two types of permissions<\/strong> to use a directory object successfully:<br>\u2022 <strong>Database permission<\/strong> to access the directory object<br>\u2022 <strong>OS-level read\/write permission<\/strong> on the actual filesystem directory<\/li>\n\n\n\n<li>Common naming conventions: use names like <code>DPDIR<\/code>, <code>EXP_DIR<\/code>, or <code>DPUMP_LOGS<\/code> to keep directory objects consistent and recognizable.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Directory objects in Oracle map to physical server paths and are required for file operations like expdp \/ impdp. 1. Create Physical Directory on Server Run on: DB server as oracle userUse case: Create a location to store dump\/log files. Note: -p = create parent directories automatically if they don&#8217;t exist. 2. Create Directory Object [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowu461DA:productID":"","footnotes":""},"categories":[1225,984],"tags":[],"class_list":["post-4123","post","type-post","status-publish","format-standard","hentry","category-database","category-oracle-dba-d2d-tasks"],"_links":{"self":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/4123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/comments?post=4123"}],"version-history":[{"count":2,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/4123\/revisions"}],"predecessor-version":[{"id":4126,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/posts\/4123\/revisions\/4126"}],"wp:attachment":[{"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/media?parent=4123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/categories?post=4123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/w3buddy.com\/blog\/wp-json\/wp\/v2\/tags?post=4123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}