This discussion is archived
4 Replies Latest reply: Nov 19, 2012 11:09 AM by nnarimanov RSS

Move database files from one ASM diskgroup to another

BhaviSavla Explorer
Currently Being Moderated
We are working on 11.2.0.3 RAC environment. We have an activity in which we have to move ASM database files from one diskgroup to another. We have the sufficient downtime for the activity. On checking MOS it says copying datafiles from "rman copy" command is the preferred method.But with 11g R2 we can use cp command in ASMCMD.

So which is the preferred method to copy asm database files and why:
RMAN Copy command or ASMCMD cp command
  • 1. Re: Move database files from one ASM diskgroup to another
    Shivananda Rao Guru
    Currently Being Moderated
    Hi,

    I normally prefer to go with RMAN than the ASMCMD cp command. Suppose the datafiles are OMF and you use RMAN to copy:
    1. offline the datafile
    2. RMAN>copy datafile <offline-datafile-on-old-DG> to +NEW-DG;
    3. At database level, rename the old datafile to the new name reported from the above command
    4. Switch the new datafile to copy
    5. Recover the new datafile
    Here, RMAN assigns automatically a unique name for the new datafile (OMF) and you only have to specify the new diskgroup name while using the COPY command which makes things easier. But say if you are using ASMCMD, then you cannot just specify the new diskgroup name for the CP command, which means that a unique name cannot be obtained automatically.

    The below command does not work out.
    asmcmd>cp OLD_DG/datafile/abc.123 NEW_DG
    You need to specify the destination name as well something like below:
    asmcmd>cp OLD_DG/datafile/abc.123 NEW_DG/abc.dbf
    Here you are getting a normal file and not OMF, though ASM internally creates a link for the file "+NEW_DG/abc.dbf" pointing to an OMF. ASMCMD makes you a bit more confusive.

    Refer this http://surachartopun.com/2009/10/moving-datafile-in-asm-by-asmcmdcp.html
  • 2. Re: Move database files from one ASM diskgroup to another
    585179 Expert
    Currently Being Moderated
    Hi,

    I would use rman to perform it as it is simple
    backup as copy database format <new diskgroup>
    switch database to copy;
    or you can follow note "How to move ASM database files from one diskgroup to another ? [ID 330103.1]"


    Hope it helps


    Cheers
  • 3. Re: Move database files from one ASM diskgroup to another
    onedbguru Pro
    Currently Being Moderated
    I second the rman copy method. You can begin to do the move prior to your actual downtime (the morning of??) and then switch datafile and recover datafile during the outage time.. This works like a charm. It also good to use when you need to move datafiles from one filesystem to another or filesystem to ASM or ASM to filesystem.
  • 4. Re: Move database files from one ASM diskgroup to another
    nnarimanov Newbie
    Currently Being Moderated
    I would prefer rman copy. Let's assume you need to move 20 datafiles.It will be so soggy doing it via cp command. But with rman you can concurently copy datafiles.

Legend

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