Here I have a primary database name prmy and a physical standby database called stdby. First I will switchover and make stdby as the new primary and prmy as the new physical standby:
1. export ORACLE_SID=prmy
2. sqlplus / as sysdba
3. alter database commit to switchover to physical standby with current session shutdown wait;
4. shutdown immediate
5. startup mount
6. alter database recover managed standby database disconnect;
7. exit
8. export ORACLE_SID=stdby
9. sqlplus / as sysdba
10. alter database commit to switchover to primary with session shutdown wait;
11. alter database open;
1. export ORACLE_SID=prmy
2. sqlplus / as sysdba
3. alter database commit to switchover to physical standby with current session shutdown wait;
4. shutdown immediate
5. startup mount
6. alter database recover managed standby database disconnect;
7. exit
8. export ORACLE_SID=stdby
9. sqlplus / as sysdba
10. alter database commit to switchover to primary with session shutdown wait;
11. alter database open;