CREATE DIRECTORY IN ORACLE DATABASE

Its often required to create a logical directory in database for extracting the data dumps to physical filesystem directory

First thing to do is to check if the directory exists on filesystem and has proper permissions like read,write,execute and ownership of oracle user and oinstall or dba group

SQL> !ls -lrt /home/oracle
total 541840
drwxrwxr-x. 4 oracle oinstall        74 Dec 13  2020 oraInventory
-rwxrwxrwx  1 oracle oinstall       187 Dec 13  2020 rman_duplicate_bkpset.sh
-rw-r--r--  1 oracle oinstall      2899 Dec 13  2020 rmandup.log
-rw-r--r--  1 oracle oinstall       321 Dec 17  2020 5m.log

Check if the directory exist logically on the database

SQL> select * from dba_directories;

Create logical directory like this

SQL> create directory exp as '/home/oracle';

Directory created.

Atlast verify the same

SQL> select directory_name,directory_path from dba_directories where directory_name='EXP';

DIRECTORY_NAME
--------------------------------------------------------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
EXP
/home/oracle

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s