Skip to content
Home » Oracle Database » Switch Database To Copy

Switch Database To Copy

Move Database by RMAN

In the previous post, we have talked about how to move data files in a tablespace to another place by RMAN. In this post, we'd like to move all data files in a database. Once again, we do it by RMAN.

Make New Directory

Make some necessary directories in the new locations.

[root@test ~]# mkdir -p /oradata/ORCLCDB/ORCLPDB
[root@test ~]# mkdir -p /oradata/ORCLCDB/pdbseed
[root@test ~]# chown -R oracle:oinstall /oradata/

Check Current Data Files Location

SQL> set pagesize 100;
SQL> select name from v$datafile order by 1;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/example01.dbf
/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/sysaux01.dbf
/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/system01.dbf
/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/undotbs01.dbf
/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/users01.dbf
/u01/app/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf
/u01/app/oracle/oradata/ORCLCDB/pdbseed/system01.dbf
/u01/app/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf
/u01/app/oracle/oradata/ORCLCDB/sysaux01.dbf
/u01/app/oracle/oradata/ORCLCDB/system01.dbf
/u01/app/oracle/oradata/ORCLCDB/undotbs01.dbf
/u01/app/oracle/oradata/ORCLCDB/users01.dbf

12 rows selected.

Restart Database to MOUNT

RMAN> shutdown immediate; RMAN> startup mount;

Backup as Copy DB_FILE_NAME_CONVERT Database

We copy all of data files to the new location.

RMAN> backup as copy db_file_name_convert ('/u01/app/oracle/oradata/ORCLCDB/','/oradata/ORCLCDB/') database;

Starting backup at 14-JAN-21
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCLCDB/system01.dbf
output file name=/oradata/ORCLCDB/system01.dbf tag=TAG20210114T015142 RECID=9 STAMP=1061776313
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCLCDB/sysaux01.dbf
output file name=/oradata/ORCLCDB/sysaux01.dbf tag=TAG20210114T015142 RECID=10 STAMP=1061776325
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00010 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/sysaux01.dbf
output file name=/oradata/ORCLCDB/ORCLPDB/sysaux01.dbf tag=TAG20210114T015142 RECID=11 STAMP=1061776336
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf
output file name=/oradata/ORCLCDB/pdbseed/sysaux01.dbf tag=TAG20210114T015142 RECID=12 STAMP=1061776344
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00009 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/system01.dbf
output file name=/oradata/ORCLCDB/ORCLPDB/system01.dbf tag=TAG20210114T015142 RECID=13 STAMP=1061776351
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/system01.dbf
output file name=/oradata/ORCLCDB/pdbseed/system01.dbf tag=TAG20210114T015142 RECID=14 STAMP=1061776358
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCLCDB/undotbs01.dbf
output file name=/oradata/ORCLCDB/undotbs01.dbf tag=TAG20210114T015142 RECID=15 STAMP=1061776364
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00013 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/example01.dbf
output file name=/oradata/ORCLCDB/ORCLPDB/example01.dbf tag=TAG20210114T015142 RECID=16 STAMP=1061776366
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00011 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/undotbs01.dbf
output file name=/oradata/ORCLCDB/ORCLPDB/undotbs01.dbf tag=TAG20210114T015142 RECID=17 STAMP=1061776369
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:04
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=/u01/app/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf
output file name=/oradata/ORCLCDB/pdbseed/undotbs01.dbf tag=TAG20210114T015142 RECID=18 STAMP=1061776372
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCLCDB/users01.dbf
output file name=/oradata/ORCLCDB/users01.dbf tag=TAG20210114T015142 RECID=19 STAMP=1061776374
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00012 name=/u01/app/oracle/oradata/ORCLCDB/ORCLPDB/users01.dbf
output file name=/oradata/ORCLCDB/ORCLPDB/users01.dbf tag=TAG20210114T015142 RECID=20 STAMP=1061776375
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 14-JAN-21

Starting Control File and SPFILE Autobackup at 14-JAN-21
piece handle=/u01/app/oracle/fast_recovery_area/ORCLCDB/autobackup/2021_01_14/o1_mf_s_1061775991_hzztl8sw_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 14-JAN-21

We use DB_FILE_NAME_CONVERT to change the location, but with the same file name.

List Copy of Database

RMAN> list copy of database;

List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time        Sparse
------- ---- - --------------- ---------- --------------- ------
9       1    A 14-JAN-21       2922895    14-JAN-21       NO
        Name: /oradata/ORCLCDB/system01.dbf
        Tag: TAG20210114T015142

10      3    A 14-JAN-21       2922895    14-JAN-21       NO
        Name: /oradata/ORCLCDB/sysaux01.dbf
        Tag: TAG20210114T015142

15      4    A 14-JAN-21       2922895    14-JAN-21       NO
        Name: /oradata/ORCLCDB/undotbs01.dbf
        Tag: TAG20210114T015142

14      5    A 14-JAN-21       2914979    16-DEC-20       NO
        Name: /oradata/ORCLCDB/pdbseed/system01.dbf
        Tag: TAG20210114T015142
        Container ID: 2, PDB Name: PDB$SEED

12      6    A 14-JAN-21       2914979    16-DEC-20       NO
        Name: /oradata/ORCLCDB/pdbseed/sysaux01.dbf
        Tag: TAG20210114T015142
        Container ID: 2, PDB Name: PDB$SEED

19      7    A 14-JAN-21       2922895    14-JAN-21       NO
        Name: /oradata/ORCLCDB/users01.dbf
        Tag: TAG20210114T015142

18      8    A 14-JAN-21       2914979    16-DEC-20       NO
        Name: /oradata/ORCLCDB/pdbseed/undotbs01.dbf
        Tag: TAG20210114T015142
        Container ID: 2, PDB Name: PDB$SEED

13      9    A 14-JAN-21       2918247    16-DEC-20       NO
        Name: /oradata/ORCLCDB/ORCLPDB/system01.dbf
        Tag: TAG20210114T015142
        Container ID: 3, PDB Name: ORCLPDB

11      10   A 14-JAN-21       2918247    16-DEC-20       NO
        Name: /oradata/ORCLCDB/ORCLPDB/sysaux01.dbf
        Tag: TAG20210114T015142
        Container ID: 3, PDB Name: ORCLPDB

17      11   A 14-JAN-21       2918247    16-DEC-20       NO
        Name: /oradata/ORCLCDB/ORCLPDB/undotbs01.dbf
        Tag: TAG20210114T015142
        Container ID: 3, PDB Name: ORCLPDB

20      12   A 14-JAN-21       2918247    16-DEC-20       NO
        Name: /oradata/ORCLCDB/ORCLPDB/users01.dbf
        Tag: TAG20210114T015142
        Container ID: 3, PDB Name: ORCLPDB

16      13   A 14-JAN-21       2918247    16-DEC-20       NO
        Name: /oradata/ORCLCDB/ORCLPDB/example01.dbf
        Tag: TAG20210114T015142
        Container ID: 3, PDB Name: ORCLPDB

Switch Database To Copy

RMAN> switch database to copy;

datafile 1 switched to datafile copy "/oradata/ORCLCDB/system01.dbf"
datafile 3 switched to datafile copy "/oradata/ORCLCDB/sysaux01.dbf"
datafile 4 switched to datafile copy "/oradata/ORCLCDB/undotbs01.dbf"
datafile 5 switched to datafile copy "/oradata/ORCLCDB/pdbseed/system01.dbf"
datafile 6 switched to datafile copy "/oradata/ORCLCDB/pdbseed/sysaux01.dbf"
datafile 7 switched to datafile copy "/oradata/ORCLCDB/users01.dbf"
datafile 8 switched to datafile copy "/oradata/ORCLCDB/pdbseed/undotbs01.dbf"
datafile 9 switched to datafile copy "/oradata/ORCLCDB/ORCLPDB/system01.dbf"
datafile 10 switched to datafile copy "/oradata/ORCLCDB/ORCLPDB/sysaux01.dbf"
datafile 11 switched to datafile copy "/oradata/ORCLCDB/ORCLPDB/undotbs01.dbf"
datafile 12 switched to datafile copy "/oradata/ORCLCDB/ORCLPDB/users01.dbf"
datafile 13 switched to datafile copy "/oradata/ORCLCDB/ORCLPDB/example01.dbf"

Alter Database Open

RMAN> alter database open;

Statement processed

Check Current Data Files Location Again

SQL> select name from v$datafile order by 1;

NAME
--------------------------------------------------------------------------------
/oradata/ORCLCDB/ORCLPDB/example01.dbf
/oradata/ORCLCDB/ORCLPDB/sysaux01.dbf
/oradata/ORCLCDB/ORCLPDB/system01.dbf
/oradata/ORCLCDB/ORCLPDB/undotbs01.dbf
/oradata/ORCLCDB/ORCLPDB/users01.dbf
/oradata/ORCLCDB/pdbseed/sysaux01.dbf
/oradata/ORCLCDB/pdbseed/system01.dbf
/oradata/ORCLCDB/pdbseed/undotbs01.dbf
/oradata/ORCLCDB/sysaux01.dbf
/oradata/ORCLCDB/system01.dbf
/oradata/ORCLCDB/undotbs01.dbf
/oradata/ORCLCDB/users01.dbf

