Zahid Karim
Recent Posts
1.Draw plus and cross sign into PDF via PLSQL using PL_FPDF
2.Draw Triangle directly into PDF via PLSQL using PL_FPDF
3.Write fast and efficient PLSQL - DBMS_PROFILER
4.Fix physically corrupt data blocks using PLSQL - DBMS_REPAIR
5.Encrypt or Decrypt sensitive data using PLSQL - DBMS_CRYPTO
Find me on
How to migrate online redo logs to Oracle ASM storage Audit Trail example in Oracle 10gR2

Migrate Oracle Flash Recovery Area to ASM storage via RMAN

Posted by Zahid on August 28, 2009.

This tutorial is about migrating your flash recovery area to ASM storage along with its contents. It assumes that you already have a database up and running and have installed ASM instance to use with it. Your database was created on file system and you want to migrate it to ASM you have just installed.

The flash recovery area contains your backups in backup sets, data file copies and archive log files. We will migrate everything to ASM diskgroup.

NOTE: This tutorial was performed on Oracle 10g hosted on RHEL5.

$ rman target / RMAN> list archivelog all; using target database control file instead of recovery catalog List of Archived Log Copies . . . . Output Trimmed /* These are the archive logs that we have on flash_recovery_area. The flash_recovery_area is "/u01/app/recovery/". */ RMAN> list backup of database; List of Backup Sets =================== . . . . Output Trimmed /* These are the backup sets we have on flash_recovery_area. */ RMAN> list copy of database; List of Datafile Copies . . . . Output Trimmed /* These are data file copies we have on flash_recovery_area */

Lets now switch the flash_recovery_area from "/u01/app/recovery" to +RECOVERY ASM disk group.

$ sqlplus / as sysdba SQL> show parameter db_recovery_file_dest NAME TYPE VALUE ---------------------- ----------- --------------------- db_recovery_file_dest string /u01/app/recovery SQL> SQL> alter system set db_recovery_file_dest='+RECOVERY' scope=spfile; System altered. /* This will change the flash_recovery_area location to ASM diskgroup +RECOVERY */ SQL>

Now start RMAN and migrate all archive logs, backupsets and data file copies to ASM.

$ rman target / RMAN> run { BACKUP AS COPY ARCHIVELOG ALL DELETE INPUT; /* This will copy the archive logs to new flash_recovery_area location which is ASM diskgroup and will delete the source files from old flash recovery area. */ BACKUP DEVICE TYPE DISK BACKUPSET ALL DELETE INPUT; /* This will migrate the backupsets to new flash_recovery_area location which is ASM diskgroup and will delete the source files from old flash recovery area. */ BACKUP AS COPY DATAFILECOPY 'name_of_datafile_copies_on_recovery_area' DELETE INPUT; /* Add all data file copies in the same way! They will copy the data file copies to new flash_recovery_area location which is ASM diskgroup and will delete the source files from old flash recovery area. */ } Starting backup at 28-AUG-09 . . . Output Trimmed . . . Finished backup at 28-AUG-09 RMAN> list archivelog all; List of Archived Log Copies . . . . Output Trimmed /* All archive logs are on the new flash_recovery_area i.e. +RECOVERY diskgroup in ASM. */ RMAN> list backup of database; List of Backup Sets =================== . . . . Output Trimmed /* All backupsets should be on the new flash_recovery_area now i.e. +RECOVERY diskgroup in ASM. */ RMAN> list copy of database; List of Datafile Copies . . . . Output Trimmed RMAN> /* All data file copies should br on the new flash_recovery_area now i.e. +RECOVERY diskgroup in ASM. */ RMAN> exit

See also:
How to install ASM instance on a non-asm Oracle database
How to configure Raw Disks in RHEL 5
How to migrate Oracle datafiles to ASM storage via RMAN
How to Configure ASM disks using ASMLib or Raw Disks
How to migrate online redo logs to Oracle ASM storage
Add ASM Instance into Enterprise Manager