{"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_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[133],"tags":[],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-oracledb"],"acf":[],"jetpack-related-posts":[{"id":426,"url":"https:\/\/bijoos.com\/oraclenotes\/2014\/426\/","url_meta":{"origin":119,"position":0},"title":"Oracle Tidbits &#8211; June 2014","author":"Biju","date":"June 30, 2014","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d published at\u00a0https:\/\/www.facebook.com\/oraclenotes\u00a0on all weekdays\u00a0in June\u00a02014. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 TidBit Topic In Oracle Database 12c, the Pre-Upgrade Information Tool script is preupgrd.sql (meaningfully named). Earlier release pre-upgrade\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":393,"url":"https:\/\/bijoos.com\/oraclenotes\/2014\/393\/","url_meta":{"origin":119,"position":1},"title":"OracleNotes TidBits &#8211; May 2014","author":"Biju","date":"May 31, 2014","format":false,"excerpt":"According to the dictionary, meaning of \"tidbit\" is \"a small and particularly interesting item of gossip or information\"... hope you find the \"Oracle TidBits\" published at https:\/\/www.facebook.com\/oraclenotes\u00a0interesting... Here is a compilation of the tidbits published in May 2014. You will also see these tidbits, one tidbit at a time, for\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"Oracle TidBit","src":"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2014\/05\/TidBit-300x123.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2087,"url":"https:\/\/bijoos.com\/oraclenotes\/2017\/2087\/","url_meta":{"origin":119,"position":2},"title":"Oracle Tidbits &#8211; August 2017 #oratidbit","author":"Biju","date":"September 3, 2017","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d (#oratidbit) published on Facebook, Twitter, and Google+\u00a0during weekdays\u00a0in August 2017. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 Hope you find these helpful to learn something new or to remind you\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2017\/02\/oratidbit.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":190,"url":"https:\/\/bijoos.com\/oraclenotes\/2013\/190\/","url_meta":{"origin":119,"position":3},"title":"OracleDB12c New Feature: ASMCMD Commands for Password File Management","author":"Biju","date":"July 16, 2013","format":false,"excerpt":"Starting with Oracle Database 12c, we can store the ASM and Database password file on ASM storage. This is helpful for RAC databases and cluster as we do not have to manage to keep the files in sync between servers. ASMCMD in 12c includes several commands to manage password file.\u2026","rel":"","context":"In &quot;Oracle Database&quot;","block_context":{"text":"Oracle Database","link":"https:\/\/bijoos.com\/oraclenotes\/category\/oracledb\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2374,"url":"https:\/\/bijoos.com\/oraclenotes\/2018\/2374\/","url_meta":{"origin":119,"position":4},"title":"Oracle Tidbits &#8211; December 2018 #oratidbit","author":"biju.thomas","date":"December 31, 2018","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d (#oratidbit) published on\u00a0\u00a0Facebook,\u00a0Twitter,\u00a0and\u00a0Google+\u00a0during weekdays\u00a0in December 2018. The list is short as there were no #oratidbit during the Christmas holidays. Hope you find these helpful to learn something new or to remind you of its existence and use. HAPPY NEW YEAR 2019! #oratidbit #orcldb When you move the\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2018\/04\/oratidbit.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":186,"url":"https:\/\/bijoos.com\/oraclenotes\/2013\/186\/","url_meta":{"origin":119,"position":5},"title":"OracleDB12c New Feature: Password File in ASM","author":"Biju","date":"July 15, 2013","format":false,"excerpt":"Prior to Oracle Database 12c, the password file always was located under $ORACLE_HOME\/dbs directory, even for RAC instances and for RAC ASM cluster. DBA had to manage and keep in sync the password file in each node. In 12c, now the password file can be stored on ASM instance and\u2026","rel":"","context":"In &quot;Oracle Database&quot;","block_context":{"text":"Oracle Database","link":"https:\/\/bijoos.com\/oraclenotes\/category\/oracledb\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_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}]}}