Migrating  ASM file between diskgroups

In this post, I am going to share how to move datafile between disk group. 


1) Fetch the data file name. Or we can get it for respective tablespace name.

   dba_data_files where tablespace_name='APP_DATA';

2)  Note down the target diskgroup name.


3)  Take the old data file offline from sqlplus '/as sysdba'

SQL> alter database datafile '+PROD_OLD/SID/app_data.718' offline;

4)  Copy the datafile to the new diskgroup (using RMAN)

$ rman target /

connected to target database PROD (DBID=3673298366)

RMAN> copy datafile '+PROD_OLD/SID/app_data.718' to '+PROD_NEW';

6) Find the new filename from asmcmd in +PROD_NEW diskgroup and SID/datafiles folder

7) Re-name the data file using sqlplus '/as sysdba'

SQL> alter database rename file '+PROD_OLD/SID/app_data.718' to '+PROD_NEW/SID/app_data.new_name';

8) Rename using  RMAN data file

RMAN> switch datafile '+PROD_NEW/SID/app_data.new_name' to copy;

9) RMAN recovery to the new data file

RMAN> recover datafile '+PROD_NEW/SID/app_data.new_name';

10)  Put the data file online

RMAN> alter database datafile '+PROD_NEW/SID/app_data.new_name' online;

If you like please follow and comment