Monday, August 26, 2013

Oracle 11gR2 netmgr/netca issue resolution on Solaris 10 for Corrupted listener.ora file

Following error comes when starting the netmgr or netca.

bash-3.2$ netmgr
Warning: Cannot convert string "-hanyi-ming-medium-r-normal--*-140-*-*-m-*-big5- 1" to type FontStruct
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at oracle.net.mgr.listener.ListenerComponent.loadData(Unknown Source)
at oracle.net.mgr.listener.ListenerComponent$ListenerCompDataSource.inte rnal_refreshData(Unknown Source)
at oracle.sysman.emSDK.client.dataComponent.dataDrivenTree.TreeDataSourc e.populateData(TreeDataSource.java:1039)
at oracle.sysman.emSDK.client.dataComponent.dataDrivenTree.TreeDataSourc e._initData(TreeDataSource.java:1083)
at oracle.sysman.emSDK.client.dataComponent.dataDrivenTree.TreeDataSourc e.initData(TreeDataSource.java:1056)
at oracle.sysman.emSDK.client.dataComponent.dataDrivenTree.TreeParentNod e.setExpanded(TreeParentNode.java:284)
at oracle.sysman.emSDK.client.dataComponent.dataDrivenTree.TreeParentNod e.setExpanded(TreeParentNode.java:242)
at oracle.ewt.dTree.DTreeButtonDecoration.processMouseEvent(Unknown Sour ce)
at oracle.ewt.dTree.DTreeStackingDecoration.processMouseEvent(Unknown So urce)
at oracle.ewt.dTree.DTree.processMouseEvent(Unknown Source)
at oracle.sysman.emSDK.client.dataComponent.dataDrivenTree.DataDrivenTre e.processMouseEvent(DataDrivenTree.java:1226)
at java.awt.Component.processEvent(Component.java:5282)
at java.awt.Container.processEvent(Container.java:1966)
at oracle.ewt.lwAWT.LWComponent.processEventImpl(Unknown Source)
at oracle.ewt.dTree.DTree.processEventImpl(Unknown Source)
at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Component.java:3984)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212 )
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh read.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre ad.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

This has caused because of corrupted listener.ora file.

Solution

1. First back up the Listener.ora file.
2. Check the listener running on by following command.
    ps -ef|grep tns
3. Kill the Listener Process and also listener.ora file.
    kill -9 <Process-ID>
4. Start the listener from LSNRCTL Utility without the listener.ora file.
5. Now the default listener with 1521 port will be started and Net Manger and Net CA should be   working fine.

Friday, August 2, 2013

Troubleshoot & Re-create Oracle Enterprise Manager Repository on MS Windows Server

Remove the following directories from your filesystem:

<ORACLE_HOME>\<hostname>_<db_unique_name>
<ORACLE_HOME>\oc4j\j2ee\OC4J_DBConsole_<hostname>_<db_unique_name>

$ sc delete DbConsoleOEM

$ cd <ORACLE_HOME>\bin
$ emca -repos drop or we can drop the Repository manually as follows.

Delete DBControl Repository Objects Manually:

Logon to SQL*PLUS as SYS user and execute the following:

SQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYSMAN.MGMT_NOTIFY_QTABLE',force=>TRUE);

SQL> DECLARE
CURSOR c1 IS
SELECT owner, synonym_name name
FROM dba_synonyms
WHERE table_owner = 'SYSMAN';
BEGIN
FOR r1 IN c1 LOOP
IF r1.owner = 'PUBLIC' THEN
EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;
ELSE
EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;
END IF;
END LOOP;
END;
/

SQL> DROP USER mgmt_view CASCADE;
SQL> DROP ROLE mgmt_user;
SQL> DROP USER sysman CASCADE;

Create the DBControl Repository Objects and Configuration Files:

Set your environment variables:

$ set ORACLE_HOME=D:\app\Administrator\product\11.2.0\dbhome_1
$ set ORACLE_SID=OEM
$ set ORACLE_UNQNAME=<database unique name> --> you can get this value from SQL query (SQL> show parameter db_unique_name)
$ set ORACLE_HOSTNAME

$ emca -config dbcontrol db -respos create

Edit <ORACLE_HOME>/sysman/admin/supported.tz file  i.e added Asia/Colombo under +5:30 GMT

Edit  <ORACLE_HOME>/<Hostname_DB>/sysman/config/emd.properties file to Asia/Colombo

$ set TZ=Asia/Colombo
$ emctl config agent getTZ
$ emctl config agent updateTZ
$ emctl resetTZ agent
$ emctl stop dbconsole
$ emctl start dbconsole