﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>FranklinFaces.com - Oracle &amp; SQL Server Database Forums for all IT Professionals / Oracle Forum / Oracle Database Administration  / Moving Datafiles between diskgroups in ASM / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>FranklinFaces.com - Oracle &amp; SQL Server Database Forums for all IT Professionals</description><link>http://www.franklinfaces.com/</link><webMaster>no-reply@FranklinFaces.com</webMaster><lastBuildDate>Fri, 10 Feb 2012 23:33:34 GMT</lastBuildDate><ttl>20</ttl><item><title>Moving Datafiles between diskgroups in ASM</title><link>http://www.franklinfaces.com/Topic104-97-1.aspx</link><description>&lt;FONT color=#115555&gt;&lt;STRONG&gt;You can follow these steps to move datafiles between diskgroups in a database that is using ASM.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#115555&gt;I'll show you the steps for the system related tablespaces:  System, UNDO, sysaux etc..&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#115555&gt;The reason for this is because with the other tablespace you can put them offline and use rman to copy and then bring them online.   With SYSTEM/SYSAUX etc..  it's difficult to bring them offline.   So let's begin:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#115555&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;&lt;FONT color=#115555&gt;&lt;STRONG&gt;Here are the files that I would like to have moved to diskgroup called : +SHARED_DATA_DG03 .  Currently they are on diskgroup +SHARED_DATA_DG01.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#115555&gt;&lt;P&gt;&lt;BR&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;col file_name format a65&lt;/EM&gt;&lt;/FONT&gt;&lt;BR&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;col member format a65&lt;/EM&gt;&lt;/FONT&gt;&lt;BR&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;select file_name from dba_data_files;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;FILE_NAME&lt;BR&gt;-----------------------------------------------------------------&lt;BR&gt;+SHARED_DATA_DG01/PRODDB/datafile/system.260.681144809&lt;BR&gt;+SHARED_DATA_DG01/PRODDB/datafile/undotbs1.261.681144817&lt;BR&gt;+SHARED_DATA_DG01/PRODDB/datafile/sysaux.262.681144821&lt;BR&gt;+SHARED_DATA_DG01/PRODDB/datafile/tools.264.681144827&lt;BR&gt;+SHARED_DATA_DG01/PRODDB/datafile/users.265.681144827&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#115555&gt;&lt;STRONG&gt;I've already brought the database down using shutdown immediate command.  Now, I'm going to bring it back up using mount.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#115555&gt;&lt;P&gt;&lt;BR&gt;prdadminsrv01 [PRODDB]-&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;sqlplus '/ as sysdba'&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;SQL*Plus: Release 10.2.0.3.0 - Production on Wed Mar 11 16:33:49 2009&lt;/P&gt;&lt;P&gt;Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.&lt;/P&gt;&lt;P&gt;&lt;BR&gt;Connected to:&lt;BR&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production&lt;BR&gt;With the Partitioning and Data Mining options&lt;/P&gt;&lt;P&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;startup mount;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR&gt;ORACLE instance started.&lt;/P&gt;&lt;P&gt;Total System Global Area 1.6106E+10 bytes&lt;BR&gt;Fixed Size                  2402240 bytes&lt;BR&gt;Variable Size            2843793472 bytes&lt;BR&gt;Database Buffers         1.3237E+10 bytes&lt;BR&gt;Redo Buffers               22708224 bytes&lt;BR&gt;Database mounted.&lt;BR&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;exit&lt;BR&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#115555&gt;&lt;STRONG&gt;Now I'm going into rman to copy the datafiles.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;prdadminsrv01 [PRODDB]-&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;rman&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#115555&gt;&lt;P&gt;&lt;BR&gt;Recovery Manager: Release 10.2.0.3.0 - Production on Wed Mar 11 16:31:03 2009&lt;/P&gt;&lt;P&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;/P&gt;&lt;P&gt;RMAN&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;connect target /&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;connected to target database: PRODDB (DBID=3179283874, not open)&lt;/P&gt;&lt;P&gt;RMAN&amp;gt;&lt;/P&gt;&lt;P&gt;RMAN&amp;gt; &lt;EM&gt;&lt;FONT color=#1111dd&gt;copy datafile '+SHARED_DATA_DG01/PRODDB/datafile/system.260.681144809' to '+SHARED_DATA_DG03';&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Starting backup at 11-MAR-2009 16:32:24&lt;BR&gt;using target database control file instead of recovery catalog&lt;BR&gt;allocated channel: ORA_DISK_1&lt;BR&gt;channel ORA_DISK_1: sid=71 devtype=DISK&lt;BR&gt;channel ORA_DISK_1: starting datafile copy&lt;BR&gt;input datafile fno=00001 name=+SHARED_DATA_DG01/PRODDB/datafile/system.260.681144809&lt;BR&gt;output filename=+SHARED_DATA_DG03/PRODDB/datafile/system.265.681237145 tag=TAG20090311T163225 recid=1 stamp=681237155&lt;BR&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15&lt;BR&gt;Finished backup at 11-MAR-2009 16:32:40&lt;/P&gt;&lt;P&gt;RMAN&amp;gt; &lt;EM&gt;&lt;FONT color=#3333dd&gt;copy datafile '+SHARED_DATA_DG01/PRODDB/datafile/undotbs1.261.681144817' to '+SHARED_DATA_DG03';&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Starting backup at 11-MAR-2009 16:32:42&lt;BR&gt;using channel ORA_DISK_1&lt;BR&gt;channel ORA_DISK_1: starting datafile copy&lt;BR&gt;input datafile fno=00002 name=+SHARED_DATA_DG01/PRODDB/datafile/undotbs1.261.681144817&lt;BR&gt;output filename=+SHARED_DATA_DG03/PRODDB/datafile/undotbs1.266.681237163 tag=TAG20090311T163243 recid=2 stamp=681237176&lt;BR&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15&lt;BR&gt;Finished backup at 11-MAR-2009 16:32:58&lt;/P&gt;&lt;P&gt;RMAN&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;copy datafile '+SHARED_DATA_DG01/PRODDB/datafile/sysaux.262.681144821' to '+SHARED_DATA_DG03';&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Starting backup at 11-MAR-2009 16:33:02&lt;BR&gt;using channel ORA_DISK_1&lt;BR&gt;channel ORA_DISK_1: starting datafile copy&lt;BR&gt;input datafile fno=00003 name=+SHARED_DATA_DG01/PRODDB/datafile/sysaux.262.681144821&lt;BR&gt;output filename=+SHARED_DATA_DG03/PRODDB/datafile/sysaux.267.681237183 tag=TAG20090311T163302 recid=3 stamp=681237193&lt;BR&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15&lt;BR&gt;Finished backup at 11-MAR-2009 16:33:18&lt;/P&gt;&lt;P&gt;RMAN&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;copy datafile '+SHARED_DATA_DG01/PRODDB/datafile/tools.264.681144827' to '+SHARED_DATA_DG03';&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Starting backup at 11-MAR-2009 16:33:20&lt;BR&gt;using channel ORA_DISK_1&lt;BR&gt;channel ORA_DISK_1: starting datafile copy&lt;BR&gt;input datafile fno=00004 name=+SHARED_DATA_DG01/PRODDB/datafile/tools.264.681144827&lt;BR&gt;output filename=+SHARED_DATA_DG03/PRODDB/datafile/tools.268.681237201 tag=TAG20090311T163320 recid=4 stamp=681237203&lt;BR&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07&lt;BR&gt;Finished backup at 11-MAR-2009 16:33:27&lt;/P&gt;&lt;P&gt;RMAN&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;copy datafile '+SHARED_DATA_DG01/PRODDB/datafile/users.265.681144827' to '+SHARED_DATA_DG03';&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Starting backup at 11-MAR-2009 16:33:30&lt;BR&gt;using channel ORA_DISK_1&lt;BR&gt;channel ORA_DISK_1: starting datafile copy&lt;BR&gt;input datafile fno=00005 name=+SHARED_DATA_DG01/PRODDB/datafile/users.265.681144827&lt;BR&gt;output filename=+SHARED_DATA_DG03/PRODDB/datafile/users.269.681237211 tag=TAG20090311T163330 recid=5 stamp=681237211&lt;BR&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03&lt;BR&gt;Finished backup at 11-MAR-2009 16:33:33&lt;/P&gt;&lt;P&gt;RMAN&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;exit&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR&gt;Recovery Manager complete.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#115555&gt;&lt;STRONG&gt;The next step is to issue the rename command to rename the files.   This step you have to becareful because if you look at the rman command above, you will notice that rman gave a new name to the file.  Look at the output filename= part and you will see that each datafile is given a new name.  This is because I let oracle manage my files.   Here is the step to rename the file.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#115555&gt;&lt;P&gt;&lt;BR&gt;prdadminsrv01 [PRODDB]-&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;sqlplus '/ as sysdba'&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;SQL*Plus: Release 10.2.0.3.0 - Production on Wed Mar 11 16:33:49 2009&lt;/P&gt;&lt;P&gt;Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.&lt;/P&gt;&lt;P&gt;&lt;BR&gt;Connected to:&lt;BR&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production&lt;BR&gt;With the Partitioning and Data Mining options&lt;/P&gt;&lt;P&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;alter database rename file '+SHARED_DATA_DG01/PRODDB/datafile/system.260.681144809' to '+SHARED_DATA_DG03/PRODDB/datafile/system.265.681237145';&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Database altered.&lt;/P&gt;&lt;P&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;alter database rename file '+SHARED_DATA_DG01/PRODDB/datafile/undotbs1.261.681144817' to '+SHARED_DATA_DG03/PRODDB/datafile/undotbs1.266.681237163';&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Database altered.&lt;/P&gt;&lt;P&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;alter database rename file '+SHARED_DATA_DG01/PRODDB/datafile/sysaux.262.681144821' to '+SHARED_DATA_DG03/PRODDB/datafile/sysaux.267.681237183';&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Database altered.&lt;/P&gt;&lt;P&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;alter database rename file '+SHARED_DATA_DG01/PRODDB/datafile/tools.264.681144827' to '+SHARED_DATA_DG03/PRODDB/datafile/tools.268.681237201';&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Database altered.&lt;/P&gt;&lt;P&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;alter database rename file '+SHARED_DATA_DG01/PRODDB/datafile/users.265.681144827' to '+SHARED_DATA_DG03/PRODDB/datafile/users.269.681237211';&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Database altered.&lt;/P&gt;&lt;P&gt;SQL&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color=#115555&gt;That's pretty much it.  You can open your database now.&lt;/FONT&gt;   &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;alter database open;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Database altered.&lt;/P&gt;&lt;P&gt;&lt;BR&gt;SQL&amp;gt; &lt;FONT color=#3333dd&gt;&lt;EM&gt;select file_name from dba_data_files;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;FILE_NAME&lt;BR&gt;--------------------------------------------------------------------------------&lt;BR&gt;+SHARED_DATA_DG03/PRODDB/datafile/system.265.681237145&lt;BR&gt;+SHARED_DATA_DG03/PRODDB/datafile/undotbs1.266.681237163&lt;BR&gt;+SHARED_DATA_DG03/PRODDB/datafile/sysaux.267.681237183&lt;BR&gt;+SHARED_DATA_DG03/PRODDB/datafile/tools.268.681237201&lt;BR&gt;+SHARED_DATA_DG03/PRODDB/datafile/users.269.681237211&lt;/P&gt;&lt;P&gt;&lt;FONT color=#115555&gt;&lt;STRONG&gt;Hope you found this useful.   There are many other ways that can be done.  If you have done it differently feel free to share it with others.&lt;/STRONG&gt;&lt;/FONT&gt;   &lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;BR&gt; &lt;/P&gt;&lt;P&gt;&lt;/FONT&gt; </description><pubDate>Fri, 13 Mar 2009 11:27:04 GMT</pubDate><dc:creator>Admin</dc:creator></item></channel></rss>