12 rows selected.

RAC Database

Make New Directory

Make some necessary directories in the new locations.

[grid@primary01 ~]$ asmcmd mkdir +DATA/TESTCDB
[grid@primary01 ~]$ asmcmd mkdir +DATA/TESTCDB/ORCLPDB
[grid@primary01 ~]$ asmcmd mkdir +DATA/TESTCDB/pdbseed

Check Current Data Files Location

SQL> set pagesize 100;
SQL> select name from v$datafile order by 1;

NAME
--------------------------------------------------------------------------------
+DATA/ORCLCDB/ORCLPDB/sysaux01.dbf
+DATA/ORCLCDB/ORCLPDB/system01.dbf
+DATA/ORCLCDB/ORCLPDB/system01_i2_undo.dbf
+DATA/ORCLCDB/ORCLPDB/undotbs01.dbf
+DATA/ORCLCDB/ORCLPDB/users01.dbf
+DATA/ORCLCDB/erptbs_1.dbf
+DATA/ORCLCDB/erptbs_2.dbf
+DATA/ORCLCDB/pdbseed/sysaux01.dbf
+DATA/ORCLCDB/pdbseed/system01.dbf
+DATA/ORCLCDB/pdbseed/undotbs01.dbf
+DATA/ORCLCDB/sysaux01.dbf
+DATA/ORCLCDB/system01.dbf
+DATA/ORCLCDB/undotbs01.dbf
+DATA/ORCLCDB/undotbs02.dbf
+DATA/ORCLCDB/users01.dbf

15 rows selected.

Restart Database to MOUNT

[oracle@primary01 ~]$ srvctl stop database -d testcdb
[oracle@primary01 ~]$ srvctl start database -d testcdb -o mount

Backup as Copy DB_FILE_NAME_CONVERT Database

We copy all of data files to the new location. For speeding up the copying, we can raise the degree of parallelism of RMAN channels. This is an optional step.

RMAN> configure device type disk parallelism 4;

Then we take a copy of all data files by RMAN.

RMAN> backup as copy db_file_name_convert ('+DATA/ORCLCDB','+DATA/TESTCDB') database;

