Oracle Solution for Error ora-16438

Solution for Oracle Error ORA-16438

ORA-16438: Switchover to primary cannot be executed at this time

What triggered the Error:

ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY could not be executed because an incompatible operation such as RMAN restore or flashback was in progress. See the database alert log for details.

What should we do to fix it:

Wait for the incompatible operation to complete. The files that have been flashed back or restored need recovery before you can reissue ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY statement. Start redo apply and verify that the SWITCHOVER_STATUS column of the V$DATABASE view reports TO_PRIMARY or SESSIONS_ACTIVE before retrying ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY.