{"id":119,"date":"2013-07-01T12:12:36","date_gmt":"2013-07-01T17:12:36","guid":{"rendered":"https:\/\/bijoos.com\/oraclenotes\/?p=119"},"modified":"2026-02-07T15:35:11","modified_gmt":"2026-02-07T21:35:11","slug":"oracledb12c-new-feature-more-to-online-datafile-move","status":"publish","type":"post","link":"https:\/\/bijoos.com\/oraclenotes\/2013\/119\/","title":{"rendered":"OracleDB12c New Feature: More to Online Datafile Move"},"content":{"rendered":"<p>As we already know, now with Oracle Database 12c, it is easier to move a data file. There is more to it&#8230; Let us see few operations in 11g, and how they all got simplified with Oracle 12c online file move feature&#8230;<\/p>\n<p>1. Rename a file or move a file from one file system to another<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\">Take tablespace offline, thus users\/application cannot access the content.<\/span><\/li>\n<li>Copy the file to new destination using OS commands<\/li>\n<li>Use ALTER DATABASE RENAME FILE &#8216;x&#8217; TO &#8216;y&#8217;;<\/li>\n<li>Make the tablespace online<\/li>\n<\/ul>\n<p>With Oracle Database 12c, all you need to do is one statement, and not worry about data file being inaccessible during the operation.<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\">ALTER DATABASE MOVE DATAFILE &#8216;x&#8217; TO &#8216;y&#8217;;<\/span><\/li>\n<\/ul>\n<p>2. Move a file from one ASM diskgroup to another,\u00a0Move a file from file system to ASM, Move a file from ASM to file system<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\">Take the data file to be moved offline using ALTER DATABASE DATAFILE &#8216;+DG1\/mydb\/datafile\/x1.dbf&#8217; OFFLINE<\/span><\/li>\n<li>Connect to RMAN and perform copy using COPY DATAFILE\u00a0\u00a0&#8216;+DG1\/mydb\/datafile\/x1.dbf&#8217; TO &#8216;+DG2&#8217; \u00a0[Note, if you are copying a non-OMF file, make sure to include full path and file name for the destination].<\/li>\n<li>Find the name of the new file if using OMF by querying DBA_DATA_FILES.<\/li>\n<li>Rename the file using ALTER DATABASE RENAME FILE\u00a0\u00a0&#8216;+DG1\/mydb\/datafile\/x1.dbf&#8217; TO \u00a0&#8216;+DG2\/mydb\/datafile\/x1.dbf&#8217;<\/li>\n<li>Connect to RMAN to switch to the new file using SWITCH DATAFILE\u00a0\u00a0&#8216;+DG1\/mydb\/datafile\/x1.dbf&#8217; TO COPY<\/li>\n<li>Recover the data file to make it consistent using RECOVER DATAFILE\u00a0\u00a0&#8216;+DG2\/mydb\/datafile\/x1.dbf&#8217; TO<\/li>\n<li>Finally, make the file online using ALTER DATABASE DATAFILE\u00a0\u00a0&#8216;+DG2\/mydb\/datafile\/x1.dbf&#8217; ONLINE;<\/li>\n<\/ul>\n<p>With Oracle Database 12c, all you need to do is one statement, and not worry about data file being inaccessible during the operation.<\/p>\n<p><span style=\"text-decoration: underline;\">ASM to ASM<\/span><\/p>\n<ul>\n<li><span style=\"line-height: 13px;\">ALTER DATABASE MOVE DATAFILE\u00a0\u00a0&#8216;+DG1\/mydb\/datafile\/x1.dbf&#8217; TO \u00a0&#8216;+DG2&#8217;;<br \/>\n<\/span><\/li>\n<\/ul>\n<p><span style=\"text-decoration: underline;\">File System to ASM<\/span><\/p>\n<ul>\n<li>ALTER DATABASE MOVE DATAFILE\u00a0\u00a0&#8216;\/u01\/db\/x1.dbf&#8217; TO \u00a0&#8216;+DG2&#8217;;<\/li>\n<\/ul>\n<p><span style=\"text-decoration: underline;\">ASM to File System<\/span><\/p>\n<ul>\n<li>ALTER DATABASE MOVE DATAFILE\u00a0\u00a0&#8216;+DG1\/mydb\/datafile\/x1.dbf&#8217; TO \u00a0&#8216;\/u01\/db1\/x2.dbf&#8221;;<\/li>\n<\/ul>\n<p>The TO clause can be omitted for OMF, where unique data file name will be created on the location specified by DB_CREATE_FILE_DEST.<\/p>\n<p>There are couple of keywords you may use with the MOVE operation.<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\">KEEP does not delete the file from the source location.<\/span><\/li>\n<li>REUSE will overwrite the file, if file with same name exists in the destination location.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As we already know, now with Oracle Database 12c, it is easier to move a data file. There is more to it&#8230; Let us see few operations in 11g, and how they all got simplified with Oracle 12c online file move feature&#8230; 1. Rename a file or move a file from one file system to &#8230; <a title=\"OracleDB12c New Feature: More to Online Datafile Move\" class=\"read-more\" href=\"https:\/\/bijoos.com\/oraclenotes\/2013\/119\/\" aria-label=\"Read more about OracleDB12c New Feature: More to Online Datafile Move\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[133],"tags":[],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-oracledb"],"acf":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/comments?post=119"}],"version-history":[{"count":1,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":3037,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/119\/revisions\/3037"}],"wp:attachment":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}