1) Install WMQ Client on same machine as Oracle database
set LD_LIBRARY_PATH in .profile
LD_LIBRARY_PATH = [ORACLE_HOME]/lib:[ORACLE_HOME]/lib32:[ORACLE_HOME]/jlib:/usr/dt/lib:/usr/openwin/lib:[ORACLE_HOME]/ctx/lib
2) Execute $ORACLE_HOME/mgw/admin/catmgw.sql has to be with SYS privileges.
3) Create a user MGWADM with role MGW_ADMINISTRATOR_ROLE
CREATE USER MGWADM IDENTIFIED BY MGWADM;
GRANT CREATE SESSION TO MGWADM;
GRANT CONNECT, RESOURCE TO MGWADM;
GRANT MGW_ADMINISTRATOR_ROLE TO MGWADM;
GRANT MGW_AGENT_ROLE TO MGWADM;
4) Add following entries in Listener.ora. Update the host and port accordingly.
<<DB_NAME>> =
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=10.87.137.228)(PORT=1526))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc1))
)
)
SID_LIST_<<DB_NAME>> =
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=<<DB_NAME>>)
(ORACLE_HOME= [ORACLE_HOME])
(SID_NAME=<<DB_NAME>>)
)
(SID_DESC=
(SID_NAME=plsextproc)
(ORACLE_HOME=[ORACLE_HOME])
(PROGRAM=extproc)
)
)
LISTENER_MGW =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.87.137.228) (PORT = 7112))
(ADDRESS = (PROTOCOL = ipc) (key=extproc2))
)
)
SID_LIST_LISTENER_MGW =
(SID_LIST =
(SID_DESC=
(SID_NAME = MGWEXTPROC2)
(ENVS="EXTPROC_DLLS=[ORACLE_HOME]/lib32/libmgwagent.so,LIBPATH=[ORACLE_HOME]/jdk/jre/bin:[ORACLE_HOME]/jdk/jre/bin/classic:[ORACLE_HOME]/lib32,LDR_CNTRL=USERREGS")
(ORACLE_HOME=[ORACLE_HOME])
(PROGRAM = extproc32)
)
(SID_DESC =
(GLOBAL_DBNAME = <<DB_NAME>>)
(ORACLE_HOME = [ORACLE_HOME])
(SID_NAME = <<DB_NAME>>)
)
)
6) Add following entries in TNSnames.ora. Update the host and port accordingly.
MGW_AGENT =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL=IPC)(KEY=extproc2))
)
(CONNECT_DATA =
(SID=MGWEXTPROC2) (PRESENTATION=RO)
)
)
AGENTMGW_SERVICE =
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL=IPC)(KEY=extproc2)))
(CONNECT_DATA=
(SID=<<DB_NAME>>)(PRESENTATION=RO)
)
)
extproc_connection_data =
(DESCRIPTION=
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=IPC)(KEY=extproc2))
)
(CONNECT_DATA=
(SID=PLSExtProc)
(PRESENTATION = RO)
) )
7) Edit $ORACLE_HOME/mgw/admin/ mgw.ora file.
=======================================================
#MGW_PRE_PATH=/.2.0/jdk/jre/1.4.2/bin/client
#set CLASSPATH=/myOracleHome/jdbc/lib/ojdbc14.jar:/myOracleHome/jdk/jre/lib/i18n.jar:/myOracleHome/jdk/jre/lib/rt.jar:/myOracleHome/sqlj/lib/runtime12.jar:/myOracleHome/jlib/orai18n.jar:/myOracleHome/jlib/jta.jar:/myOracleHome/rdbms/jlib/jmscommon.jar:/myOracleHome/rdbms/jlib/aqapi13.jar:/opt/mqm/java/lib/com.ibm.mqjms.jar:/opt/mqm/java/lib/com.ibm.mq.jar:/opt/mqm/java/lib:/opt/mqm/java/lib/connector.jar
CLASSPATH=[ORACLE_HOME]/mgw/jlib/mgw.jar:[ORACLE_HOME]/mgw/classes/mgw.jar:[ORACLE_HOME]/jdbc/lib/ojdbc14.jar:[ORACLE_HOME]/jlib/orai18n.jar:[ORACLE_HOME]/jdk/jre/lib/rt.jar:[ORACLE_HOME]/sqlj/lib/runtime12.jar:[ORACLE_HOME]/oc4j/sqlj/lib/translator.jar:[ORACLE_HOME]/jlib/jta.jar:[ORACLE_HOME]/rdbms/jlib/jmscommon.jar:[ORACLE_HOME]/rdbms/jlib/aqapi13.jar:/usr/mqm/java/lib/com.ibm.mq.jar:/usr/mqm/java/lib/com.ibm.mqbind.jar:/usr/mqm/java/lib/com.ibm.mqjms.jar:/usr/mqm/java/lib/jms.jar:/usr/mqm/java/lib/jndi.jar:/usr/mqm/java/lib/jta.jar:/usr/mqm/java/lib/connector.jar:/usr/mqm/java/lib:/usr/mqm/java/lib/com.ibm.jms.jar
set LIBPATH=[ORACLE_HOME]/jdk/jre/bin:[ORACLE_HOME]/jdk/jre/bin/classic:[ORACLE_HOME]/rdbms/lib32:[ORACLE_HOME]/lib32
set log_level = 3
log_directory=[ORACLE_HOME]/mgw/log
=======================================================
8) Start the listener:-
lsnrctl start LISTENER_MGW
9) Configure and start MGW via following command.
SQLPLUS <MGWADM> / <MGWADM_PASSWORD>
EXEC DBMS_MGWADM.DB_CONNECT_INFO ('<MGWADM>','<MGWADM_PASSWORD>','<DB_TNS_ALIAS>');
EXEC DBMS_MGWADM.STARTUP;
SELECT AGENT_STATUS FROM MGW_GATEWAY;
EXEC DBMS_MGWADM.SHUTDOWN;
10) Trouble shooting
If you get below output it’s correct.
$ORACLE_HOME/bin/extproc
Oracle Corporation --- TUESDAY MAR 01 2011 10:41:22.389
Heterogeneous Agent Release 10.2.0.4.0 - 64bit Production
$ORACLE_HOME/bin/extproc32
exec(): 0509-036 Cannot load program /oracle/ORAHOME/bin/extproc32 because of the following errors:
0509-150 Dependent module /oracle/ORAHOME/lib/libnnz10.so could not be loaded.
0509-103 The module has an invalid magic number.
set LD_LIBRARY_PATH in .profile
LD_LIBRARY_PATH = [ORACLE_HOME]/lib:[ORACLE_HOME]/lib32:[ORACLE_HOME]/jlib:/usr/dt/lib:/usr/openwin/lib:[ORACLE_HOME]/ctx/lib
2) Execute $ORACLE_HOME/mgw/admin/catmgw.sql has to be with SYS privileges.
3) Create a user MGWADM with role MGW_ADMINISTRATOR_ROLE
CREATE USER MGWADM IDENTIFIED BY MGWADM;
GRANT CREATE SESSION TO MGWADM;
GRANT CONNECT, RESOURCE TO MGWADM;
GRANT MGW_ADMINISTRATOR_ROLE TO MGWADM;
GRANT MGW_AGENT_ROLE TO MGWADM;
4) Add following entries in Listener.ora. Update the host and port accordingly.
<<DB_NAME>> =
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=10.87.137.228)(PORT=1526))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc1))
)
)
SID_LIST_<<DB_NAME>> =
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=<<DB_NAME>>)
(ORACLE_HOME= [ORACLE_HOME])
(SID_NAME=<<DB_NAME>>)
)
(SID_DESC=
(SID_NAME=plsextproc)
(ORACLE_HOME=[ORACLE_HOME])
(PROGRAM=extproc)
)
)
LISTENER_MGW =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.87.137.228) (PORT = 7112))
(ADDRESS = (PROTOCOL = ipc) (key=extproc2))
)
)
SID_LIST_LISTENER_MGW =
(SID_LIST =
(SID_DESC=
(SID_NAME = MGWEXTPROC2)
(ENVS="EXTPROC_DLLS=[ORACLE_HOME]/lib32/libmgwagent.so,LIBPATH=[ORACLE_HOME]/jdk/jre/bin:[ORACLE_HOME]/jdk/jre/bin/classic:[ORACLE_HOME]/lib32,LDR_CNTRL=USERREGS")
(ORACLE_HOME=[ORACLE_HOME])
(PROGRAM = extproc32)
)
(SID_DESC =
(GLOBAL_DBNAME = <<DB_NAME>>)
(ORACLE_HOME = [ORACLE_HOME])
(SID_NAME = <<DB_NAME>>)
)
)
6) Add following entries in TNSnames.ora. Update the host and port accordingly.
MGW_AGENT =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL=IPC)(KEY=extproc2))
)
(CONNECT_DATA =
(SID=MGWEXTPROC2) (PRESENTATION=RO)
)
)
AGENTMGW_SERVICE =
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL=IPC)(KEY=extproc2)))
(CONNECT_DATA=
(SID=<<DB_NAME>>)(PRESENTATION=RO)
)
)
extproc_connection_data =
(DESCRIPTION=
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=IPC)(KEY=extproc2))
)
(CONNECT_DATA=
(SID=PLSExtProc)
(PRESENTATION = RO)
) )
7) Edit $ORACLE_HOME/mgw/admin/ mgw.ora file.
=======================================================
#MGW_PRE_PATH=/.2.0/jdk/jre/1.4.2/bin/client
#set CLASSPATH=/myOracleHome/jdbc/lib/ojdbc14.jar:/myOracleHome/jdk/jre/lib/i18n.jar:/myOracleHome/jdk/jre/lib/rt.jar:/myOracleHome/sqlj/lib/runtime12.jar:/myOracleHome/jlib/orai18n.jar:/myOracleHome/jlib/jta.jar:/myOracleHome/rdbms/jlib/jmscommon.jar:/myOracleHome/rdbms/jlib/aqapi13.jar:/opt/mqm/java/lib/com.ibm.mqjms.jar:/opt/mqm/java/lib/com.ibm.mq.jar:/opt/mqm/java/lib:/opt/mqm/java/lib/connector.jar
CLASSPATH=[ORACLE_HOME]/mgw/jlib/mgw.jar:[ORACLE_HOME]/mgw/classes/mgw.jar:[ORACLE_HOME]/jdbc/lib/ojdbc14.jar:[ORACLE_HOME]/jlib/orai18n.jar:[ORACLE_HOME]/jdk/jre/lib/rt.jar:[ORACLE_HOME]/sqlj/lib/runtime12.jar:[ORACLE_HOME]/oc4j/sqlj/lib/translator.jar:[ORACLE_HOME]/jlib/jta.jar:[ORACLE_HOME]/rdbms/jlib/jmscommon.jar:[ORACLE_HOME]/rdbms/jlib/aqapi13.jar:/usr/mqm/java/lib/com.ibm.mq.jar:/usr/mqm/java/lib/com.ibm.mqbind.jar:/usr/mqm/java/lib/com.ibm.mqjms.jar:/usr/mqm/java/lib/jms.jar:/usr/mqm/java/lib/jndi.jar:/usr/mqm/java/lib/jta.jar:/usr/mqm/java/lib/connector.jar:/usr/mqm/java/lib:/usr/mqm/java/lib/com.ibm.jms.jar
set LIBPATH=[ORACLE_HOME]/jdk/jre/bin:[ORACLE_HOME]/jdk/jre/bin/classic:[ORACLE_HOME]/rdbms/lib32:[ORACLE_HOME]/lib32
set log_level = 3
log_directory=[ORACLE_HOME]/mgw/log
=======================================================
8) Start the listener:-
lsnrctl start LISTENER_MGW
9) Configure and start MGW via following command.
SQLPLUS <MGWADM> / <MGWADM_PASSWORD>
EXEC DBMS_MGWADM.DB_CONNECT_INFO ('<MGWADM>','<MGWADM_PASSWORD>','<DB_TNS_ALIAS>');
EXEC DBMS_MGWADM.STARTUP;
SELECT AGENT_STATUS FROM MGW_GATEWAY;
EXEC DBMS_MGWADM.SHUTDOWN;
10) Trouble shooting
If you get below output it’s correct.
$ORACLE_HOME/bin/extproc
Oracle Corporation --- TUESDAY MAR 01 2011 10:41:22.389
Heterogeneous Agent Release 10.2.0.4.0 - 64bit Production
$ORACLE_HOME/bin/extproc32
exec(): 0509-036 Cannot load program /oracle/ORAHOME/bin/extproc32 because of the following errors:
0509-150 Dependent module /oracle/ORAHOME/lib/libnnz10.so could not be loaded.
0509-103 The module has an invalid magic number.
No comments:
Post a Comment