tuxedo详细安装步骤
更新时间:2024-04-29 03:57:01 阅读量: 综合文库 文档下载
- 突尼斯推荐度:
- 相关推荐
Tuxedo使用Non-XA模式连接Oracle数据库
实验的网络拓扑图:
软件安装环境:3台主机都安装Cent OS 5.3操作系统,第1台主机作为Tuxedo的客户端,只安装Tuxedo客户端(IP:192.168.1.61);第2台主机作为Tuxedo服务器安装Tuxedo Server,还要连接Oracle服务器,还安装了Oracle Client 11gR2(IP:192.168.1.66);第三台主机作为Oracle数据库服务器,只安装Oracle11gR2(IP:192.168.1.81)。
实验目的:了解Tuxedo使用Non-XA方式连接Oracle数据库。通过客户端发送一个请求到Tuxedo服务器,再由Tuxedo服务器连接Oracle服务器,把客户端发送的信息写入数据库表。 实验步骤:1.安装Tuxedo的演示程序SimpApp (使用主机1和主机2) 2.作一个Pro/C的Demo,来连接Oracle数据库(使用主机2和主机3) 3.把第1步和第2步合并到一起,完成该实验 4.测试并排错
安装前准备:
要使Tuxedo服务器,能连接到Oracle服务器。Oracle服务器的实例名称为stone,在Tuxedo服务器上安装Oracle客户端后,建立一个服务,使其能够连接到Oracle数据库服务器。
在Tuxedo Server(主机2)上,先建立网络服务,再连接到Oracle数据库服务器,使用hr用户,并建立一个测试表:
◆网络服务的名称为stone,结果为$ORACLE_HOME/network/admin目录下的tnsnames.ora文件 [oracle@myapache ~]$cd /u01/app/oracle/product/11.2.0/client_1/network/admin/ [oracle@myapache admin]$ls
samples shrept.lst sqlnet10031011AM2455.bak sqlnet.ora tnsnames.ora [oracle@myapache admin]$vi tnsnames.ora # tnsnames.ora Network Configuration File:
/u01/app/oracle/product/11.2.0/client_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. STONE = (DESCRIPTION = (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.81)(PORT = 1521)) )
(CONNECT_DATA = (SERVICE_NAME = stone) ) )
◆建立测试表
[oracle@myapache ~]$sqlplus hr/hr@stone
SQL*Plus: Release11.2.0.1.0 Production on Wed Mar 10 21:17:22 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database11gEnterpriseEdition Release11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL>create table t_test1( 2 zj number, 3 name varchar2(20) 4 ); Table created.
SQL>insert into t_test1 values(1, 'aaa'); 1 row created.
SQL>commit; Commit complete.
SQL>select * from t_test1; ZJ NAME ---------- -------------------- 1 aaa SQL>
◆在主机2上还要把Oracle用户的环境变量设置好,使其能正确编译pro/c程序 [oracle@myapache ~]$ vi .bash_profile
设置好以下环境变量
# User specific environment and startup programs
ORACLE_HOME=/u01/app/oracle/product/11.2.0/client_1 export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib export LD_LIBRARY_PATH
PATH=$PATH:$ORACLE_HOME/bin export PATH
stty erase ^H (完)
测试一下Pro/C是否正确 [oracle@myapache ~]$proc
Pro*C/C++: Release11.2.0.1.0 - Production on Thu Mar 11 01:16:42 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
System default option values taken from:
/u01/app/oracle/product/11.2.0/client_1/precomp/admin/pcscfg.cfg
(下面内容从略)
一、安装Tuxedo的演示程序SimpApp,并完成Tuxedo客户端访问服务器的配置
1.在主机2上安装Tuxedo10gR3 Server
建议采用字符安装界面,在安装过程中选择安装上Sample,以便运行SimpApp例子 [root@myapache ~]#cd /home/OraFile/
[root@myapache OraFile]#unzip tuxedo10gR3_32_Linux_01_x86.zip [root@myapache OraFile]#chmod +x tuxedo10gR3_32_Linux_01_x86.bin [root@myapache OraFile]#./tuxedo10gR3_32_Linux_01_x86.bin -i console Extracting the JRE from the installer archive... Unpacking the JRE...
Extracting the installation resources from the installer archive... Configuring the installer for this system's environment...
Launching installer... (比较重要的地方) Choose Oracle Home ------------------
1- Create new Oracle Home
Enter a number:1
Specify a new Oracle Home directory:/bea
=============================================================================== Choose Product Directory ------------------------
1- Modify Current Selection (/bea/tuxedo10gR3) 2- Use Current Selection (/bea/tuxedo10gR3)
Enter a number:1
Specify Product Installation Directory:/bea/tux10 (为操作方便,把安装目录修改为:/bea/tux10) Install Samples (Y/N):Y (选择安装Samples)
2.在Tuxedo Server上运行SimpApp例子 (1)把SimpApp例子拷贝到/home/myTuxeSrv目录下
[oracle@myapache ~]$cp -R /bea/tux10/samples/atmi/simpapp/ /home/myTuxSrv/ 再拷贝环境变量
[oracle@myapache ~]$cp /bea/tux10/tux.env /home/myTuxSrv/simpapp/ [oracle@myapache ~]$cd /home/myTuxSrv/simpapp/ [oracle@myapache simpapp]$ls
README simpcl.c simpserv.c tux.env ubbsimple [oracle@myapache simpapp]$
(2)编辑simpapp的配置文件
[oracle@myapache simpapp]$ cp ubbsimple ubb
[oracle@myapache simpapp]$ vi ubb 修改结果: #Example:
IPCKEY
TUXDIR=\
# (c) 2003 BEA Systems, Inc. All Rights Reserved.
#ident \
#Skeleton UBBCONFIG file for the TUXEDO Simple Application. #Replace the
*RESOURCES IPCKEY 123456
DOMAINID simpapp MASTER simple MAXACCESSERS 10 MAXSERVERS 5 MAXSERVICES 10 MODEL SHM
LDBAL N *MACHINES DEFAULT:
APPDIR=\
TUXCONFIG=\ TUXDIR=\
myapache LMID=simple *GROUPS GROUP1
LMID=simple GRPNO=1 PENINFO=NONE *SERVERS DEFAULT:
CLOPT=\
simpserv SRVGRP=GROUP1 SRVID=1 *SERVICES TOUPPER (配置文件完)
(3)修改环境变量文件tux.env [oracle@myapache simpapp]$ vi tux.env 在最后加入两行
TUXDIR=/bea/tux10; export TUXDIR JAVA_HOME=$TUXDIR/jre; export JAVA_HOME
JVMLIBS=$JAVA_HOME/lib/i386/server:$JAVA_HOME/jre/bin PATH=$TUXDIR/bin:$JAVA_HOME/bin:$PATH; export PATH COBCPY=:$TUXDIR/cobinclude; export COBCPY
COBOPT=\ SHLIB_PATH=$TUXDIR/lib:$JVMLIBS:$SHLIB_PATH; export SHLIB_PATH LIBPATH=$TUXDIR/lib:$JVMLIBS:$LIBPATH; export LIBPATH
LD_LIBRARY_PATH=$TUXDIR/lib:$JVMLIBS:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH WEBJAVADIR=$TUXDIR/udataobj/webgui/java; export WEBJAVADIR APPDIR=/home/myTuxSrv/simpapp; export APPDIR TUXCONFIG=$APPDIR/tuxconfig; export TUXCONFIG
(4)在服务器本地运行simpapp例子程序 使环境变量生效
[oracle@myapache simpapp]$. ./tux.env [oracle@myapache simpapp]$ls
README simpcl.c simpserv.c tux.env ubb ubbsimple [oracle@myapache simpapp]$env | grep TUX TUXCONFIG=/home/myTuxSrv/simpapp/tuxconfig TUXDIR=/bea/tux10
[oracle@myapache simpapp]$
编译ubb (生成tuxconfig)
[oracle@myapache simpapp]$ tmloadcf -y ubb [oracle@myapache simpapp]$ ls
README simpcl.c simpserv.c tuxconfig tux.env ubb ubbsimple ULOG.031010
编译simpserv.c文件和simpcl.c文件(生成可执行文件)
[oracle@myapache simpapp]$buildserver -f simpserv.c -o simpserv -s TOUPPER (我这里有一些警告信息,不影响程序运行)
[oracle@myapache simpapp]$buildclient -f simpcl.c -o simpcl [oracle@myapache simpapp]$ls
README simpcl.c simpserv.c tux.env ubbsimple simpcl simpserv tuxconfig ubb ULOG.031010
运行服务器端程序
[oracle@myapache simpapp]$tmboot -y
Booting all admin and server processes in /home/myTuxSrv/simpapp/tuxconfig INFO: Oracle Tuxedo, Version10.3.0.0, 32-bit, Patch Level (none)
Booting admin processes ...
exec BBL -A :
process id=11402 ... Started.
Booting server processes ...
exec simpserv -A :
process id=11403 ... Started. 2 processes started. [oracle@myapache simpapp]$
测试一下运行情况:
[oracle@myapache simpapp]$./simpcl hello_alei Returned string is: HELLO_ALEI [oracle@myapache simpapp]$
看到以上结果,程序在本地已经可以使用了
3.把客户端程序转移到主机1上运行
(1)在服务器端(主机2)先做一些设置,首先关闭服务程序 [oracle@myapache simpapp]$tmshutdown -y
Shutting down all admin and server processes in /home/myTuxSrv/simpapp/tuxconfig Shutting down server processes ...
Server Id = 1 Group Id = GROUP1 Machine = simple: shutdown succeeded
Shutting down admin processes ...
Server Id = 0 Group Id = simple Machine = simple: shutdown succeeded 2 processes stopped. [oracle@myapache simpapp]$
(2)修改配置文件ubb,添加一些配置;并重新编译 [oracle@myapache simpapp]$vi ubb 修改了以下内容(标红部分) IPCKEY 123456
DOMAINID simpapp MASTER simple MAXACCESSERS 10 MAXSERVERS 5 MAXSERVICES 10 MODEL SHM LDBAL N *MACHINES DEFAULT:
APPDIR=\
TUXCONFIG=\ TUXDIR=\
myapache LMID=simple
MAXWSCLIENTS=5 *GROUPS GROUP1
LMID=simple GRPNO=1 PENINFO=NONE *SERVERS DEFAULT:
CLOPT=\
simpserv SRVGRP=GROUP1 SRVID=1 WSL SRVGRP=GROUP1 SRVID=10
CLOPT=\ *SERVICES TOUPPER (配置文件完)
重新编译生成配置文件tuxconfig [oracle@myapache simpapp]$ls
access.031010 simpcl simpserv stderr tuxconfig ubb ULOG.031010 README simpcl.c simpserv.c stdout tux.env ubbsimple [oracle@myapache simpapp]$rm -rf tuxconfig (先删除) [oracle@myapache simpapp]$tmloadcf -y ubb
[oracle@myapache simpapp]$tmboot -y
Booting all admin and server processes in /home/myTuxSrv/simpapp/tuxconfig INFO: Oracle Tuxedo, Version10.3.0.0, 32-bit, Patch Level (none) Booting admin processes ... exec BBL -A :
process id=13105 ... Started.
Booting server processes ...
exec simpserv -A :
process id=13106 ... Started.
exec WSL -A -- -n//192.168.1.66:3200 -m 2 -M 5 -x 5 : process id=13107 ... Started. 3 processes started. [oracle@myapache simpapp]$
[oracle@myapache simpapp]$netstat -anp 可以看到WSL也已经侦听了
(3)在Tuxedo Client (主机1)上运行simpapp的客户端程序
在Tuxedo客户端上,也要安装Tuxedo10gR3,但只安装Tuxedo的客户端就行了,其安装目录也是:/bea/tux10;客户端程序在/home/myTuxClient/simpapp目录中运行。先拷贝simpapp例子程序和tux.env环境变量文件
[root@tuxclient ~]#cp -R /bea/tux10/samples/atmi/simpapp/ /home/myTuxClient/ [root@tuxclient ~]#cp /bea/tux10/tux.env /home/myTuxClient/simpapp/
[root@tuxclient ~]#cd /home/myTuxClient/simpapp/ [root@tuxclient simpapp]#ls
README simpcl.c simpserv.c tux.env ubbsimple [root@tuxclient simpapp]#
修改tux.env环境变量,把WSL请求指向Tuxedo Server [root@tuxclient simpapp]# vi tux.env 在最后加一行
TUXDIR=/bea/tux10; export TUXDIR JAVA_HOME=$TUXDIR/jre; export JAVA_HOME
JVMLIBS=$JAVA_HOME/lib/i386/server:$JAVA_HOME/jre/bin PATH=$TUXDIR/bin:$JAVA_HOME/bin:$PATH; export PATH COBCPY=:$TUXDIR/cobinclude; export COBCPY
COBOPT=\ SHLIB_PATH=$TUXDIR/lib:$JVMLIBS:$SHLIB_PATH; export SHLIB_PATH LIBPATH=$TUXDIR/lib:$JVMLIBS:$LIBPATH; export LIBPATH
LD_LIBRARY_PATH=$TUXDIR/lib:$JVMLIBS:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH WEBJAVADIR=$TUXDIR/udataobj/webgui/java; export WEBJAVADIR USNADDR=//192.168.1.66:3200; export WSNADDR (环境变量文件完)
使环境变量生效,并查看是否正确 [root@tuxclient simpapp]#. ./tux.env [root@tuxclient simpapp]#env | grep WS
WSNADDR=//192.168.1.66:3200 [root@tuxclient simpapp]#
编译客户端程序,加-w代表远程访问
[root@tuxclient simpapp]#buildclient -f simpcl.c -o client –w [root@tuxclient simpapp]#ls
client README simpcl.c simpserv.c tux.env ubbsimple [root@tuxclient simpapp]#./client bbk Returned string is: BBK [root@tuxclient simpapp]#
可以看到,能够完成大小写转换,代表客户端可以正确发送请求到Tuxedo服务器了。
在Tuxedo服务器端查看simserv服务程序接受请求的情况 [oracle@myapache simpapp]$tmadmin tmadmin - Copyright (c) 2007-2008 Oracle.
Portions * Copyright 1986-1997 RSA Data Security, Inc. All Rights Reserved.
Distributed under license by Oracle. Tuxedo is a registered trademark. >psr
Prog Name Queue Name Grp Name ID RqDone Load Done Current Service --------- ---------- -------- -- ------ --------- --------------- BBL 123456 simple 0 0 0 ( IDLE )
simpserv 00001.00001 GROUP1 1 1 50 ( IDLE ) WSL 00001.00010 GROUP1 10 0 0 ( IDLE )
在客户端,再发送3个请求后,RqDone一列会变为4 >psr
Prog Name Queue Name Grp Name ID RqDone Load Done Current Service --------- ---------- -------- -- ------ --------- --------------- BBL 123456 simple 0 0 0 ( IDLE )
simpserv 00001.00001 GROUP1 1 4 200 ( IDLE ) WSL 00001.00010 GROUP1 10 0 0 ( IDLE )
到此Tuxedo客户端和服务器端的通信设置完毕了。 再开始下一步配置前,先关闭Tuxedo服务,在主机2上 [oracle@myapache simpapp]$tmshutdown -y
Shutting down all admin and server processes in /home/myTuxSrv/simpapp/tuxconfig Shutting down server processes ...
Server Id = 10 Group Id = GROUP1 Machine = simple: shutdown succeeded Server Id = 1 Group Id = GROUP1 Machine = simple: shutdown succeeded
Shutting down admin processes ...
Server Id = 0 Group Id = simple Machine = simple: shutdown succeeded 3 processes stopped.
[oracle@myapache simpapp]$
二、用Tuxedo Server作为数据库的客户端,来连接Oracle数据库服务器(使用Pro/C程序)
1.在/home/myTuxSrv/simpapp目录下编写一个Pro/C程序 [oracle@myapache simpapp]$cd /home/myTuxSrv/simpapp/ [oracle@myapache simpapp]$vi oracle_dome.pc 编辑以下程序 #include
#include \
EXEC SQL BEGIN DECLARE SECTION; char *uid = \ char name[20]; int id;
EXEC SQL END DECLARE SECTION;
void sqlerr() {
EXEC SQL WHENEVER SQLERROR CONTINUE; printf(\
EXEC SQL ROLLBACK WORK RELEASE; exit(1); }
int main(int argc, char* argv[]) {
EXEC SQL WHENEVER SQLERROR DO sqlerr(); EXEC SQL CONNECT :uid;
id = 10;
strcpy(name, \
EXEC SQL INSERT INTO T_TEST1 VALUES(:id, :name); EXEC SQL COMMIT WORK RELEASE; } (完)
2.把.pc原程序编译为.c程序
[oracle@myapache simpapp]$proc oracle_dome.pc
Pro*C/C++: Release11.2.0.1.0 - Production on Thu Mar 11 01:33:26 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
System default option values taken from:
/u01/app/oracle/product/11.2.0/client_1/precomp/admin/pcscfg.cfg [oracle@myapache simpapp]$ls
access.031010 oracle_dome.lis simpcl simpserv.c tuxconfig ubbsimple access.031110 oracle_dome.pc simpcl.c stderr tux.env ULOG.031010 oracle_dome.c README simpserv stdout ubb ULOG.031110 [oracle@myapache simpapp]$
3.编译oracle_dome.c程序文件
[oracle@myapache simpapp]$gcc oracle_dome.c -I $ORACLE_HOME/precomp/public -L $ORACLE_HOME/lib -lclntsh
[oracle@myapache simpapp]$gcc oracle_dome.c -o ora_demo -I $ORACLE_HOME/precomp/public -L $ORACLE_HOME/lib –lclntsh (默认生成a.out程序文件,加-o参数指定程序文件名为ora_demo) [oracle@myapache simpapp]$ls
access.031010 oracle_dome.c ora_demo simpcl.c stderr tux.env ULOG.031010 access.031110 oracle_dome.lis README simpserv stdout ubb ULOG.031110 a.out oracle_dome.pc simpcl simpserv.c tuxconfig ubbsimple [oracle@myapache simpapp]$./a.out [oracle@myapache simpapp]$./ora_demo
执行两遍该程序后,在Oracle数据库服务器(主机3)上可以看到多了两条记录 [root@ora11gR2 OraFile]#su - oracle [oracle@ora11gR2 ~]$sqlplus / as sysdba
SQL*Plus: Release11.2.0.1.0 Production on Thu Mar 11 01:42:53 2010 Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database11gEnterpriseEdition Release11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>conn hr/hr; Connected.
SQL>select * from t_test1; ZJ NAME ---------- -------------------- 1 aaa 10wilson 10wilson SQL>
三、把前面两步的操作整合到一起,使Tuxedo客户端通过Tuxedo Server访问Oracle数据库
这步要把oracle_dome.pc和simpserv.c整合到一起,完成数据库访问。在Tuxedo服务器(主机2)上操作
1.把oracle_dome.pc和simpserv.c两个程序合并到一起,成为ora_proc_demo.pc程序源文件 [oracle@myapache simpapp]$rm -rf simpserv (先把simpserv可执行程序删除)
[oracle@myapache simpapp]$cp simpserv.c ora_proc_demo.pc (把simpserv.c程序文件拷贝到ora_proc_demo.pc) [oracle@myapache simpapp]$ls
access.031010 oracle_dome.lis README stderr ubb access.031110 oracle_dome.pc simpcl stdout ubbsimple a.out ora_demo simpcl.c tuxconfig ULOG.031010 oracle_dome.c ora_proc_demo.pc simpserv.c tux.env ULOG.031110 [oracle@myapache simpapp]$
把oracle_dome.pc中的程序合并到ora_proc_demo.pc中
[oracle@myapache simpapp]$vi ora_proc_demo.pc (添加以下标红的3处修改) #include
#include /* TUXEDO Header File */ #include
/*①初始化内容,添加在前面*/ #include \
EXEC SQL BEGIN DECLARE SECTION; char *uid = \ char name[20];
int id;
EXEC SQL END DECLARE SECTION;
void sqlerr() {
EXEC SQL WHENEVER SQLERROR CONTINUE; printf(\ EXEC SQL ROLLBACK WORK RELEASE; exit(1); }
/* tpsvrinit is executed when a server is booted, before it begins processing requests. It is not necessary to have this function. Also available is tpsvrdone (not used in this example), which is called at server shutdown time. */
#if defined(__STDC__) || defined(__cplusplus) tpsvrinit(int argc, char *argv[]) #else
tpsvrinit(argc, argv) int argc; char **argv; #endif
{
/* Some compilers warn if argc and argv aren't used. */ argc = argc; argv = argv;
/*②该函数程序启动时只运行一遍,把连接数据库的程序加在这里*/ EXEC SQL WHENEVER SQLERROR DO slqerr(); EXEC SQL CONNECT :uid;
/* userlog writes to the central TUXEDO message log */ userlog(\ return(0); }
/* This function performs the actual service requested by the client. Its argument is a structure containing among other things a pointer to the data buffer, and the length of the data buffer. */
#ifdef __cplusplus extern \ #endif void
#if defined(__STDC__) || defined(__cplusplus)
TOUPPER(TPSVCINFO *rqst) #else TOUPPER(rqst) TPSVCINFO *rqst; #endif { int i;
for(i = 0; i < rqst->len-1; i++)
rqst->data[i] = toupper(rqst->data[i]);
/*③该函数每接受一次请求执行一次,把写数据库的程序添加到这里*/ id = strlen(rqst->data); strcpy(name, rqst->data);
EXEC SQL INSERT INTO T_TEST1 VALUES(:id, :name); EXEC SQL COMMIT;
/* Return the transformed buffer to the requestor. */ tpreturn(TPSUCCESS, 0, rqst->data,0L, 0); } (完)
2.编译合并后的程序源文件ora_proc_demo.pc [oracle@myapache simpapp]$proc ora_proc_demo.pc
Pro*C/C++: Release11.2.0.1.0 - Production on Thu Mar 11 02:45:42 2010 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
System default option values taken from:
/u01/app/oracle/product/11.2.0/client_1/precomp/admin/pcscfg.cfg
Error at line 16, column10 infile ora_proc_demo.pc #include /* TUXEDO Header File */ .........1
PCC-S-02015, unable to open include file
Error at line 17, column10 infile ora_proc_demo.pc #include
PCC-S-02015, unable to open include file
Syntax error at line 72, column 19, file ora_proc_demo.pc: Error at line 72, column19 infile ora_proc_demo.pc TOUPPER(TPSVCINFO *rqst) ..................1
PCC-S-02201, Encountered the symbol \ , )
Error at line 0, column0 infile ora_proc_demo.pc PCC-F-02102, Fatal error while doing C preprocessing [oracle@myapache simpapp]$
注意:出现了报错提示,是找不到Tuxedo的头文件。解决方法:修改Oracle Pro/C的配置文件,路径为:$ORACLE_HOME/precomp/admin/pcscfg.cfg [oracle@myapache simpapp]$vi
/u01/app/oracle/product/11.2.0/client_1/precomp/admin/pcscfg.cfg 添加标红内容:
sys_include=($ORACLE_HOME/precomp/public,/usr/include,/usr/lib/gcc/i386-redhat-linux/4.1.1/include,/usr/lib/gcc/i386-redhat-linux/3.4.5/include,/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/include,/usr/lib/gcc/i586-suse-linux/4.1.2/include,/usr/lib/gcc/i586-suse-linux/4.3/include,/bea/tux10/include) ltype=short (完)
再次编译合并后的.pc程序文件,成功
[oracle@myapache simpapp]$proc ora_proc_demo.pc
Pro*C/C++: Release11.2.0.1.0 - Production on Thu Mar 11 02:54:46 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
System default option values taken from:
/u01/app/oracle/product/11.2.0/client_1/precomp/admin/pcscfg.cfg [oracle@myapache simpapp]$ls
access.031010 oracle_dome.lis ora_proc_demo.lis simpcl.c tuxconfig ULOG.031010
access.031110 oracle_dome.pc ora_proc_demo.pc simpserv.c tux.env ULOG.031110 a.out ora_demo README stderr ubb
oracle_dome.c ora_proc_demo.c simpcl stdout ubbsimple [oracle@myapache simpapp]$
可以看到已经生成了ora_proc_demo.c程序文件,但要用Tuxedo的buildserver命令来编译,这里有几点要注意:
Tuxedo的include目录中也有sqlca.h头文件,为防止冲突,可以把它们移走 [oracle@myapache simpapp]$ls /bea/tux10/include/sql*
/bea/tux10/include/sqlca.h /bea/tux10/include/sqlda.h /bea/tux10/include/sqlcode.h 重命名为以下文件:
[oracle@myapache simpapp]$ls /bea/tux10/include/sql* /bea/tux10/include/sqlca.h.2010 /bea/tux10/include/sqlda.h.2010 /bea/tux10/include/sqlcode.h.2010
编译生成可执行文件
[oracle@myapache simpapp]$. ./tux.env
[oracle@myapache simpapp]$buildserver -f ora_proc_demo.c -o simpserv -s TOUPPER (出现错误提示)
需要把Oracle的库连接过来
[oracle@myapache simpapp]$buildserver -f ora_proc_demo.c -o simpserv -s TOUPPER -l \ (有一些警告提示,不影响程序使用) [oracle@myapache simpapp]$ ls
access.031010 oracle_dome.lis ora_proc_demo.lis simpcl.c stdout ubbsimple access.031110 oracle_dome.pc ora_proc_demo.pc simpserv tuxconfig ULOG.031010 a.out ora_demo README simpserv.c tux.env ULOG.031110 oracle_dome.c ora_proc_demo.c simpcl 已经生成了simpserv可执行程序 3.测试
在Oracle数据库服务器(主机3)上,以sysdba登录sqlplus,执行以下语句查看连接的用户情况 SQL>select sid, serial#, username from v$session; SID SERIAL# USERNAME
---------- ---------- ------------------------------ 34 3 40 1 41 362 SYS 现在只有一个SYS用户
在Tuxedo Server上启动simpserv服务程序 [oracle@myapache simpapp]$tmboot -y
Booting all admin and server processes in /home/myTuxSrv/simpapp/tuxconfig INFO: Oracle Tuxedo, Version10.3.0.0, 32-bit, Patch Level (none)
Booting admin processes ...
exec BBL -A :
process id=19565 ... Started.
Booting server processes ...
exec simpserv -A :
process id=19566 ... Started.
exec WSL -A -- -n//192.168.1.66:3200 -m 2 -M 5 -x 5 : process id=19567 ... Started. 3 processes started. [oracle@myapache simpapp]$
Tuxedo服务已经启动,在Oracle数据库服务器(主机3)上,再次执行以下语句 SQL>select sid, serial#, username from v$session; SID SERIAL# USERNAME ---------- ---------- ------------------------------ 26 1 29 2386 HR 30 2052 31 3 34 3 40 1 41 362 SYS 43 15
可以看到HR用户已经连接上来了
在主机1上发送2个请求
[root@tuxclient simpapp]#./client aleialei Returned string is: ALEIALEI
[root@tuxclient simpapp]#./client 垃圾广告 Returned string is: BOO垃圾广告
在主机3上可以看到结构 SQL>select * from HR.t_test1; ZJ NAME ---------- -------------------- 1 aaa 10wilson 10wilson 8 ALEIALEI 11 垃圾广告
至此本实验完成。
原$ORACLE_HOME/precomp/admin/pcscfg.cfg中sys_include有误,使proc预处理pc程序失败,安
装
结
束
后
,
应
设
为
sys_include=(/usr/include,/usr/lib/gcc
-lib/i386-redhat-linux/egcs-2.91.66/include) (视gcc版本而定) 1.4.2.1 Oracle 8
本来已经很少有人在LinuxKernel2.2的系统中安装Oracle8.0.5,但笔者实在怀念8.0.5纯粹的文本接口和与之相处的无数不眠之夜,故收录如下:
Oracle8在kernel为2.2.x的linux中是无法正常运行的,运行可执行档如svrmgrl,sqlplus时会导致“Segmentation fault”,原因在于这些linux使用了默认的libc2.1,与Oracle8程序重连接所需的libc2.0不兼容。Oracle的补丁程序其实是将Oracle可执行程序的重连接脚本中libc位置重新定位到libc2.0上去,并用旧版的gcc,ld重新连接可执行档。为此必须先在系统中安装兼容库和相应工具。这是权
宜之计,而且仅对RedHat有效。
Make –f makefile lib*
正在阅读:
tuxedo详细安装步骤04-29
统计学综合练习题04-30
公安部废止和修改的规章制度 - 图文11-17
计算科学导论文01-02
中秋节祝福短信给客户的范文_唯美的句子03-26
专题10-1 高考热点分析-奇招制胜2017高考历史热点+题型全突破 含解析 精品08-26
2010届高三英语上册第二次月考试题503-28
(最新)学校食堂工作人员岗位职责08-31
2013年11月机电考点特种类续期试卷203-18
议论文的基本体式07-10
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 步骤
- 安装
- tuxedo
- 详细
- 班主任经验交流
- 机械原理复习习题
- 彭诗彬活动备课《诗配画刮画》
- 初一上 悦读联播 完整版
- 基于低空无人飞行器的测绘遥感系统
- 关于举办临沂第二届读者杯中学生征文大赛的通知 2
- 财经类毕业论文:浅论企业会计信息失真的问题
- MAXx直读光谱仪期间核查作业指导书
- ”严纪律、转作风、保安全、树形象“第一阶段总结
- 《动物常见病防治》2018-2019期末试题及答案
- 钢的热处理
- 大学生就业观调查报告
- 北京工商大学2018年硕士研究生招生专业目录
- ABS的基本工作原理与故障诊断
- C++程序设计(第2版)课后习题答案
- 正弦函数余弦函数的图像和性质(2)
- 武汉市武昌区**路**小区国有出让土地使用权价格评估 - 图文
- 2018年带您走进西藏答案
- 《成本会计》在线考试(主观题)答案
- 水库调度技能培训题库(高级工)