RMAN-05678
cannot use SET FOREIGN DBID command when connected to a target database
Cause
The SET FOREIGN DBID command was run while connected to the target.
Action
Exit the Recovery Manager (RMAN) session and then start a new RMAN session without target database.