ORACLE 12C Database New Features
Online Data-file Move
Online Datafile Move is the very helpful technique implemented by oracle corporation in its 12C release.You need not to be worry about taking the tablespace offline to move the datfile...
wowla!!! Lets see how this magic work...
SELECT file_id, file_name FROM dba_data_files ORDER BY file_id;
FILE_ID FILE_NAME
---------- ----------------------------------------------------------------------
1 /u01/app/oracle/oradata/cdb1/system01.dbf
3 /u01/app/oracle/oradata/cdb1/sysaux01.dbf
4 /u01/app/oracle/oradata/cdb1/undotbs01.dbf
6 /u01/app/oracle/oradata/cdb1/users01.dbf
SQL> ALTER DATABASE MOVE DATAFILE '/u01/app/oracle/oradata/cdb1/system01.dbf' TO '/tmp/system01.dbf';
Database altered.
SQL>
SQL> SELECT file_id, file_name FROM dba_data_files WHERE file_id = 1;
FILE_ID FILE_NAME
---------- ----------------------------------------------------------------------
1 /tmp/system01.dbf
SQL>
SQL> HOST ls -al /u01/app/oracle/oradata/cdb1/system01.dbf
ls: cannot access /u01/app/oracle/oradata/cdb1/system01.dbf: No such file or directory
SQL> HOST ls -al /tmp/system01.dbf
-rw-r-----. 1 oracle oinstall 838868992 Oct 8 22:48 /tmp/system01.dbf
its sounds good... :)
ReplyDeleteI had a requirement of renaming few datafiles and also move their location. This note helped me.
ReplyDeleteThank you for taking the time to research and write this article. It's much appreciated.
ReplyDelete