Enterprise Manager (EM) not running after OS timezone change (nmectl_validateTZRegion)

November 12, 2011  |  dba, linux

I’ve installed Oracle Database 11gr2 Oracle_Home (11.2.0.3) on an Oracle Linux EC2 instance and then moved that home to a new server. Database was running, listener too, but Enterprise Manager crashed after login and the log file shows that there a problem with the agent timezone:

cat /u01/app/oracle/product/11.2.0/dbhome_1/myhost.com_apex/sysman/log/emdctl.trc
2011-11-12 11:03:11,376 Thread-1708107488 ERROR main: nmectl.c: nmectl_validateTZRegion, agentTZoffset =0,and testTZoffset for US/Eastern:-300 do not match
2011-11-12 11:03:14,703 Thread-330168032 WARN  http: nmehl_connect_internal: connect failed to (myhost.com:1158): Connection refused (error = 111)

The problem is that my instance now runs on Europe/Lisbon timezone (while the AMI i’ve used was running on US/Eastern) and this crash the EM agent and the EM daemon running on port 1158.

cat /etc/sysconfig/clock
# The ZONE parameter is only evaluated by system-config-date.
# The timezone of the system is defined by the contents of /etc/localtime.
ZONE="Europe/Lisbon"
UTC=true
ARC=false

 

1. Set the desired time zone at the OS level (system-config-date on OEL or you-know-where-on-windows)

2. Open a terminal window and set the oracle_home and oracle_sid and other environment variables:

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=apex
export NLS_LANG=PORTUGUESE;
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export PATH=$ORACLE_HOME/bin:$PATH

3. Stop the dbconsole

emctl stop dbconsole

4. Run the following commands to check the current timezone and update to the new timezone (it will update the $ORACLE_HOME\sysman\config\emd.properties file with the correct timezone)

emctl config agent getTZ
emctl config agent updateTZ

5. Start the dbconsole

emctl start dbconsole

Bye, Joao


1 Comment


  1. Re: Install Oracle 11gR2 Error?
    Posted: Apr 24, 2013 2:20 PM in response to: Junaid in response to: Junaid
    em_daemon_is_not_running , agent_is_not_running , em_internal_error , error_database_control , time_zone_problem [Edit]

    Click to edit this message… Edit Click to report abuse… Click to reply to this thread Reply
    AOA/Hello,

    Dear All,

    First of all thanks to all of those people who posted solutions in different forums on this issue as this helped me to solve this problem. One more thing, always read documentation and always check log files for error reports as Oracle is not too much interactive.

    The Problem ” Error Starting Database Control Please execute the following command(s) ” faced at the end of installation of Oracle 10g / 11g is caused due to Time Zone Values in different files, tables and services of Oracle. Interestingly, these values do not change automatically with the change in OS time zone and you have to do it manually.

    You also have to set some environment variables manually like ORACLE_UNQNAME, ORACLE_SID, ORACLE_HOSTNAME etc.

    You also have to set machine name and IP in the hosts file if required so that EM finds the localhost.

    127.0.0.1 localhost
    127.0.0.1 computer name / hostname

    PRAISE ORACLE FOR THIS

    Following is the Solution which worked well for me.

    Step 1: Go to dbhome > hostname_SID > Sysman > Config > open emd.properties in notepad and set the value agentTZRegion=+05:00 to the value of your timezone and click save. You can also do it using export and time zone reset commands.

    Step 2: ALTER DATABASE SET TIME_ZONE=’+05:00′; according to your time zone. You can check DB TIME Zone using ” select dbtimezone from dual ; “.

    Step 3: In step 2 if you get the error “ORA-30079: cannot alter database timezone when database has TIMESTAMP WITH
    LOCAL TIME ZONE columns” then please FOLLOW following steps

    SQL> select count (*) from dba_tab_columns
    2 where data_type like ‘TIMESTAMP%WITH LOCAL TIME ZONE’ ;

    COUNT(*)
    1

    In this case there is only one table. The owner and name can be determined by:

    SQL> select owner, table_name from dba_tab_columns
    2 where data_type like ‘TIMESTAMP%WITH LOCAL TIME ZONE’;

    OWNER TABLE_NAME
    ——————————
    OE ORDERS

    SQL> desc oe.orders ;
    Name Null? Type
    ——– ORDER_ID NOT NULL NUMBER(12)
    ORDER_DATE NOT NULL TIMESTAMP(6) WITH LOCAL TIME ZONE
    ORDER_MODE VARCHAR2(8)
    CUSTOMER_ID NOT NULL NUMBER(6)
    ORDER_STATUS NUMBER(2)
    ORDER_TOTAL NUMBER(8,2)
    SALES_REP_ID NUMBER(6)
    PROMOTION_ID NUMBER(6)

    This oe.orders is just a table in the example schema of OE so this colums can be dropped. So please dont install sample schemas if you dont need them.

    SQL> alter table OE.ORDERS drop column ORDER_DATE ;

    Table altered.

    Now the Time Zone can be altered using above command.

    Step 4: Also check the value of ” SELECT SESSIONTIMEZONE FROM DUAL; ” and if the value differs from os time zone, db time zone , emd.properties / agent time zone then also set it according to your timezone but I believe it always gives the OS time zone.

    Step 5: Stop and Restart all Services and check that Oracle DBConsole service is running or not and if not running then start from command prompt ” emctl start dbconsole” .

    NOW THE ENTERPRISE MANAGER WILL WORK WELL BY THE GRACE OF ALMIGHTY ALLAH.

    Regards,

    Tauseef Ahmed
    IT Specialist, TDCP

    Edited by: 1002308 on Apr 24, 2013 2:22 PM

Leave a Reply