DBA Hub

📋Steps in this guide1/1

Rename/move a datafile

For oracle 12c, move or rename of datafile can be done online with one line:

oracle configurationintermediate
by OracleDba
13 views
1

Rename/move a datafile

For oracle 12c, move or rename of datafile can be done online with one line: For 11g, u have to follow below steps:( It needs downtime for the datafile)

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
SQL>
alter database move datafile '/home/oracle/producing1.dbf' to '/home/oracle/app/oracle/oradata/cdb1/testin1.dbf';
--Make the tablespace offline:
alter database datafile '/home/oracle/app/oracle/oradata/cdb1/testin1.dbf' offline;
-- Move the file physically to a new location.
mv /home/oracle/app/oracle/oradata/cdb1/testin1.dbf /home/oracle/producing1.dbf
-- Rename at db level
alter database rename file '/home/oracle/app/oracle/oradata/cdb1/testin1.dbf' to '/home/oracle/producing1.dbf';
-- Recover the datafile:
recover datafile 37;
-- Make the datafile online:
alter database datafile '/home/oracle/producing1.dbf' online;

Comments (0)

Please to add comments

No comments yet. Be the first to comment!