亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
123下一頁
最近訪問板塊 發(fā)新帖
查看: 10063 | 回復(fù): 25
打印 上一主題 下一主題

[Tuxedo] 我遇到和別人的帖子相同的問題,Tuxedo連接Oracle的問題。 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2009-06-27 06:01 |只看該作者 |倒序瀏覽
20可用積分
=======================================
原貼描述:
===========================================
客戶程序如下:我oracle10只有一個數(shù)據(jù)庫是orcl
oracleclient.c
#include <stdio.h>
#include <atmi.h>
#include <string.h>
#include <stdlib.h>
int main(int argc,char *argv[])
{
        char *sendbuf,*recvbuf;
        long sendlen,recvlen;
        int ret;
        if(argc!=2){
                printf("please call the format as : oracleclient %s \n",argv[0]);
                (void) fprintf(stderr, "Usage: oracleclient string\n");
                exit(1);
        }
        if(tpinit((TPINIT *)NULL)==-1){
                (void)fprintf(stderr,"failed to init!\n");
                exit(1);
        }
        sendlen=strlen(argv[1]);
        if((sendbuf=(char *)tpalloc("STRING",NULL,sendlen+1))==-1){
                (void)fprintf(stderr,"failed to allocate memory to sendbuf!\n");
                tpterm();
                exit(1);
        }
        if((recvbuf=(char *)tpalloc("STRING",NULL,5*sendlen+1))==-1){
                (void)fprintf(stderr,"failed to allocate memory for recvbuf!\n");
                tpterm();
                exit(1);
        }
        strcpy(sendbuf,argv[1]);
        ret = tpcall("ORACLES", (char *)sendbuf, 0, (char **)&recvbuf, &recvlen, (long)0);
        if(ret==-1){
                (void) fprintf(stderr, "Can't send request to service oracleserver\n");
                (void) fprintf(stderr, "Tperrno = %d, %s\n, ", tperrno, tpstrerror(tperrno));
                tpfree(sendbuf);
                tpfree(recvbuf);
                tpterm();
                exit(1);
        }
        (void)fprintf(stdout,"the return result is :%s \n",recvbuf);
        tpfree(sendbuf);
        tpfree(recvbuf);
        tpterm();
        return 0;
}


服務(wù)器server程序如下:
oracleserv.pc

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <atmi.h>
#include <userlog.h>
exec sql include sqlca;

tpsvrinit(int argc,char *argv[])
{
        if(tpopen()==-1){
                printf("error to connect to oracle!\n");
        }
        printf("the oracleserv successfully to connect to db2 in linux!\n");
        return 0;
}

ORACLES(TPSVCINFO *rqst)
{
        exec sql begin declare section;
                char db_string[50];
        exec sql end declare section;
        int i=0;
        for(i=0;i<rqst->len-1;i++){
                db_string=rqst->data;
        }
        exec sql delete from system.hmptest where username=:db_string;
        if(sqlca.sqlcode!=0){
                printf("delete error!\n");
                tpreturn(TPFAIL,0,NULL,0,0);
        }
        tpreturn(TPSUCCESS,0,rqst->data,0L,0);
}

tpsvrdone()
{
        if(tpclose()==-1){
                printf("oracleserv close error!\n");
                return;
        }
        printf("oracleserv disconnected!\n");
        return;
}

編譯完全通過:
proc oracleserv.c parse=full include=/home/oracle/oracle/product/10.2.0/db_1/precomp/public include=/home/tuxedo/bea/tuxedo9.1/include

buildserver -o oracleserv -f "oracleserv.c -I/home/oracle/oracle/product/10.2.0/db_1/precomp/public" -r Oracle_XA -s ORACLES

沒有錯誤。。正常運行
buildclient -o oracleclient -f oracleclient.c

但是那個exec sql delete from system.hmptest where username=:db_string;,..為什么不能執(zhí)行
我的RM文件里用戶密碼是system/oracle

