change backup … for db_unique_name 可以改变备份集所属的db_unique_name,但oracle官方文档里面没有说会不会同步到db_unique_name对应的数据库的control file。我自己测试发现不会同步到control file。
RMAN> change backup tag='DBACKUP3_20200908_204238' for db_unique_name orcl1by reset db_unique_name to orcl; change backup piece db_unique_name backup piece handle=/mnt/iscsi_disk/ip-192.168.87.155-3260-iscsi-iqn.2020-09.com.scutech-119418-lun-1-part1/ORCL_1461820645_MERGE_20200908_204238_191_1050612298_1 RECID=181 STAMP=1050612298 change backup piece db_unique_name backup piece handle=/mnt/iscsi_disk/ip-192.168.87.155-3260-iscsi-iqn.2020-09.com.scutech-119418-lun-1-part1/ORCL_1461820645_MERGE_20200908_204238_195_1050612300_1 RECID=182 STAMP=1050612300 change backup piece db_unique_name backup piece handle=ORCL_1461820645_LOG_20200908_204238_196_1050612308_1 RECID=183 STAMP=1050612308 change backup piece db_unique_name backup piece handle=ORCL_1461820645_CTL_20200908_204238_197_1050612311_1 RECID=184 STAMP=1050612312 Changed 4 objects db_unique_name RMAN> list backup summary for db_unique_name 'orcl1by'; List of Backups for database with db_unique_name ORCL1BY =============== Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag ------- -- -- - ----------- -------------------- ------- ------- ---------- --- 3760 B A A SBT_TAPE Sep 08 2020 20:02:20 1 1 NO TAG20200908T200220 3761 B F A SBT_TAPE Sep 08 2020 20:02:49 1 1 NO TAG20200908T200221 3762 B F A SBT_TAPE Sep 08 2020 20:03:07 1 1 NO TAG20200908T200221 3763 B F A SBT_TAPE Sep 08 2020 20:03:17 1 1 NO TAG20200908T200221 3764 B F A SBT_TAPE Sep 08 2020 20:03:20 1 1 NO TAG20200908T200221 3765 B A A SBT_TAPE Sep 08 2020 20:04:16 1 1 NO TAG20200908T200416 3766 B A A SBT_TAPE Sep 08 2020 20:05:21 1 1 NO TAG20200908T200521 3767 B F A SBT_TAPE Sep 08 2020 20:05:51 1 1 NO TAG20200908T200522 3768 B F A SBT_TAPE Sep 08 2020 20:06:08 1 1 NO TAG20200908T200522 3769 B F A SBT_TAPE Sep 08 2020 20:06:18 1 1 NO TAG20200908T200522 3770 B F A SBT_TAPE Sep 08 2020 20:06:21 1 1 NO TAG20200908T200522 3771 B A A SBT_TAPE Sep 08 2020 20:06:24 1 1 NO TAG20200908T200623 RMAN> list backup summary for db_unique_name 'orcl'; List of Backups for database with db_unique_name ORCL =============== Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag ------- -- -- - ----------- -------------------- ------- ------- ---------- --- 3772 B 1 A DISK Sep 08 2020 20:44:59 1 1 NO DBACKUP3_20200908_204238 3773 B 1 A DISK Sep 08 2020 20:45:00 1 1 NO DBACKUP3_20200908_204238 3774 B A A SBT_TAPE Sep 08 2020 20:45:08 1 1 NO DBACKUP3_20200908_204238 3775 B F A SBT_TAPE Sep 08 2020 20:45:12 1 1 NO DBACKUP3_20200908_204238
把备库的备份集改成主库的,成功了!从主库登录,如果不连接catalog,查不到。RESYNC CATALOG 也没有用!
[oracle@dg121-1 ~]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Wed Sep 9 10:57:12 2020 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID=1461820645) RMAN> list backup summary ; using target database control file instead of recovery catalog specification does not match any backup in the repository