随笔-8  评论-0  文章-0  trackbacks-0
我的系统环境:
1.LINUX:RHEL 5.0
2.ORACLE:10g
3.TUXEDO服务器和ORACLE服务器在同一台机器上

一、ORACLE配置

用sysdba帐户登陆,
SQL> conn / as sysdba
SQL> @$ORACLE_HOME/rdbms/admin/xaview.sql
DROP VIEW v$xatrans$
*
ERROR at line 1:
ORA-00942: table or view does not exist

DROP VIEW v$pending_xatrans$
*
ERROR at line 1:
ORA-00942: table or view does not exist

View created.
View created.

SQL> grant select on v$xatrans$ to public with grant option;

Grant succeeded.

SQL> grant select on v$pending_xatrans$ to public with grant option;

Grant succeeded.

SQL> grant select any table to public;

Grant succeeded.

二、TUXEDO的配置

1、修改$TUXDIR/udataobj/RM文件
把原来的以Oracle_XA:xaosw:开头的屏蔽掉、
添加Oracle_XA:xaosw:-L${ORACLE_HOME}/lib -lclntsh

2、创建TMS文件:TMS_ORA10g,TUXEDO通过TMS_ORA10g与ORACLE数据库采用XA协议进行通讯

buildtms -o $TUXDIR\bin\TMS_ORA10g -r Oracle_XA

这个地方要注意权限问题。
[tuxedo@brady udataobj]$ buildtms -o $TUXDIR/bin/TMS_ORA10g -r Oracle_XA
/usr/bin/ld: cannot find -lclntsh
collect2: ld returned 1 exit status
CMDTUX_CAT:1832: ERROR: can't execute cc -I$TUXDIR/include -o /home/tuxedo/beahome/tuxedo9.1/bin/TMS_ORA10g BS-124c.c -L${TUXDIR}/lib

/home/tuxedo/beahome/tuxedo9.1/lib/TMS.o -ltux -lbuft -L${ORACLE_HOME}/lib -lclntsh -lfml -lfml32 -lengine -ldl -lpthread /usr/lib/libcrypt.a
CMDTUX_CAT:530: ERROR: Cannot execute $TUXDIR/bin/buildserver -r Oracle_XA -o /home/tuxedo/beahome/tuxedo9.1/bin/TMS_ORA10g -S -s TMS -s..TMS:TMS -f
$TUXDIR/lib/TMS.o
我觉得写得没错,指定了库的路径,不应该出这个问题。
但是
[tuxedo@brady udataobj]$ ll $ORACLE_HOME/lib/libclntsh.so
ls: /home/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so: Permission denied
这时我才意识到 我的tuxedo用户没有权限啊。
于是用root用户来进行操作。
[root@brady tuxedo9.1]# buildtms -o $TUXDIR/bin/TMS_ORA10g -r Oracle_XA

3、配置UBBCONFIG文件
下面是我的配置文件,粗体部分是需要关注的位置。
*RESOURCES
IPCKEY 56778

DOMAINID xaapp
MASTER xamh
MAXACCESSERS 10
MAXSERVERS 5
MAXSERVICES 10
MODEL SHM
LDBAL N

*MACHINES
"brady.domain" LMID=xamh
APPDIR="/home/tuxedo/beahome/appdir/xaapp"
TUXCONFIG="/home/tuxedo/beahome/appdir/xaapp/tuxconfig"
TUXDIR="/home/tuxedo/beahome/tuxedo9.1"
TLOGDEVICE = "/home/tuxedo/beahome/appdir/TLOG"
TLOGNAME=TLOG
TLOGSIZE=100
#如果这个地方不设置的话,会出现一下错误:
#[tuxedo@brady xaapp]$ tmloadcf -y ubbconfig
#CMDTUX_CAT:1352: ERROR: GROUP entry GROUP1 has TMS specified and LMID xamh does not have TLOGDEVICE
#CMDTUX_CAT:867: ERROR: tmloadcf: Above errors found during syntax checking

*GROUPS
GROUP1
LMID=xamh
GRPNO=1
OPENINFO="ORACLE_XA:Oracle_XA+Acc=P/scott/tiger+sqlNet=ORCL+SesTm=100+LogDir=..+MaxCur=5"
CLOSEINFO=""
TMSNAME="TMS_ORA10g"
#OPENINFO中P/scott/tiger+sqlNet=ORCL
#scott/tiger是用户名/密码,sqlNet=ORCL是本地命名的服务别名
#需要根据实际情况自定义

*SERVERS
DEFAULT:
CLOPT="-A"

axserv SRVGRP=GROUP1 SRVID=1

*SERVICES
TEST
4、重命名下列文件,因为下列文件名与ORACLE带的文件名有冲突,所以要改名。
(1)TUXEDO安装路径include目录下的下面文件
把sqlca.h 改名为 sqlca.h.bbb
把sqlcode.h 改名为 sqlcode.h.bbb
把sqlda.h 改名为 sqlda.h.bbb
(2)重命名TUXEDO安装路径lib目录下的下面文件
把libsql.lib 改名为 libsql.lib.bbb

三、你可以编写服务器端和客户端程序了

注意:
1、在编译服务器端程序的时候,用到proc命令而且还有一些oracle的库,所以要注意权限问题。
2、在启动服务器之前,要确保ORACLE服务器已经启动,且监听器也已经正常启动。
我的Oracle数据库的监听器一开始没有正常启动,出现如下错误:
[root@brady xaapp]# tmboot -y
Booting all admin and server processes in /home/tuxedo/beahome/appdir/xaapp/tuxconfig
INFO: BEA Tuxedo, Version 9.1, 32-bit, Patch Level (none)
INFO: Serial #: 454493271161-2655514326743, Expiration NONE, Maxusers 1000000
INFO: Licensed to: Customer

Booting admin processes ...

exec BBL -A :
process id=5539 ... Started.

Booting server processes ...

exec TMS_ORA10g -A :
Failed.
exec TMS_ORA10g -A :
Failed.
exec TMS_ORA10g -A :
Failed.
exec axserv -A :
Failed.
1 process started.
在ULOG文件中记录的错误是TPERMERR - resource manager error

我弄了差不多一个小时,没有弄好,上网搜也没有没有搜到什么原因。
然后我检查了下oracle。才发现监听器没有正常启动。
[oracle@brady xa]$ lsnrctl stop
[oracle@brady xa]$ lsnrctl start
再次 启动TUXEDO服务器时:
[root@brady xaapp]# tmboot -y
Booting all admin and server processes in /home/tuxedo/beahome/appdir/xaapp/tuxconfig
INFO: BEA Tuxedo, Version 9.1, 32-bit, Patch Level (none)
INFO: Serial #: 454493271161-2655514326743, Expiration NONE, Maxusers 1000000
INFO: Licensed to: Customer

Booting admin processes ...

exec BBL -A :
process id=5603 ... Started.

Booting server processes ...

exec TMS_ORA10g -A :
CMDTUX_CAT:819: INFO: Process id=5606 Assume started (pipe).
exec TMS_ORA10g -A :
CMDTUX_CAT:819: INFO: Process id=5610 Assume started (pipe).
exec TMS_ORA10g -A :
CMDTUX_CAT:819: INFO: Process id=5613 Assume started (pipe).
exec axserv -A :
CMDTUX_CAT:819: INFO: Process id=5616 Assume started (pipe).
5 processes started.
posted on 2012-03-20 15:20 cpp 阅读(2964) 评论(0)  编辑 收藏 引用 所属分类: Tuxedo

只有注册用户登录后才能发表评论。
【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理