When Recovery catalog has been configured.and Production Database has been cloned and a connection has been made from the clone to Catalog database using rman with out changing the DBID of the clone,then we are in some trouble
Then when you try to backup the production instance with the catalog,The backup fails with following error
RMAN-06004: ORACLE error from recovery catalog database
RMAN-20004: target database name does not match name in recovery catalog
Even if you try to list backup from Production database connecting catalog, you will get the error
RMAN> LIST BACKUP; RMAN-00571: ============== RMAN-00569: ======= ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: ========================= RMAN-03002: failure of list command at 11/10/2019 6:22:33 RMAN-06004: ORACLE error from recovery catalog database RMAN-20004: target database name does not match name in recovery catalog
The error RMAN-20004 happens,as clone instance replaces the prod instance in the catalog.
Following queries could be used to confirm this
This will provide PROD DBID
Select dbid,name from v$database ;
This query in catalog will provide the dbid information.It will shows clone registered instead of production with same DBID
Select dbid,name ,DBINC_KEY,RESETLOGS_CHANGE# from rc_database ;
If clone backup are not required in catalog,Do this connect to catalog from clone and fire the command
Then connect to catalog from Production
Hopefully the problem should resolve and you should be able backup the Production database using catalog and use the other RMAN command also.
Please take appropriate backup of catalog before attempting any thing.
If the clone database backup is also required, Please change the DBID of the clone database using NID utility first and then confirm if the DBID has changed in the clone database. Then you can connect with the catalog and take the backup of clone database also . You should not be receiving any errors while taking backup of both the production and clone database. Read about NID utility.
You can read more about RMAN utility at the below links