How to Move PDB datafiles to ASM Disk Group
Moving PDB related data files to ASM diskgroup.
PDB name: FUAT
CDB name: funcdb
The PDB will be moved to a ASM disk group called EBS_PDB.
1. Run a RMAN backup as copy to create data files copies in the destination diskgroup.
RMAN> backup as copy pluggable database FUAT format '+EBS_PDB';
Starting backup at 22-MAR-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=141 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=877 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=13 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=137 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00045 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/system.301.1063988727
channel ORA_DISK_2: starting datafile copy
input datafile file number=00046 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/sysaux.300.1063988727
channel ORA_DISK_3: starting datafile copy
input datafile file number=00047 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/undotbs1.299.1063988727
channel ORA_DISK_4: starting datafile copy
input datafile file number=00049 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/oradbaudit.304.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/sysaux.257.1063989107 tag=TAG20210208T163145 RECID=1 STAMP=1063989121
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_2: starting datafile copy
input datafile file number=00050 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/box.303.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/system.256.1063989107 tag=TAG20210208T163145 RECID=3 STAMP=1063989121
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:16
channel ORA_DISK_1: starting datafile copy
input datafile file number=00051 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/lobs.306.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/box.260.1063989121 tag=TAG20210208T163145 RECID=5 STAMP=1063989122
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_2: starting datafile copy
input datafile file number=00052 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/indexes.309.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/undotbs1.258.1063989111 tag=TAG20210208T163145 RECID=4 STAMP=1063989121
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:00:16
channel ORA_DISK_3: starting datafile copy
input datafile file number=00053 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/repos.308.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/oradbaudit.259.1063989117 tag=TAG20210208T163145 RECID=2 STAMP=1063989121
channel ORA_DISK_4: datafile copy complete, elapsed time: 00:00:18
channel ORA_DISK_4: starting datafile copy
input datafile file number=00054 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/audits.307.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/lobs.261.1063989123 tag=TAG20210208T163145 RECID=6 STAMP=1063989124
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting datafile copy
input datafile file number=00055 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/audindexes.310.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/indexes.262.1063989123 tag=TAG20210208T163145 RECID=7 STAMP=1063989124
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_2: starting datafile copy
input datafile file number=00056 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/audlobs.282.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/repos.263.1063989125 tag=TAG20210208T163145 RECID=8 STAMP=1063989125
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_3: starting datafile copy
input datafile file number=00057 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/tbs.280.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/audits.264.1063989125 tag=TAG20210208T163145 RECID=9 STAMP=1063989125
channel ORA_DISK_4: datafile copy complete, elapsed time: 00:00:02
channel ORA_DISK_4: starting datafile copy
input datafile file number=00058 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/cheindexes.281.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/audindexes.265.1063989125 tag=TAG20210208T163145 RECID=10 STAMP=1063989127
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting datafile copy
input datafile file number=00059 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/abs.283.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/audlobs.266.1063989127 tag=TAG20210208T163145 RECID=11 STAMP=1063989127
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_2: starting datafile copy
input datafile file number=00060 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/nstbs.297.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/tbs.267.1063989127 tag=TAG20210208T163145 RECID=12 STAMP=1063989128
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_3: starting datafile copy
input datafile file number=00061 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/lkstbs.298.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/cheindexes.268.1063989129 tag=TAG20210208T163145 RECID=13 STAMP=1063989129
channel ORA_DISK_4: datafile copy complete, elapsed time: 00:00:02
channel ORA_DISK_4: starting datafile copy
input datafile file number=00048 name=+DATA/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/users.305.1063988727
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/abs.269.1063989129 tag=TAG20210208T163145 RECID=14 STAMP=1063989129
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:02
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/nstbs.270.1063989129 tag=TAG20210208T163145 RECID=15 STAMP=1063989130
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:02
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/lkstbs.271.1063989131 tag=TAG20210208T163145 RECID=16 STAMP=1063989131
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:00:02
output file name=+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/users.272.1063989131 tag=TAG20210208T163145 RECID=17 STAMP=1063989131
channel ORA_DISK_4: datafile copy complete, elapsed time: 00:00:01
Finished backup at 22-MAR-22
Starting Control File and SPFILE Autobackup at 22-MAR-22
piece handle=+FRA/FUNCDB/AUTOBACKUP/2021_02_08/s_1063989132.284.1063989133 comment=NONE
Finished Control File and SPFILE Autobackup at 22-MAR-22
2. As system tablespaces are also moved the switch to new location cannot be done while PDB is open.
RMAN> alter pluggable database fuat close;
Statement processed
Disconnect RMAN and in new RMAN session do below
RMAN> switch pluggable database fuat to copy;
datafile 45 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/system.256.1063989107"
datafile 46 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/sysaux.257.1063989107"
datafile 47 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/undotbs1.258.1063989111"
datafile 48 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/users.272.1063989131"
datafile 49 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/oradbaudit.259.1063989117"
datafile 50 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/box.260.1063989121"
datafile 51 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/lobs.261.1063989123"
datafile 52 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/indexes.262.1063989123"
datafile 53 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/repos.263.1063989125"
datafile 54 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/audits.264.1063989125"
datafile 55 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/audindexes.265.1063989125"
datafile 56 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/audlobs.266.1063989127"
datafile 57 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/tbs.267.1063989127"
datafile 58 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/cheindexes.268.1063989129"
datafile 59 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/abs.269.1063989129"
datafile 60 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/nstbs.270.1063989129"
datafile 61 switched to datafile copy "+PDBDG/FUNCDB/9CBA2DF91A8C7012E053F4071FAC36E9/DATAFILE/lkstbs.271.1063989131"
3. Recover the PDB
RMAN> recover pluggable database fuat;
Starting recover at 22-MAR-22
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 22-MAR-22
4. Open the PDB
RMAN> alter pluggable database fuat open;
Statement processed
Post a Comment
Post a Comment