更改Oracle JDBC瘦客户端标识符 [英] Change Oracle JDBC Thin Client Identifier

查看:122
本文介绍了更改Oracle JDBC瘦客户端标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

连接到Oracle时,JDBC驱动程序将自己标识为Oracle的"JDBC Thin Client"(在v $ session中为程序"). v $ session中还有一个"ClientInfo"列可用于此目的,但始终为空.

When connecting to Oracle the JDBC driver identifies itself as "JDBC Thin Client" to Oracle (in v$session as the 'program'). There is also a 'ClientInfo' column in v$session that might be used for this, but it's always empty.

我们需要确定连接到Oracle的不同应用程序(它们在同一主机上运行,​​因此v $ session中的计算机"列都是相同的),因此可以更改Oracle JDBC Thin的方式客户端驱动程序会标识自己(例如,可以在其中输入应用程序名称)?

We have a need to identify different applications connecting to Oracle (which are running on the same host, so the 'machine' column in v$session is all the same), so is it possible to change how the Oracle JDBC Thin Client driver identifies itself (so we could put the application name in, for example)?

还是有推荐的方法来做到这一点?一个限制是我们在Struts中为某些应用程序执行此操作,这些应用程序在内部处理连接设置.

Or is there a recommended way to do this? One restriction is that we're doing this within Struts for some of the applications, which is handling the connection setup internally.

推荐答案

SQL>select username,osuser,program,machine
from v$session
where username = 'ROB'; 

USERNAME  OSUSER       PROGRAM             MACHINE
--------- -----------  ------------------  -----------
ROB       rmerkw       My Program Name     machine

在应用程序级别,您可以使用以下方法在 v $ session client_info module action . >:

At application level you can use the following methods to set client_info, module and action in v$session:

dbms_application_info.set_client_info
dbms_application_info.set_module
dbms_application_info.set_action

这篇关于更改Oracle JDBC瘦客户端标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