Sunday, October 6, 2013

Convert Datafile from Raw Device to normal File System Or ASM

Use RMAN to move datafiles from raw devices to file system./ASM file system.

1. Connect to the database:

 $ sqlplus system/manager@orcl

2. Put the tablespace with the datafile, which should be converted, offline:

 SQL> alter tablespace test_ts offline;

3. Start rman and connect it to the database:

 $ rman nocatalog target rman/rman@orcl

4. a-Move the datafile to file system:

 RMAN> run {
 2> allocate channel c1 type disk;
 3> copy datafile '/dev/raw1' to '/u01/oradata/orcl/test_ts.dbf';
 4> }

4. b -Move the datafile to ASM:
 RMAN> run {
 2> allocate channel c1 type disk;
 3> copy datafile '/dev/raw1' to '+DATA';
 4> }

5. Rename the moved datafile:

 SQL> alter database rename file '/dev/raw1' to '/u01/oradata/orcl/test_ts.dbf';

6. Put the tablespace back online:

 SQL> alter tablespace test_ts online;

No comments:

Post a Comment