ora-07217 / rman-03009 on MS Windows with UNC path that contains dollar sign

A customer of mine had a strange behaviour after upgrade of a database to 19c on MS Windows. He was running in an error while trying to "delete obsolete" in rman.

The error he got was
rman-03009: failure of delete command on ORA_DISK_1 channel
ORA-07217: sltln: environment variable cannot be evaluated.

ORA-07217: sltln: environment variable cannot be evaluated

The reason behind that?
Well, he used a special kind of backup location with a UNC path.


As you can see, the UNC path is located at another server using the "E$" share for the e:\ drive on that server. With 12.1 the usage of the dollar sign wasn't a problem - with 19c, after the upgrade, the database started to throw the "environment variable" error.

There wasn't a chance to get rid of these backups/backup entries in the controlfile and the rman catalog using any crosscheck - delete expired (even with force) - delete obsolete combination.

The only chance we had was to unregister the database from the rman catalog, deleted all the stuff regarding backup from the controlfile repository and register the database again with the rman catalog. After this, we moved all "old" backup files to a new folder and cataloged them again.

And here is how to get rid of the "problematic" entries from the controlfile:

First you have to connect to the database as SYSDBA. then you can run the following select:

 select rownum-1, type from v$controlfile_record_section;  

You need to find the section with the type of the backup things you want to delete. Be aware that you can corrupt your controlfile and your database if you remove the wrong things!

To clear the section in the controlfile you must run the following for every section you want to delete:

 execute sys.dbms_backup_restore.ResetCfileSection(<your_section_id>);

You should be able to delete all backup related information with that. If you run into an error while you reset other things of the controlfile section, then this part is protected.