Starting backup at 20-JAN-21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=62 instance=TESTCDB1 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=63 instance=TESTCDB1 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=58 instance=TESTCDB1 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=51 instance=TESTCDB1 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/ORCLCDB/system01.dbf
channel ORA_DISK_2: starting datafile copy
input datafile file number=00003 name=+DATA/ORCLCDB/sysaux01.dbf
channel ORA_DISK_3: starting datafile copy
input datafile file number=00011 name=+DATA/ORCLCDB/ORCLPDB/sysaux01.dbf
channel ORA_DISK_4: starting datafile copy
input datafile file number=00006 name=+DATA/ORCLCDB/pdbseed/sysaux01.dbf
output file name=+DATA/TESTCDB/orclpdb/sysaux01.dbf tag=TAG20210120T131015 RECID                                                            =4 STAMP=1062335752
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:05:41
channel ORA_DISK_3: starting datafile copy
input datafile file number=00004 name=+DATA/ORCLCDB/undotbs01.dbf
output file name=+DATA/TESTCDB/pdbseed/sysaux01.dbf tag=TAG20210120T131015 RECID                                                            =5 STAMP=1062335802
channel ORA_DISK_4: datafile copy complete, elapsed time: 00:06:21
channel ORA_DISK_4: starting datafile copy
input datafile file number=00005 name=+DATA/ORCLCDB/pdbseed/system01.dbf
output file name=+DATA/TESTCDB/pdbseed/system01.dbf tag=TAG20210120T131015 RECID=6 STAMP=1062336153
channel ORA_DISK_4: datafile copy complete, elapsed time: 00:05:56
channel ORA_DISK_4: starting datafile copy
input datafile file number=00010 name=+DATA/ORCLCDB/ORCLPDB/system01.dbf
output file name=+DATA/TESTCDB/sysaux01.dbf tag=TAG20210120T131015 RECID=8 STAMP=1062336248
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:13:59
channel ORA_DISK_2: starting datafile copy
input datafile file number=00008 name=+DATA/ORCLCDB/pdbseed/undotbs01.dbf
output file name=+DATA/TESTCDB/undotbs01.dbf tag=TAG20210120T131015 RECID=7 STAMP=1062336246
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:08:07
channel ORA_DISK_3: starting datafile copy
input datafile file number=00012 name=+DATA/ORCLCDB/ORCLPDB/undotbs01.dbf
output file name=+DATA/TESTCDB/pdbseed/undotbs01.dbf tag=TAG20210120T131015 RECID=9 STAMP=1062336406
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:02:33
channel ORA_DISK_2: starting datafile copy
input datafile file number=00013 name=+DATA/ORCLCDB/ORCLPDB/system01_i2_undo.dbf
output file name=+DATA/TESTCDB/orclpdb/undotbs01.dbf tag=TAG20210120T131015 RECID=10 STAMP=1062336422
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:02:39
channel ORA_DISK_3: starting datafile copy
input datafile file number=00009 name=+DATA/ORCLCDB/undotbs02.dbf
output file name=+DATA/TESTCDB/orclpdb/system01_i2_undo.dbf tag=TAG20210120T131015 RECID=13 STAMP=1062336493
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:01:20
channel ORA_DISK_2: starting datafile copy
input datafile file number=00015 name=+DATA/ORCLCDB/erptbs_1.dbf
output file name=+DATA/TESTCDB/undotbs02.dbf tag=TAG20210120T131015 RECID=11 STAMP=1062336489
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:01:07
channel ORA_DISK_3: starting datafile copy
input datafile file number=00016 name=+DATA/ORCLCDB/erptbs_2.dbf
output file name=+DATA/TESTCDB/orclpdb/system01.dbf tag=TAG20210120T131015 RECID=12 STAMP=1062336493
channel ORA_DISK_4: datafile copy complete, elapsed time: 00:05:28
channel ORA_DISK_4: starting datafile copy
input datafile file number=00007 name=+DATA/ORCLCDB/users01.dbf
output file name=+DATA/TESTCDB/erptbs_1.dbf tag=TAG20210120T131015 RECID=14 STAMP=1062336502
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:09
channel ORA_DISK_2: starting datafile copy
input datafile file number=00014 name=+DATA/ORCLCDB/ORCLPDB/users01.dbf
output file name=+DATA/TESTCDB/erptbs_2.dbf tag=TAG20210120T131015 RECID=15 STAMP=1062336502
channel ORA_DISK_3: datafile copy complete, elapsed time: 00:00:09
output file name=+DATA/TESTCDB/users01.dbf tag=TAG20210120T131015 RECID=16 STAMP=1062336505
channel ORA_DISK_4: datafile copy complete, elapsed time: 00:00:08
output file name=+DATA/TESTCDB/orclpdb/users01.dbf tag=TAG20210120T131015 RECID=17 STAMP=1062336511
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:07
output file name=+DATA/TESTCDB/system01.dbf tag=TAG20210120T131015 RECID=18 STAMP=1062336552
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:18:56
Finished backup at 20-JAN-21

Starting Control File and SPFILE Autobackup at 20-JAN-21
piece handle=+DATA/TESTCDB/AUTOBACKUP/2021_01_20/s_1062334847.365.1062336555 comment=NONE
Finished Control File and SPFILE Autobackup at 20-JAN-21

We use DB_FILE_NAME_CONVERT to change the location, but with the same file name.

List Copy of Database

RMAN> list copy of database;

List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time        Sparse
------- ---- - --------------- ---------- --------------- ------
18      1    A 20-JAN-21       3603337    20-JAN-21       NO
        Name: +DATA/TESTCDB/system01.dbf
        Tag: TAG20210120T131015

8       3    A 20-JAN-21       3603337    20-JAN-21       NO
        Name: +DATA/TESTCDB/sysaux01.dbf
        Tag: TAG20210120T131015

7       4    A 20-JAN-21       3603337    20-JAN-21       NO
        Name: +DATA/TESTCDB/undotbs01.dbf
        Tag: TAG20210120T131015

6       5    A 20-JAN-21       2161167    14-OCT-20       NO
        Name: +DATA/TESTCDB/pdbseed/system01.dbf
        Tag: TAG20210120T131015
        Container ID: 2, PDB Name: PDB$SEED

5       6    A 20-JAN-21       2161167    14-OCT-20       NO
        Name: +DATA/TESTCDB/pdbseed/sysaux01.dbf
        Tag: TAG20210120T131015
        Container ID: 2, PDB Name: PDB$SEED

16      7    A 20-JAN-21       3603337    20-JAN-21       NO
        Name: +DATA/TESTCDB/users01.dbf
        Tag: TAG20210120T131015

9       8    A 20-JAN-21       2161167    14-OCT-20       NO
        Name: +DATA/TESTCDB/pdbseed/undotbs01.dbf
        Tag: TAG20210120T131015
        Container ID: 2, PDB Name: PDB$SEED

11      9    A 20-JAN-21       3603337    20-JAN-21       NO
        Name: +DATA/TESTCDB/undotbs02.dbf
        Tag: TAG20210120T131015

12      10   A 20-JAN-21       3603205    20-JAN-21       NO
        Name: +DATA/TESTCDB/orclpdb/system01.dbf
        Tag: TAG20210120T131015
        Container ID: 3, PDB Name: ORCLPDB

4       11   A 20-JAN-21       3603205    20-JAN-21       NO
        Name: +DATA/TESTCDB/orclpdb/sysaux01.dbf
        Tag: TAG20210120T131015
        Container ID: 3, PDB Name: ORCLPDB

10      12   A 20-JAN-21       3603205    20-JAN-21       NO
        Name: +DATA/TESTCDB/orclpdb/undotbs01.dbf
        Tag: TAG20210120T131015
        Container ID: 3, PDB Name: ORCLPDB

13      13   A 20-JAN-21       3603205    20-JAN-21       NO
        Name: +DATA/TESTCDB/orclpdb/system01_i2_undo.dbf
        Tag: TAG20210120T131015
        Container ID: 3, PDB Name: ORCLPDB

17      14   A 20-JAN-21       3603205    20-JAN-21       NO
        Name: +DATA/TESTCDB/orclpdb/users01.dbf
        Tag: TAG20210120T131015
        Container ID: 3, PDB Name: ORCLPDB

14      15   A 20-JAN-21       3603337    20-JAN-21       NO
        Name: +DATA/TESTCDB/erptbs_1.dbf
        Tag: TAG20210120T131015

15      16   A 20-JAN-21       3603337    20-JAN-21       NO
        Name: +DATA/TESTCDB/erptbs_2.dbf
        Tag: TAG20210120T131015

Switch Database To Copy

RMAN> switch database to copy;

datafile 1 switched to datafile copy "+DATA/TESTCDB/system01.dbf"
datafile 3 switched to datafile copy "+DATA/TESTCDB/sysaux01.dbf"
datafile 4 switched to datafile copy "+DATA/TESTCDB/undotbs01.dbf"
datafile 5 switched to datafile copy "+DATA/TESTCDB/pdbseed/system01.dbf"
datafile 6 switched to datafile copy "+DATA/TESTCDB/pdbseed/sysaux01.dbf"
datafile 7 switched to datafile copy "+DATA/TESTCDB/users01.dbf"
datafile 8 switched to datafile copy "+DATA/TESTCDB/pdbseed/undotbs01.dbf"
datafile 9 switched to datafile copy "+DATA/TESTCDB/undotbs02.dbf"
datafile 10 switched to datafile copy "+DATA/TESTCDB/orclpdb/system01.dbf"
datafile 11 switched to datafile copy "+DATA/TESTCDB/orclpdb/sysaux01.dbf"
datafile 12 switched to datafile copy "+DATA/TESTCDB/orclpdb/undotbs01.dbf"
datafile 13 switched to datafile copy "+DATA/TESTCDB/orclpdb/system01_i2_undo.dbf"
datafile 14 switched to datafile copy "+DATA/TESTCDB/orclpdb/users01.dbf"
datafile 15 switched to datafile copy "+DATA/TESTCDB/erptbs_1.dbf"
datafile 16 switched to datafile copy "+DATA/TESTCDB/erptbs_2.dbf"

Alter Database Open

Node 1
RMAN> alter database open;

Statement processed
Node 2
RMAN> alter database open;

Statement processed

Check Current Data Files Location Again

SQL> select name from v$datafile order by 1;

NAME
--------------------------------------------------------------------------------
+DATA/TESTCDB/erptbs_1.dbf
+DATA/TESTCDB/erptbs_2.dbf
+DATA/TESTCDB/orclpdb/sysaux01.dbf
+DATA/TESTCDB/orclpdb/system01.dbf
+DATA/TESTCDB/orclpdb/system01_i2_undo.dbf
+DATA/TESTCDB/orclpdb/undotbs01.dbf
+DATA/TESTCDB/orclpdb/users01.dbf
+DATA/TESTCDB/pdbseed/sysaux01.dbf
+DATA/TESTCDB/pdbseed/system01.dbf
+DATA/TESTCDB/pdbseed/undotbs01.dbf
+DATA/TESTCDB/sysaux01.dbf
+DATA/TESTCDB/system01.dbf
+DATA/TESTCDB/undotbs01.dbf
+DATA/TESTCDB/undotbs02.dbf
+DATA/TESTCDB/users01.dbf

15 rows selected.

As we can see, all data files are switched to the new destination.

Leave a Reply

Your email address will not be published. Required fields are marked *