timesten配置使用客户端连接timesten服务器

1、找到timesten配置文件:

[timesten@trgxtts info]$ ttVersion
TimesTen Release 11.2.2.8.0 (64 bit Linux/x86_64) (tt1122:53396) 2015-01-20T08:36:31Z
  Instance admin: timesten
  Instance home directory: /home/timesten/TimesTen/tt1122
  Group owner: ttadmin
  Daemon home directory: /home/timesten/TimesTen/tt1122/info
  PL/SQL enabled.
[timesten@trgxtts info]$ cd /home/timesten/TimesTen/tt1122/info
[timesten@trgxtts info]$ ls
cluster.oracle.ini  snmp.ini           timestend.pid       tterrors.log
DBI5af94776.2       sys.odbc.ini       ttcacheadvisor      ttmesg.log
DemoDataStore       sys.ttconnect.ini  ttendaemon.options
[timesten@trgxtts info]$ vi sys.odbc.ini

2、对sys.odbc.ini新增如下内容:

[timesten@trgxtts info]$ vi sys.odbc.ini
[ODBC Data Sources]
mydb_CS=TimesTen 11.2.2 Client Driver

[mydb_CS]
TTC_SERVER=mydb_test
TTC_SERVER_DSN=TT1122_new
UID=scott

[mydb_CS]跟[ODBC Data Sources]中mydb_CS一致。

TTC_SERVER跟sys.ttconnect.ini中[mydb_test]一致,这里只是在客户端odbc里面定义一个名称,具体服务端ip和端口,见客户端另一个ttconnect.ini配置文件。

TTC_SERVER_DSN跟sys.odbc.ini中一个可用的DSN一致(是服务端的一个可用的dsn)。

UID是上面的DSN对应的数据库的一个用户。

3、在timesten数据库中新增用户scott

ttisql TT1122_new
create user scott identified by tiger ;
grant connect,admin to scott ;

这部分内容见博客:

https://blog.csdn.net/kadwf123/article/details/80311469

4、配置客户端数据源:

查看服务器端服务端口:

[timesten@trgxtts info]$ ttstatus
TimesTen status report as of Tue May 15 10:45:28 2018

Daemon pid 2281 port 53396 instance tt1122
TimesTen server pid 2290 started on port 53397
------------------------------------------------------------------------
Data store /tmp/tt1122_new/TT1122_new
There are no connections to the data store
Replication policy  : Manual
Cache Agent policy  : Manual
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group ttadmin
End of report

关注这句:

TimesTen server pid 2290 started on port 53397

配置客户端数据源,新增如下内容:

[timesten@trgxtts info]$ vi sys.ttconnect.ini 
[mydb_test]
Description=TimesTen Server
Network_Address=10.45.11.93
TCP_PORT=53397

ip就是timesten服务器的ip地址,端口是timesten服务器的监听端口,ttstatus查出来的。[mydb_test]自己定义。

5、使用客户端连接测试:

[timesten@trgxtts info]$ ttisqlcs mydb_CS

Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.



connect "DSN=mydb_CS";
Enter password for 'scott': 
Connection successful: DSN=mydb_CS;TTC_SERVER=mydb_test;TTC_SERVER_DSN=TT1122_new;UID=scott;DATASTORE=/tmp/tt1122_new/TT1122_new;DATABASECHARACTERSET=US7ASCII;CONNECTIONCHARACTERSET=US7ASCII;TYPEMODE=0;
(Default setting AutoCommit=1)
Command> select * from timesten.newtab ;
< 10 >
1 row found.
Command> 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值