{"id":1429,"date":"2015-12-02T17:30:09","date_gmt":"2015-12-02T14:30:09","guid":{"rendered":"http:\/\/www.fatihacar.com\/blog\/?p=1429"},"modified":"2015-12-02T17:32:30","modified_gmt":"2015-12-02T14:32:30","slug":"move-datafiles-of-tablespaces-with-rman-set-newname-in-oracle-11g","status":"publish","type":"post","link":"http:\/\/www.fatihacar.com\/blog\/move-datafiles-of-tablespaces-with-rman-set-newname-in-oracle-11g\/","title":{"rendered":"Move Datafiles Of Tablespaces With RMAN Set Newname in Oracle 11g"},"content":{"rendered":"<p>You can move datafiles of tablespaces. Scenarios can be asm to file system or file system to file system or file system to file system or asm to asm. Below operations show how to move datafiles. You have to take a backup and database has to be archivelog mode before this operations because of that you do restore and recover operation. <\/p>\n<p><strong>Steps<\/strong><\/p>\n<blockquote><p>1 &#8211; Database has to be Archivelog Mode<br \/>\n2 &#8211; Take Full Rman Backup<br \/>\n3 &#8211; Execute Rman Run block<\/p>\n<p><strong>Run Block Description:<\/strong><br \/>\nOffline Tablespace.<br \/>\nSet Newname.<br \/>\nRestore Datafile To New Location.<br \/>\nWrite New Location information to controlfile with switch datafile all.<br \/>\nRecover Datafile.<br \/>\nOnline Tablespace.<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.fatihacar.com\/blog\/resimler\/articleIcon-300x158.jpg\" alt=\"articleIcon\" width=\"300\" height=\"158\" class=\"aligncenter size-medium wp-image-1430\" \/><\/p>\n<p><strong>List Tablespaces<\/strong><\/p>\n<blockquote><p>\nSQL> select tablespace_name from dba_tablespaces;\n<\/p><\/blockquote>\n<p><strong>List Datafile Directories<\/strong><\/p>\n<blockquote><p>\nSQL> select tablespace_name,file_name from dba_data_files;\n<\/p><\/blockquote>\n<p><strong>Move Datafile From Asm To File System<\/strong><\/p>\n<blockquote>\n<p>RMAN> RUN {<br \/>\nSQL &#8216;ALTER TABLESPACE USERS OFFLINE IMMEDIATE&#8217;;<br \/>\nSET NEWNAME FOR DATAFILE &#8216;+DATA\/dg\/datafile\/USERS.329.896267113&#8217; TO &#8216;\/tmp\/USERS.329.896267113&#8217;;<br \/>\nRESTORE TABLESPACE USERS;<br \/>\nSWITCH DATAFILE ALL;<br \/>\nRECOVER TABLESPACE USERS;<br \/>\nSQL &#8216;ALTER TABLESPACE USERS ONLINE&#8217;;<br \/>\n}\n<\/p><\/blockquote>\n<p><strong>Move Datafile From File System To From Asm<\/strong><br \/>\n<!--more--><\/p>\n<blockquote>\n<p>RMAN> RUN {<br \/>\nSQL &#8216;ALTER TABLESPACE USERS OFFLINE IMMEDIATE&#8217;;<br \/>\nSET NEWNAME FOR DATAFILE &#8216;\/tmp\/USERS.329.896267113&#8217; TO &#8216;+DATA\/dg\/datafile\/USERS.329.896267113&#8217;;<br \/>\nRESTORE TABLESPACE USERS;<br \/>\nSWITCH DATAFILE ALL;<br \/>\nRECOVER TABLESPACE USERS;<br \/>\nSQL &#8216;ALTER TABLESPACE USERS ONLINE&#8217;;<br \/>\n}\n<\/p><\/blockquote>\n<p>ASM to ASM and File System to File System operations are the same above operations.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can move datafiles of tablespaces. Scenarios can be asm to file system or file system to file system or file system to file system or asm to asm. Below operations show how to move datafiles. You have to take a backup and database has to be archivelog mode before this operations because of that&#8230;<\/p>\n","protected":false},"author":37,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"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":[9,20],"tags":[14,90,32,49,48,102],"class_list":["post-1429","post","type-post","status-publish","format-standard","hentry","category-administration","category-oracle-backup-and-recovery","tag-database-administration","tag-oracle","tag-oracle-administration","tag-oracle-backup-and-restore","tag-oracle-rman-backup","tag-oracle-rman-restore"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p39NFI-n3","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/1429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/comments?post=1429"}],"version-history":[{"count":2,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/1429\/revisions"}],"predecessor-version":[{"id":1433,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/1429\/revisions\/1433"}],"wp:attachment":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/media?parent=1429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/categories?post=1429"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/tags?post=1429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}