Wednesday, November 27, 2019

How to move a datafile online in Oracle 12.1


Starting with Oracle 12.1, you can move datafiles online.


Generate move-script:
select 'alter database move datafile ''' || file_name || ''' TO ''' || replace(file_name,'old_sid','new_sid') || ''';'
from dba_data_files;

Output will be:
alter database move datafile '/oradata/old_sid/system01.dbf' TO '/oradata/new_sid/system01.dbf';


No comments:

Post a Comment