top of page

MOVING DATAFILE FROM ORACLE ASM DISKGROUP TO ANOTHER DISKGROUP



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;

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

SQL> ALTER TABLESPACE USERS READ ONLY;

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;

Check copy of the datafile.

RMAN> LIST COPY OF DATAFILE 7;

Disable 'Tablespace'.

SQL> ALTER TABLESPACE USERS OFFLINE;

Switch new datafile and old datafile.

RMAN> SWITCH DATAFILE 7 TO COPY;

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

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

You may delete the old datafile to create free space.

RMAN> DELETE COPY OF DATAFILE 7;

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


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

Hope to see you in new posts,

Take care.

83 views0 comments

Recent Posts

See All
bottom of page