Oracle Error RMAN-06737: database name “string” does not match target database name “string”

Oracle Error Message

RMAN-06737: database name “string” does not match target database name “string”

Reason for the Error

The UNREGISTER DATABASE command was used with a database name that does not match the name of the database to which RMAN is connected.

Solution

Specify the correct database name or avoid specifying the database name when connected to the target database.