Setting OS User with Oracle Call Interface (OCI)

2019-08-27 21:15发布

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

标签: oracle go oci oci8
1条回答
神经病院院长
2楼-- · 2019-08-27 22:00

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.

查看更多
登录 后发表回答