您的位置:首页 > 其它

TimesTen中如何标识客户端连接

2016-04-03 20:20 260 查看
有时需要在数据库中分辨客户端的连接,在客户端中指定connectionname属性即可。

在编程中可以设定此属性,在ttisql中,可以用connect….as connectionname命令。

缺省情况下,connectionname使用的是DSN的名字,如下

[oracle@localhost info]$ ttisql "dsn=plsqldb;connectionname=client1"
Command> call ttconfiguration('connectionname');
< ConnectionName, client1 >
1 row found.
在OS中查看
[oracle@localhost info]$ ttstatus plsqldb
TimesTen status report as of Sun Apr  3 05:14:02 2016

Daemon pid 2045 port 53392 instance tt1122
No TimesTen server running
------------------------------------------------------------------------
Data store /home/oracle/app/oracle/product/TimesTen/tt1122/info/DemoDataStore/plsqldb/plsqldb
There are 12 connections to the data store
Shared Memory KEY 0x12410778 ID 2555917
PL/SQL Memory KEY 0x13410778 ID 2588686 Address 0x16000000
Type            PID     Context     Connection Name              ConnID
Process         13498   0x08277948  **client1**                           1
......


也可以在connect命令中指定,如下:

[oracle@localhost info]$ ttisql

Copyright (c) 1996-2011, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.

Command> connect plsqldb as client2;
Command> call ttconfiguration('connectionname');
< ConnectionName, client2 >
1 row found.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: