1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to change Database Directory Path?

Discussion in 'Server Administration and Options' started by kimipatel, Oct 26, 2012.

  1. kimipatel

    kimipatel Active Member

    Messages:
    53
    Likes Received:
    1
    Trophy Points:
    140
    Hi,

    How to change database directory path from older to newer one.

    Thanks.
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    WHICH 'directory path' are you asking about?
     
  3. kimipatel

    kimipatel Active Member

    Messages:
    53
    Likes Received:
    1
    Trophy Points:
    140
    Hi,

    I want to modify default path of database directory because it is wrong.

    Thanks
     
  4. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    What 'default path of database directory' are you trying to ask about? What 'directory path' is 'wrong'??
     
  5. kimipatel

    kimipatel Active Member

    Messages:
    53
    Likes Received:
    1
    Trophy Points:
    140
    Hi,

    Actually, we created new development database from production database. In production database all directories are located in /u04, which is not available in new server. After importing data using export/import, I found that existing directories are having still older path because those are generated from import command. Now I want change all locations.

    Thanks.
     
  6. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Now that you've said what it is you want to do the task is fairly straightforward:

    Code (SQL):

    CREATE OR REPLACE directory <directory name> AS '<O/S directory>';
     
    For example:

    Code (SQL):

     
    SQL> SELECT * FROM dba_directories WHERE directory_name = 'BANANA';
    OWNER                          DIRECTORY_NAME
    ------------------------------ ------------------------------
    DIRECTORY_PATH
    --------------------------------------------------------------------------------
    SYS                            BANANA
    /u04/banana

    SQL> CREATE OR REPLACE directory banana AS '/u01/banana';
     
    Directory created.
     
    SQL> SELECT * FROM dba_directories WHERE directory_name = 'BANANA';
    OWNER                          DIRECTORY_NAME
    ------------------------------ ------------------------------
    DIRECTORY_PATH
    --------------------------------------------------------------------------------
    SYS                            BANANA
    /u01/banana

    SQL>
    This has changed the directory path from /u04 to /u01.
     
    kimipatel likes this.
  7. kimipatel

    kimipatel Active Member

    Messages:
    53
    Likes Received:
    1
    Trophy Points:
    140
    Hi,

    It's worked.. Thanks for the help....

    Thanks.
     
  8. deeplydrink

    deeplydrink Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
  9. deeplydrink

    deeplydrink Active Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    55
    oh ,sorry.

    you can follow as :create or replace directory exp_dir as '/tmp'