Saturday, March 26, 2016

Migrating Individual non-ASM datafiles to ASM

Migrating Individual non-ASM datafiles to ASM

This section will describe how to migrate individual tablespaces to ASM, while the database is online.
This illustration assumes that there is a tablespace named TEST located on a mounted filesystem.
Additionally, this same procedure can also be used to move a datafile from one diskgroup to another
diskgroup.

1. Connect to RMAN
RMAN> connect target

2. Make the target tablespace offline or read-only
RMAN> sql "alter tablespace TEST offline";

3. Copy the ISHAN tablespace to the DATA diskgroup
RMAN> backup as copy tablespace ishan format '+DATA';

4. On successful copy of the tablespace, switch all the datafiles in the TEST tablespace to ASM.
Determine the file number of the files to be switched (use v$datafile).
RMAN> switch datafile 6 to copy;

When the following message is received, it is deemed that the tablespace is
migrated successfully.
datafile 6 switched to datafile copy "+DATA/orcl/datafile/test.314.1"

Note, the original filesystem copy still exists, and can be deleted



No comments:

Post a Comment