When we use Oracle, we can use Oracle's own EM (Enterprise Manager) to make it easier to manage our databases. But sometimes our EM can not be connected, the cause of this problem is many, such as the lack of proper configuration hostname, or the operating system firewall problems and so on. If there is a problem, can we quickly rebuild em? The answer is yes. We can refer to it through Oracle's official documentation. But if we have a large number of configuration commands and options in EM, you can re-create EM by referencing this article.
First, you need to set the environment variable Oracle_hostname
Export Oracle_hostname=testbox.localdomain
And then do it again:
Emca-config Dbcontrol Db-repos Recreate
If this method doesn't work, you can drop your current repo manually first.
Emca-deconfig Dbcontrol Db-repos Drop
And then re-create
Emca-config Dbcontrol Db-repos Create
This process is relatively long, it takes about 10 minutes to create. Then you can see the following tips:
[Email protected] j2ee]$ emca-config Dbcontrol DB-repos createstarted EMCA at Jul1, the Ten: -: -pmem Configuration Assistant, Version11.2.0.3.0Productioncopyright (c)2003, ., Oracle. All rights reserved. Enter the following information:database sid:erinlistener Oracle_home [/u01/app/oracle/product/11.2.0/db_1]: Password forSYS User:password forDbsnmp User:password forSysman User:email Address forNotifications (optional): Outgoing Mail (SMTP) Server forNotifications (optional):-----------------------------------------------------------------You have specified the following settingsdatabase oracle_home ... ... ...../u01/app/oracle/product/11.2.0/db_1localhostname... testbox.localdomainlistener oracle_home ... ................../u01/app/oracle/product/11.2.0/db_1listener port number ... .... .....1521Database SID ..... erinemail address of the ..... forNotifications ......... Outgoing Mail (SMTP) Server fornotifications .........-----------------------------------------------------------------Do your wish to continue? [Yes (Y)/No (N)]: Yesjul1, the Ten: -: +PM Oracle.sysman.emcp.EMConfig performinfo:this operation is being logged at/u01/app/oracle/cfgtoollogs/emca/erin/Emca_2014_07_01_22_50_24.log. Jul1, the Ten: -: -PM oracle.sysman.emcp.EMReposConfig createrepositoryinfo:creating the EM repository ( this could take a while) ... Jul1, the Ten: -: thePM oracle.sysman.emcp.EMReposConfig invokeinfo:repository successfully createdjul1, the Ten: -: thePM oracle.sysman.emcp.EMReposConfig uploadconfigdatatorepositoryinfo:uploading configuration data to EM Repository ( this could take a while) ... Jul1, the Ten: $: +PM oracle.sysman.emcp.EMReposConfig invokeinfo:uploaded configuration Data Successfullyjul1, the Ten: $: $PM oracle.sysman.emcp.util.DBControlUtil securedbconsoleinfo:securing Database Control ( this could take a while) ... Jul1, the Ten: -: -PM Oracle.sysman.emcp.util.DBControlUtil securedbconsoleinfo:database Control secured successfully. Jul1, the Ten: -: -PM oracle.sysman.emcp.util.DBControlUtil startomsinfo:starting Database Control ( this could take a while) ... Jul1, the Ten: -: -PM oracle.sysman.emcp.EMDBPostConfig performconfigurationinfo:database Control started Successfullyjul1, the Ten: -: -PM oracle.sysman.emcp.EMDBPostConfig performconfigurationinfo:>>>>>>>>>>> the Database Control URL ishttps:// testbox.localdomain:5500/em <<<<<<<<<<<Jul1, the Ten: -: -PM oracle.sysman.emcp.EMDBPostConfig invokewarning:WARNING ************************Management Repository has been placedinchSecure mode wherein Enterprise Manager data would be encrypted. The encryption key has been placedinchThefile:/u01/app/oracle/product/11.2.0/db_1/testbox.localdomain_erin/sysman/config/emkey.ora. Ensure thisfileis backed up as the encrypted data would become unusableifThisfileIs lost.***********************************************************Enterprise Manager configuration completed successfullyfinished EMCA at Jul1, the Ten: -: -Pm
The red part of the callout is the access address of our EM.