top of page

MOVING DATAFILE FROM ORACLE ASM DISKGROUP TO ANOTHER DISKGROUP

  • Yazarın fotoğrafı: Ekrem Oğuz ŞAHİN
    Ekrem Oğuz ŞAHİN
  • 14 Kas 2022
  • 1 dakikada okunur

ree

In this writing, we'll move datafile from an ASM diskgroup to another group. Datafile of users tablespace which is in our test environment, is in '+DATA' Diskgroup. We'll move that datafile to '+DATA2' Diskgroup.

SQL> SELECT FILE#,TS#,NAME FROM V$DATAFILE;
ree

First, alter 'READ ONLY' mode of the tablespace where the datafile to be moved is in.

SQL> ALTER TABLESPACE USERS READ ONLY;
ree

Copy the datafile on the news diskgroup. If datafile size is too big, you can move it with section size. However, DB compatibility 12.0.1 or later is necessary for it.

RMAN> BACKUP AS COPY DATAFILE 7 FORMAT '+DATA2';
Section Size'lı syntaxı;
RMAN> BACKUP AS COPY DATAFILE 7 FORMAT '+DATA2' SECTION SIZE 256G;
ree

Check copy of the datafile.

RMAN> LIST COPY OF DATAFILE 7;
ree

Disable 'Tablespace'.

SQL> ALTER TABLESPACE USERS OFFLINE;
ree

Switch new datafile and old datafile.

RMAN> SWITCH DATAFILE 7 TO COPY;
ree

Alter 'read/write' and 'online' in Tablespace.

SQL> ALTER TABLESPACE USERS ONLINE;
SQL> ALTER TABLESPACE USERS READ WRITE;
ree

You may delete the old datafile to create free space.

RMAN> DELETE COPY OF DATAFILE 7;
ree

As you see, datafile numbered 7 is moved from +DATA diskgroup to +DATA2 diskgroup.

ree

Here ends my post "MOVING DATAFILE FROM ORACLE ASM DISKGROUP TO ANOTHER DISKGROUP".

Hope to see you in new posts,

Take care.

 
 
 

©2021, Data4Tech 

bottom of page