Professional Documents
Culture Documents
Copy Datafile Local To ASM
Copy Datafile Local To ASM
Copy Datafile Local To ASM
****************************************************************
Example:
alter tablespace DHCP_DATA_2015_03_23 add datafile ' +PLMTPRDATA' size 1G a
utoextend on next 256m maxsize 30G;===>space before DG name.
alter tablespace DHCP_DATA_2015_03_23 add datafile 'PLMTPRDATA' size 1G aut
oextend on next 256m maxsize 30G;===>"+" missed in DG name.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++
Bring the datafile offline.
***************************
SQL> alter database datafile 59 offline;
Database altered.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++
Copy the datafile from Local to ASM through rman and switch it.
***************************************************************
RMAN> copy datafile "/u01/app/oracle/product/11.2.0.3/db1/dbs/ +PLMTPRDATA" to "
+PLMTPRDATA";
Starting backup at 23-MAR-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1360 instance=plmtpr2 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00059 name=/u01/app/oracle/product/11.2.0.3/db1/dbs/
+PLMTPRDATA
output file name=+PLMTPRDATA/plmtpr/datafile/dhcp_data_2015_03_23.713.875125527
tag=TAG20150323T182527 RECID=9 STAMP=875125532
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 23-MAR-15
RMAN> switch datafile 59 to copy;
datafile 59 switched to datafile copy "+PLMTPRDATA/plmtpr/datafile/dhcp_data_201
5_03_23.713.875125527"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++
Recover the datafile.
*********************
RMAN> run
{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
recover datafile 59;
}2> 3> 4> 5> 6>
allocated channel: c1
channel c1: SID=593 instance=plmtpr2 device type=DISK
allocated channel: c2
channel c2: SID=1246 instance=plmtpr2 device type=DISK
Starting recover at 23-MAR-15
starting media recovery
media recovery complete, elapsed time: 00:00:09
Finished recover at 23-MAR-15
released channel: c1
released channel: c2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++
Bring it back online.
*********************
SQL> alter database datafile 59 online;
Database altered.