sexta-feira, dezembro 19

How to Move Datafiles to Different Diskgroup

Sometimes you'll need to move some datafiles to another diskgroup in ASM. Maybe you need to put old data on slower disks.

You can get more information about this process in this metalink document: 438580.1

Prereqs
-------
Have a full cold backup for the database is recommended.

Solution
--------

1. Create a new diskgroup with desired redundancy.
asm> create diskgroup DG01 external redundancy disk 'ORCL:SDX';

2. Take the tablespace offline:
sql> alter tablespace USERS offline;

3. Copy the datafiles using RMAN:
rman> copy datafile '+DG/PROD/users01.dbf' to '+DG01';

3.1 Create ASM alias for the datafile. (This is not a required step)
RMAN will create the datafile with full name in ASM, to simplify your life,
you could create an alias in ASM filesystem, like this sample:
asmcmd> makealias +DG/PROD/datafile/users.256.3231232 +DG/PROD/users01.dbf

4. Rename the datafile in the database controlfile.
sql> alter database rename file '+DG/PROD/users01.dbf' to '+DG01/PROD/users01.dbf';

5. Take the tablespace online:
sql> alter tablespace USERS online;

6. Delete original datafiles:
asmcmd> rm +DG/PROD/users01.dbf

Nenhum comentário: