Below are the steps to move ASM files from one ASM disk group to another:
Note:Make sure the database is in archive log mode before proceeding with the below exercise.
- Identify the data file to be moved.
- Identify the diskgroup on to which the file has to be moved.
- Take the file offline.
- Copy the file to new diskgroup using RMAN.
- Rename the file to point to new location.
- Switch data file copy
- Recover the file.
- Bring the file online.
- Verify the new file locations.
- Delete the file from its original location.
SQL>Select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
+DATA/easydw/datafile/tbl_abacus.271.703296941
ASM>SELECT name FROM v$asm_diskgroup;
NAME
------------------------------
DATA
FRA
SQL>ALTER DATABASE DATAFILE '+DATA/easydw/datafile/tbl_abacus.271.703296941' OFFLINE';
$ rman target /
RMAN> COPY DATAFILE '+DATA/easydw/datafile/tbl_abacus.271.703296941' TO '+FRA';
Starting backup at 20-NOV-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=140 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00028 name=+DATA/easydw/datafile/tbl_abacus.271.703296941
output filename=+FRA/easydw/datafile/tbl_abacus.316.703382539 tag=TAG20091120T000218 recid=2 stamp=703382539
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 20-NOV-09
Starting Control File and SPFILE Autobackup at 20-NOV-09
piece handle=+FRA/easydw/autobackup/2009_11_20/s_703382539.317.703382541 comment=NONE
Finished Control File and SPFILE Autobackup at 20-NOV-09
SQL>ALTER DATABASE RENAME FILE '+DATA/easydw/datafile/tbl_abacus.271.703296941'
TO '+FRA/easydw/datafile/tbl_abacus.316.703382539';
RMAN> SWITCH DATAFILE '+FRA/easydw/datafile/tbl_abacus.316.703382539' TO COPY;
SQL> RECOVER DATAFILE '+FRA/easydw/datafile/tbl_abacus.316.703382539';
SQL> ALTER DATABASE DATAFILE '+FRA/easydw/datafile/tbl_abacus.316.703382539' ONLINE;
SQL>SELECT file_name FROM dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
+FRA/easydw/datafile/tbl_abacus.316.703382539
$ export ORACLE_SID=+ASM
$ sqlplus "/ as sysdba"
ASM> ALTER DISKGROUP DATA DROP FILE '+DATA/easydw/datafile/tbl_abacus.271.703296941';
No comments:
Post a Comment