Hi guys, in this blog I am going to explain you about Move Database file from one directory to another in Oracle
In Oracle, you can move a database file from one directory to another using the ALTER DATABASE statement.
Here are the general steps you can follow:
Step 1 –
Create new directory in Linux Oracle box-
Syntax-
mkdir directory_name
Step 2 –
After creating a directory, you can navigate into it using the cd command:
Syntax-
cd directory_name
Step 3 –
Move the Database file from one directory to another directory
Syntax-
mv /u01/path/to/datafile01.dbf /u02/path/to/datafile01.dbf
Step 4 –
We may now connect to the Oracle database and start the database.
Syntax-
Cat /etc/oratab
. oraenv
DB name
Sqlplus / as sysdba
Start
Step 5 –
Begin the mount now.
Syntax-
Startup mount
Step 6 –
Drop and offline the datafile from directory one, then open the database.
Syntax-
Alter database datafile ‘path’ offline drop;
Leave a Reply