Pages

Sunday, March 14, 2010

Non-ASM to ASM Database Migration

Last week, I was searching of some ASM contents on google and came across this great ASM post on "Shafiulla Oracle DBA Blog".

Although, Conceptual Details on ASM were hardly touched, but the post was pretty straight-forward and a direct technical approach. Any DBA can use content to get their hands on 10g ASM. And, so I thought of working on the contents in my test 10g environment. And within a matter of 2 hours, I was able to migrate my Non-ASM Database to ASM Database on Windows.

Here's a brief outline on the whole content:
  1. Creation of ASM Disks using "asmtool", spaced enough to have your Non-ASM Database fit in.
    asmtool -create disk01 2048
  2. Creation of OCR Repository and CSS Service, using "localconfig"
    localconfig add
  3. Creation of ASM Instance using "DBCA", as first step.
    Here you will have to set the following paramters like, ASM_DISKGROUP, ASM_DISKSTRING, LOCK_NAME_SPACE, etc.
  4. Creation of ASM Disk Groups and Addition od ASM Disks (as Candidates), using "DBCA", assecond step.
    Ensuring _ASM_ALLOW_ONLY_RAW_DISKS is set to FALSE, to successfully add ASM Disks.
    alter system "_ASM_ALLOW_ONLY_RAW_DISKS"=false scope=spfile;
  5. Ensure the Availability of the Instance:
    net start oracleasmservice+asm
  6. Checking the Assignments of the ASM Disks
    show parameter asm
    At this point the ASM Instance is up with mounted ASM Disk Groups.
  7. Change the following parameters (control_files, db_create_file_dest, db_create_online_log_dest_n) and startup the Non-ASM Database in NOMOUNT state.
    control_files='+DATA\control01.ctl','+DATA\control02.ctl','+DATA\control03.ctl'
  8. In another session, connect as target to Non-ASM Database, using "rman"
  9. Restore the control file from original location to ASM Disk, and mount the database, under "rman" session:
    restore controlfile from 'C:\oracle\asmdb\control01.ctl';
  10. Take a Copy Backup of the Non-ASM Database in ASM Disk space, under "rman" session.
    backup as copy database format '+DATA';
  11. Switch the Database and Tempfiles to ASM Disk having the copy backup.
    switch database to copy;
    run{set newname for tempfile 1 to '+DATA/asmdb/tempfile'; switch tempfile all;}
  12. Now, open the database.
  13. Add redo groups to ASM Disk, and drop the redo groups from non-ASM location
    alter database add logfile group 4 ('+data');
That's it!!! Your Non-ASM Database has just now become an ASM Database. For detailed steps on how to achieve this, please have a walkthough on the following posts. :
I am sure you will enjoy it!!!

No comments:

Post a Comment