在sqlplus 里system/oracle能完全操作hmptest數(shù)據(jù)表。。。

===========================================

[ 本帖最后由 simhare 于 2009-6-29 11:09 編輯 ]

最佳答案

查看完整內(nèi)容

一試便知。

論壇徽章:
0
2 [報告]
發(fā)表于 2009-06-27 06:01 |只看該作者
一試便知。

論壇徽章:
0
3 [報告]
發(fā)表于 2009-06-27 06:03 |只看該作者

回復(fù) #1 simhare 的帖子

有人說"在tpsvrinit()中打開數(shù)據(jù)庫!"
============================
怎么"在tpsvrinit()中打開數(shù)據(jù)庫!"?
我是這么做的:
tpsvrinit(int argc,char *argv[])
{

      EXEC SQL BEGIN DECLARE SECTION;
                char  *uid="pw/pw@wilson";
                float salary;
        EXEC SQL END DECLARE SECTION;   
        EXEC SQL CONNECT :uid;
        if(tpopen()==-1){
                printf("error to connect to oracle!\n");
        }
        printf("the oracleserv successfully to connect to db2 in linux!\n");
        return 0;
}
這樣可以嗎?

論壇徽章:
0
4 [報告]
發(fā)表于 2009-06-28 11:17 |只看該作者

回復(fù) #3 ziggler 的帖子

---------------
試了很多方法,都不通。一直是用tmboot時就failed。
---------------

論壇徽章:
0
5 [報告]
發(fā)表于 2009-06-28 11:20 |只看該作者

回復(fù) #1 simhare 的帖子

------------------
后來我選擇了XA的通訊方式:
=================
請問在OpenInfo一節(jié)的sqlNet=Orcl
這里的Orcl是別人的配置,我應(yīng)該怎么找出自己的配置呢?
===========

論壇徽章:
0
6 [報告]
發(fā)表于 2009-06-28 11:23 |只看該作者

回復(fù) #1 simhare 的帖子

用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.
==================
以上這些我都做過了

論壇徽章:
0
7 [報告]
發(fā)表于 2009-06-28 11:26 |只看該作者

回復(fù) #1 simhare 的帖子

二、TUXEDO的配置

1、修改$TUXDIR/udataobj/RM文件
把原來的以O(shè)racle_XA: xaosw:開頭的屏蔽掉、
添加Oracle_XA: xaosw: -L${ORACLE_HOME}/lib -lclntsh

2、創(chuàng)建TMS文件:TMS_ORA10g,TUXEDO通過TMS_ORA10g與ORACLE數(shù)據(jù)庫采用XA協(xié)議進行通訊

buildtms -o $TUXDIR\bin\TMS_ORA10g -r Oracle_XA
====================
以上這些,我也做過了,不過我用的用戶是oracle,所以我的buildtms命令是:buildtms /home/oracle/simpapp/TMS_ORA10 -r Oracle_XA

[ 本帖最后由 simhare 于 2009-6-28 11:28 編輯 ]

論壇徽章:
0
8 [報告]
發(fā)表于 2009-06-28 11:36 |只看該作者

回復(fù) #1 simhare 的帖子

*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"
===================
這一節(jié),我用的是OPENINFO="ORACLE_XA:Oracle_XA+Acc=P/scott/tiger+SesTm=100+LogDir=..+MaxCur=5"
===================
我不知道sqlNet=ORCL應(yīng)該怎么設(shè)置?

論壇徽章:
0
9 [報告]
發(fā)表于 2009-06-28 11:38 |只看該作者

回復(fù) #1 simhare 的帖子

===============
忘了說我的環(huán)境:
CentOS+Oracle11g+Tuxedo10
===============

論壇徽章:
0
10 [報告]
發(fā)表于 2009-06-28 11:39 |只看該作者

回復(fù) #1 simhare 的帖子

=========
做過這個的很少嗎?怎么沒有多少人呢?
哪位高手做過,給各提示吧?謝謝!!
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP