EM Configuration issue while stopping em12c

While starting/stopping EM12c, we sometimes find below error:

$ emctl stop oms -all
EM Configuration issue. /u01/ora/fmw/db/product/11.2.0/dbhome_1/localhost_EM12c not found.

or

Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.

Solution:  Unset all environment variables and try to stop the oms again.

Nagulu Polagani

"We are all apprentices in a craft where no one ever becomes a master."