How to Use Oracle 12c Online Database to Move Datafile

How to use the new ‘ALTER DATABASE MOVE DATAFILE’ feature to move data files online to a different location, disk or storage system.

oracle 12c

image_pdfimage_print

Prior to Oracle 12c, moving non-ASM data files on or between storage arrays required taking data files ‘offline’ and negotiating an outage with the business, with Oracle 12c this is no longer the case. In the Post I will detail how the new ‘ALTER DATABASE MOVE DATAFILE’ feature can be used to move data files online to a different location, disk or storage system.

Navigating changes at Broadcom VMware by modernizing your virtualization strategy for future flexibility, certainty and scale

Storage Maintenance

The Oracle ALTER DATABASE MOVE DATAFILE feature provides a simple Online method of migrating data to a new storage platform performing all the heavy lifting for you including renaming or relocating of the data files at an operating system level and changing references in the Oracle Control Files.

Online Datafile Move

During a data file move, progress can be  monitored via the V$SESSION_LONGOPS view, the reported bytes done will increment until the move is completed e.g.

Please note before you begin make sure you have enough space on the source and target storage platforms as Oracle will allocate the required storage space on the target system and will not free any space up on the source until the move is complete.

If you specify the ‘KEEP’ parameter Oracle will copy the data file to the new location and retain the old datafile in the original location, it will be no longer be reference in the control files and can be removed when no longer required.

Examples:

Below are examples of how the ALTER DATABASE MOVE DATAFILE command can be used to Rename, Relocate, Copy or Move data files to to ASM.

Rename:

Relocate:

Copy:

Move to ASM:

Check out our series on non-disruptive DR drills for Oracle:

Part 1 :  Configure ActiveDR and protect your DB volumes (why and how)
Part 2:  Accessing the DB volumes at the DR site and opening the database
Part 3 :  Non-disruptive DR drills with some simple scripting
Part 4 :  Controlled and emergency failovers/failbacks

Written By: