Oracle 12.1 SE2
Oracle Linux 6
Background:
I have a series of test databases for which I periodically (on demand from app support person) take an rman archival backup ... a backup with a KEEP UNTIL spec. This is done as an offline backup, with the database in MOUNT status.
Said databases also are periodically 'refreshed', with rman DUPLICATE DATABASE using the production db as the target (source). As a result, the 'current' test db may very well have a different dbid from the backup. To help manage this, I have a 'dummy' init.ora file ('initdummy.ora'). I will start this dummy instance in nomount, then connect with rman and issue SET DBID to the dbid of the backup I want to deal with.
Now the odd observation. I was doing some disk houskeeping and noticed some very old rman backup files, so went to investigate if rman still knew anything about them.
First, check for all registered 'versions' (dbid) of the given db:
oracle:dummy$ sqlplus rman@rmcat
SQL*Plus: Release 12.1.0.2.0 Production on Wed Mar 14 08:02:17 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
Last Successful login time: Wed Mar 14 2018 07:40:18 -05:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> select name, dbid from rc_database
2 where name='FS91DEV'
3 order by dbid;
NAME DBID
-------- ----------
FS91DEV 449081549
FS91DEV 495463969
FS91DEV 549706176
Next, start my dummy instance, and use that as the target, and list backups for each dbid in turn
oracle:dummy$ echo $ORACLE_SID
dummy
oracle:dummy$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Wed Mar 14 08:06:15 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 402653184 bytes
Fixed Size 2924832 bytes
Variable Size 327159520 bytes
Database Buffers 67108864 bytes
Redo Buffers 5459968 bytes
SQL> exit
Disconnected from Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
2018-03-14 08:07:56
oracle:dummy$ rman target / catalog rman/****@rmcat
Recovery Manager: Release 12.1.0.2.0 - Production on Wed Mar 14 08:08:14 2018
Copyright (c) 1982, 2015, Oracle and/or its affiliates. All rights reserved.
connected to target database: DUMMY (not mounted)
connected to recovery catalog database
RMAN> set dbid 449081549
executing command: SET DBID
database name is "FS91DEV" and DBID is 449081549
RMAN> list backup;
specification does not match any backup in the repository
RMAN> set dbid 495463969
executing command: SET DBID
database name is "FS91DEV" and DBID is 495463969
RMAN> list backup;
specification does not match any backup in the repository
RMAN> set dbid 549706176
executing command: SET DBID
database name is "FS91DEV" and DBID is 549706176
RMAN> list backup;
specification does not match any backup in the repository
Now, that last dbid (549706176) is the dbid of the current "incarnation" (using the term generically) of the database, so let's set ORACLE_SID for that, and connect with rman:
RMAN> exit
Recovery Manager complete.
2018-03-14 08:12:18
oracle:dummy$ . oraenv
ORACLE_SID = [dummy] ? fs91dev
The Oracle base remains unchanged with value /u01/app/oracle
2018-03-14 08:12:31
oracle:fs91dev$ rman target / catalog rman/cat@rmcat
Recovery Manager: Release 12.1.0.2.0 - Production on Wed Mar 14 08:12:47 2018
Copyright (c) 1982, 2015, Oracle and/or its affiliates. All rights reserved.
connected to target database: FS91DEV (DBID=549706176)
connected to recovery catalog database
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ --------------------
137065674 Full 17.02M DISK 00:00:00 20-Oct-2017 15:06:18
BP Key: 137065676 Status: AVAILABLE Compressed: NO Tag: TAG20171020T150618
Piece Name: /backup/fs91dev/FS91DEV_c-549706176-20171020-00_ctl.backup
SPFILE Included: Modification time: 20-Oct-2017 13:48:02
SPFILE db_unique_name: FS91DEV
Control File Included: Ckp SCN: 61459050649 Ckp time: 20-Oct-2017 13:47:51
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ --------------------
137292036 Full 10.52G DISK 00:21:35 21-Feb-2018 09:42:42
Keep: NOLOGS Until: 22-May-2018 09:21:06
<snip remainder of report>
So I don't understand why this backup wasn't reported when connected to the dummy instance but with the DBID set for the database that this backup is from. Is it because when connected to the dummy, there is no control file repository? That makes sense on the face of it. However, when I do maintenance on these archival backups (modifying the KEEP UNTIL date, and possibly deleting obsolete), there doesn't seem to be any issue with that.