This discussion is archived
7 Replies Latest reply: Sep 18, 2011 10:06 PM by user1987306 RSS

How to move or migrate whole directories between ASM disk groups?

user1987306 Newbie
Currently Being Moderated
Hello everyone!

I'm playing around with Oracle ASM and Oracle Database (11g R1), I'm a student. This is just for testing purposes.

Computer specifications are:
Processor: Intel Pentium 4 HT 3.00 Ghz.
RAM Memory: 2 GB.
Hard Disk: 250 GB
O.S.: Windows XP Professional Edition SP 2.

I installed Oracle ASM, I created an ASM disk group (+FRA), I installed Oracle Database and I created a testing database. The database is working properly over the ASM disk group. Days ago, I got help about the initialization parameters DB_CREATE_FILE_DEST, DB_CREATE_ONLINE_LOG_DEST_1, DB_CREATE_ONLINE_LOG_DEST_2 and DB_RECOVERY_FILE_DEST, based on their function, I created another 3 ASM disk groups (+FILES, LOG1, LOG2). Currently, the four initialization parameters are pointing to its corresponding ASM disk group. As you can deduce, at the installation moment of the Oracle Database I used the ASM disk group "+FRA" and inside it were created the directories: CONTROLFILE, DATAFILE, ONLINELOG, PARAMETERFILE, TEMPFILE and the SPFile.

My point is I wanna move or migrate the directories DATAFILE, PARAMETERFILE, TEMPFILE and the SPFile to "+FILES", ONLINELOG and CONTROLFILE to "+LOG1" and "+LOG2", this way, the ASM disk group "+FRA" will contain the Flash Recovery Area only. What is the procedure to do this?

Thanks in advance!
  • 1. Re: How to move or migrate whole directories between ASM disk groups?
    585179 Expert
    Currently Being Moderated
    user1987306 wrote:
    Hello everyone!

    My point is I wanna move or migrate the directories DATAFILE, PARAMETERFILE, TEMPFILE and the SPFile to "+FILES", ONLINELOG and CONTROLFILE to "+LOG1" and "+LOG2", this way, the ASM disk group "+FRA" will contain the Flash Recovery Area only. What is the procedure to do this?

    Thanks in advance!
    Hi,


    There are couple of approaches you can use, here is some of them
    - To move datafile, start the database in mount state
    RMAN > copy datafile '+FRA/xxx' to '+FILES1';
    SQL > alter database rename file '+FRA/xxx' to '+FILES1/xxx';

    - To move tempfile
    SQL > alter tablespace TEMP add tempfile '+FILES1' SIZE 10M;
    SQL > alter database tempfile '+FRA/xxx' drop;

    - To move onlinelog
    SQL > alter database add logfile member '+LOG1' to group 1;
    SQL > alter database add logfile member '+LOG2' to group 1;
    SQL > alter database drop logfile member '+FRA/xxx';

    - To move controlfile
    SQL > restore controlfile to '+FILES1' from '+FRA/xxx';
    update the spfile to reflect new location of controlfile


    Cheers
  • 2. Re: How to move or migrate whole directories between ASM disk groups?
    Sebastian Solbach (DBA Community) Guru
    Currently Being Moderated
    Hi,

    just as side node. It is Oracle best practice to only have 2 diskgroups. One for data, and one for fast recovery area (which will also contain 1 redo log member and a control file copy).
    If you follow best practice and put both diskgroups on different spindles/disks, then you will never loose any data, no matter which diskgroup is not accessible. Since with the content of the FRA you can fully reconstruct a database, as well as the database will continue to work, without the FRA diskgroup. So normally (per definition) one redolog member and a controlfile copy belongs to the FRA.

    While for exercise it may be good to find out how to move files between diskgroup, it does not make sense to have more than 2 diskgroup. (Although some exceptions, like storage mirror technologies exists).

    Regards
    Sebastian
  • 3. Re: How to move or migrate whole directories between ASM disk groups?
    user1987306 Newbie
    Currently Being Moderated
    Hello Fiedi Z!

    Thanks a lot for your support!

    I'm testing your procedure and everything was working properly, then, I moved the control files to its new location in "+LOG1" using the statement "RESTORE CONTROLFILE". I updated the initialization parameter "control_files" to the new location. I shut down the Oracle Instance and when I started up it again, I'm getting this message:

    ORA-15124: ASM file name '+LOG1/pglobalname1/controlfile/current.261.756296319, +LOG1/pglobalname1/controlfile/current.260.756296319' contains an invalid alias name

    Now the Oracle Instance doesn't startup. Could you help me again please?

    Thanks a million!

    P.S. sorry about the delay, but there is a lot of school exams!
  • 4. Re: How to move or migrate whole directories between ASM disk groups?
    user1987306 Newbie
    Currently Being Moderated
    Hi Sebastian!

    Thanks a lot to share a little bit of your experience. I like the sound of the phrase "best practices".
    I believe there is nothing more important that the experience of touch the "real world", I mean, your words enable me imagine how the real databases are configured to work day by day. Maybe one day I'll be an Oracle DBA, that's my dream!

    Thank you so much!
    Best regards!
  • 5. Re: How to move or migrate whole directories between ASM disk groups?
    585179 Expert
    Currently Being Moderated
    user1987306 wrote:
    Hello Fiedi Z!

    ORA-15124: ASM file name '+LOG1/pglobalname1/controlfile/current.261.756296319, +LOG1/pglobalname1/controlfile/current.260.756296319' contains an invalid alias name

    Now the Oracle Instance doesn't startup. Could you help me again please?

    Thanks a million!
    Looks like you put the wrong controlfile, check

    - go to asmcmd
    - asmcmd> ls +LOG1/pglobalname1/controlfile


    Cheers
  • 6. Re: How to move or migrate whole directories between ASM disk groups?
    user1987306 Newbie
    Currently Being Moderated
    Hi Fiedi!

    Thanks by your suggestion, today I learned a little about asmcmd. I changed the controlfiles names several times, I used the V$ASM_ALIAS view in order to get the alias name of each controlfile, and after try again and again I'm not able to startup the database. Each startup attempt oracle shows different error messages. So I decided to reinstall the oracle database software and start the complete process again, only the controlfiles movement got me in troubles. I'm a lucky guy because this is just a database for study purposes!

    As soon as I reinstall the DB and I attempt again to move whole directories between asm disk groups I'll post the result.

    Thanks!
    Best wishes!
  • 7. Re: How to move or migrate whole directories between ASM disk groups?
    user1987306 Newbie
    Currently Being Moderated
    Hi Fiedi Z! How are you going?

    As I said, I have reinstalled the Oracle Database Software and I have created a new Oracle Database.
    I applied the suggested procedure by you to move the files to the desired ASM disk group and now everything is working properly.

    Your procedure is the solution!!

    Thanks a million for your valuable time and accurate support!!
    Best wishes!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points