Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MQSERIES PL/SQL Support

Status
Not open for further replies.

ramlakshman

Technical User
Sep 28, 2001
7
SG
I am having the files from IBM for AIX
which is for Oracle PL/SQL support

I have changed it accordingly for HP UNIX.

According to their script I have created the following shared library for mqi.c

make -f $ORACLE_HOME/rdbms/demo/demo_rdbms.mk extproc_nocallback
SHARED_LIBNAME=mqi.so OBJS="mqi.o"

Instead of the below mentioned script given by them I used the libmqm.sl from /opt/mqm/lib

make -f $ORACLE_HOME/rdbms/demo/demo_rdbms.mk extproc_nocallback
SHARED_LIBNAME=$MQ_LIBPATH/mqseries.so OBJS="/usr/mqm/lib/libmqm.a"

I have created the following objects in Oracle given by IBM
mqpack.sql
mqseries.con
mqseries.def

after executing mqget.sql

After executing the procedure mqget.sql
I am getting the following error

MQCONN: CompCode=2 Reason=2059
MQOPEN: CompCode=2 Reason=2018
MQGET: CompCode=2 Reason=2018
MQCLOSE: CompCode=2 Reason=2018
MQDISC: CompCode=2 Reason=2018
message < >

PL/SQL procedure successfully completed.

Also we have added the following entries in TNSNAMES.ORA

extproc_connection_data= (DESCRIPTION =
(ADDRESS=(PROTOCOL=IPC)(KEY=extproc))
(CONNECT_DATA=(SID=extproc)))

In the LISTENER.ORA

LSNRextproc =
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=extproc))
SID_LIST_LSNRextproc =
(SID_LIST=(SID_DESC=(SID_NAME=extproc)
(ORACLE_HOME=/oracle/oracle/8.1.7.64)(PROGRAM=extproc)(ENVS=LD_LIBRARY_PATH=/opt/mqm/lib)))

I gave all the permission to the oracle user.

In my case oracle user is &quot;dbora7ap&quot;.

Please help me to proceed.

TIA

S. Ram Kumar


 
2059 is queue manager NOT found. Have you modified the mqget.sql and mqput.sql to use the name of your queue manager ?

The mqget .sql code continues even ( no error handling)after the first error is encountered.

From
 
Yes I have modified.

I am having a program which will run os command
In the mq.txt I am having the following script
DISPLAY QUEUE(TEST.LISTEN) CURDEPTH

SQL> execute osutil.r_runoscmd('runmqsc TEST_Q.DV <
/ram/mq.txt');
04L1788, 5765-B74 (C) Copyright IBM Corp. 1994, 1999 ALL RIGHTS RESERVED.
Starting MQSeries Commands.
1 : DISPLAY QUEUE(TEST.LISTEN) CURDEPTH
AMQ8409: Display Queue details.
QUEUE(TEST.LISTEN) CURDEPTH(0)
1 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.

PL/SQL procedure successfully completed.

I am getting the result.

If I use the mqget.sql I am getting the following error

MQCONN: CompCode=2 Reason=2059
MQOPEN: CompCode=2 Reason=2018
MQGET: CompCode=2 Reason=2018
MQCLOSE: CompCode=2 Reason=2018
MQDISC: CompCode=2 Reason=2018
message < >

PL/SQL procedure successfully completed.

Please help to track

TIA
 
Running osutil is different than running a External Procedure. The agent process loads the shared lib and calls the function insides it.

Try to change the queue manager name to something meaningless and see if it creates the same error. It should give you a different error. May be the way name is passed to MQCONN procedure in package is not passing it correctly. Just for a sanity check.

MiddlewareOnline.Com IBM MQ Series Certified Consultants
 
Hi,

If I give some other Q manager name which is not defined in the MQ it is giving the following error

MQCONN: CompCode=2 Reason=2058
MQOPEN: CompCode=2 Reason=2018
MQGET: CompCode=2 Reason=2018
MQCLOSE: CompCode=2 Reason=2018
MQDISC: CompCode=2 Reason=2018
message < >

PL/SQL procedure successfully completed

TIA

The osutil.r_runoscmd is also external stored procedure program which is calling a function in c.

TIA
 
Interesting. Modify the file where MQCONN is MAPPED from PL/SQL to Shared Library External call. dbms_output the queue manager name passed.
Make sure the queue manager is running (2059 is Q_MGR_NOT_FOUND -- means it does exist).

Another thing you may want to check is to see that oracle user has connect/open rights (+mqiall to be safe).

MiddlewareOnline.Com IBM MQ Series Certified Consultants
 
Hi,

I have given full right to the oracle user.

In the first thread I gave give the listener.ora which is having ld_library_path set.

Q manager is running. If I run the sample progam from PLSQL through OS command it is working fine.

'Interesting. Modify the file where MQCONN is MAPPED from PL/SQL to Shared Library External call. dbms_output the queue manager name passed.'

Please tell me what is this means.

I am confussed.

TIA
 
In the mqpack package print the value of queue manager either into a table to see the value that you are getting in procedure before calling function in shared lib is correct.

MiddlewareOnline.Com IBM MQ Series Certified Consultants
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top