使用Oracle Call Interface(OCI)设置操作系统用户

huangapple go评论89阅读模式
英文:

Setting OS User with Oracle Call Interface (OCI)

问题

我正在尝试在golang的Oracle数据库连接设置中更改传递给Oracle的操作系统用户(OS User)。类似于在Java JDBC驱动程序中设置v$session.osuser。我正在尝试修改mattn的go-oci8 Oracle驱动程序,以便我可以动态更改操作系统用户的值。我尝试在open方法中添加conn.attrs.Set("os_user", "test_os_user")

我已经查阅了OCI文档,并且我认为我可能需要设置OCI_ATTR_CLIENT_IDENTIFIER,但我无法确定这是否正确以及如何实现。有没有办法使用OCI更改osuser的值?

英文:

I'm trying to change the OS User that is passed to Oracle during database connection set up in golang oracle oci-8 driver. This is in a similar way to setting the v$session.osuser in the Java JDBC drivers. I'm trying to modify mattn's go-oci8 oracle driver so I can change the os user value on the fly. I've tried adding conn.attrs.Set("os_user", "test_os_user") in the open method.

I've trawled through the oci docs and I think I might need to set OCI_ATTR_CLIENT_IDENTIFIER but I can work out if this is correct or how to do it. Any ideas if it is possible (and how) to change the osuser value using OCI?

Cheers

答案1

得分: 0

似乎无法使用OCI驱动程序设置操作系统用户。Oracle文档中指出,只有在使用Oracle Java Thin驱动程序时才能设置操作系统用户。

英文:

It appears that it is not possible to set the OS User with the OCI driver. The Oracle documentation for Java highlights that setting the OS User is only possible when the oracle Java Thin driver is used.

huangapple
  • 本文由 发表于 2014年9月30日 15:57:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/26115614.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定