When changing the server name of a Oracle database server (10g-12c) you will notice that dbconsole will not start successfully, requiring some reconfiguration of this service as follows:
1. Change the C:\WINDOWS\System32\drivers\etc\hosts file to reflect new hostname an IP.
#Example of c:\windows\system32\drivers\etc\hosts
127.0.0.1 localhost
192.168.1.10 newservername newservername.dom.local
2. Change ORACLE_HOSTNAME system variable accordingly (windows command prompt should be reopend to see new variable value).
3. Change the %ORACLE_HOME%\network\admin\listener.ora and %ORACLE_HOME%\network\admin\tnsnames.ora files to reflect new
hostname an IP.
4. Restart all Oracle services
5. Drop the em configuration with the following commands:
#>set ORACLE_SID=orcl
#>emca -deconfig dbcontrol db -repos drop
Ensure that sysman user has been droped too. If not:
DROP USER sysman CASCADE;
DROP PUBLIC SYNONYM setemviewusercontext;
DROP ROLE mgmt_user;
DROP PUBLIC SYNONYM mgmt_target_blackouts;
DROP USER mgmt_view;
6. You can then create the em environment with the following syntax:
#> emca -config dbcontrol db -repos create
7. Check that dbconsole started successfully
Note:
On Oracle 10g there is a bug - "SSL certificate "bug" that is causing dbconsole to fail to start 2010-12-31 because a certificate renewal problem (Metalink Article ID: 1222603.1 ).
In that case the following (nasty) steps should help (pay attention to avoid transactions to database during this procedure because of system time manipulation):
emca -deconfig dbcontrol db -repos drop
change server date/time in past - before 2010-12-31
emca -config dbcontrol db -repos create
change server date/time to real clock
emctl unsecure dbconsole
emctl secure dbconsole