Monday, October 5, 2009

Migrate Database to ASM Using RMAN

We are Using RMAN to relocate non-ASM files to ASM files. The ASM files cannot be accessed through normal OS interfaces.

Step1: Query V$CONTROLFILE and V$LOGFILE to get the file names.
SQL> select * from V$CONTROLFILE;
SQL> select * from V$LOGFILE;

Step 2: Shutdown the database.
SQL> SHUTDOWN IMMEDIATE;

Step3: Modify the target database parameter file:
(i) Remove the CONTROL_FILES parameter from the spfile, so the control files will be created automatically in ASM Disk group mentioned in DB_CREATE_FILE_DEST destination
Using a pfile then set CONTROL_FILES parameter to the appropriate ASM files or aliases.
(ii) Set the DB_CREATE_FILE_DEST and DB_CREATE_ONLINE_LOG_DEST_n parameters to the relevant ASM disk groups.

Step 4: Startup nomount mode and Restore control file
RMAN> STARTUP NOMOUNT;

Restore the control file into the new location.
RMAN> RESTORE CONTROLFILE FROM 'old_controlfile_name';

Step 5: Startup mount mode and backup the Database.
RMAN> ALTER DATABASE MOUNT;

Backup database into ASM disk group.
RMAN> BACKUP AS COPY DATABASE FORMAT '+diskgroup1';

Step 6: Switch database and create or rename Redo log members
Switch all data files to the new ASM Diskgroup location.
RMAN> SWITCH DATABASE TO COPY;
RMAN> SQL “ALTER DATABASE RENAME ‘old_redolog_member’ to ‘+diskgroup2’;
or
Create new redo logs in ASM Disk group and delete the old redo log files.

Step 7: Open Database and create temporary tablespace.
Open database using resetlogs
SQL> ALTER DATABASE OPEN RESETLOGS;

Create temporary tablespace in ASM disk group.
SQL> CREATE TABLESPACE temp1 ADD TEMPFILE ‘+diskgroup1’;

Step 8: Drop old database files.
1. SQL> DROP TABLESPACE ‘old_temporary_tablespace’ including contents and datafiles;
2. Remove all remaining Non-ASM database files using OS commands

Regards
Satishbabu Gunukula
http://www.oracleracexpert.com/

14 comments:

  1. i am new to rac, now i am preparing for rac exam,
    i have seen ur site, helpful post.
    i am also having a blog in the name
    www.oracleinstance.blogspot.com

    regards,
    rajeshkumar govindarajan
    oracle rac dba
    conscientadbs
    cochin. india

    ReplyDelete
  2. THANKS FOR GIVING VALUABLE INFORMATION

    ReplyDelete
  3. HI SATISH
    THIS IS THE FIRST TIME I HAVE SEEN UR BLOG, POSTS ARE VERY USEFULL

    ReplyDelete
  4. Hi Expert!

    Very nice post. Thanks!

    Mahir M. Quluzade
    www.mahir-quluzade.com

    ReplyDelete
  5. hi ,
    nice doc. will you please post the steps for 11gr2 non-rac to rac migration.

    ReplyDelete
  6. Please check my articles

    http://www.oracleracexpert.com/2012/10/convert-single-instance-to-rac-part1.html
    http://www.oracleracexpert.com/2012/11/convert-single-instance-to-rac-part2.html

    Regards,
    Satish

    ReplyDelete
  7. Good post !!
    http://chandu208.blogspot.com/

    ReplyDelete
  8. Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene.* gmail sign up

    ReplyDelete
  9. This is so good to see. We have do more things like this for the military families. They are protecting us and we need to support them in this way.

    happy birthday sister images
    good night message for her
    birthday message for wife
    birthday quotes for husband
    birthday wishes for friend female
    birthday wishes for sister

    ReplyDelete