Closed kenime closed 4 years ago
In JDBC driver we can set some connection properties regarding v$session (e.g. v$session.osuser). Is it available in this package?
I have this issue also, anyone can help please...
Can you explain what the business issue is? At a guess, you are trying to run a mixed language environment and have some monitoring etc dependent on v$session?
The connection properties you can set in node-oracledb are shown in the documentation: https://oracle.github.io/node-oracledb/doc/api.html#connectionproperties
The one you would want to think about using isconnection.clientId
.
I've not seen/known/needed anyway to override osuser in Oracle's C API, so there is no API to do this in node-oracledb.
@kenime @virt888 can you explain what the business issue and requirements are?
It is mainly for monitoring and reporting purpose. As my company's reporting system will aggregate the user and program in v$session, our java based program will configure these 2 fields as meaningful names via the JDBC driver.
@kenime request noted. (Though it sounds like a hack to alter those two particular attributes).
Use the available settings in node-oracledb and query v$session
and v$session_connect_info
. I have an open task to natively support setting CLIENT_INFO (i.e. OCI_ATTR_CLIENT_INFO) which would be the better place to identify your application. Currently you can set it with an explicit round trip call to DBMS_APPLICATION_INFO.SET_CLIENT_INFO()
You can encapsulating Node inside software container ex. Docker and started it on desired user.
We'll add attributes for setting CLIENT_INFO and DBOP in node-oracledb 4.1.
For other changes, can you work with Oracle Support to request changes to the Oracle Call Interface layer?
We'll add attributes for setting CLIENT_INFO and DBOP in node-oracledb 4.1.
Is there a way to expose info fileds length (for example oracledb.CLIENT_INFO_LENGTH
) as part of this change?
client_info
Supplies any additional information about the client application. This information is stored in the V$SESSION view. Information exceeding 64 bytes is truncated.
module_name
Name of module that is currently running. When the current module terminates, call this procedure with the name of the new module if there is one, or NULL if there is not. Names longer than 48 bytes are truncated.
action_name
Name of current action within the current module. If you do not want to specify an action, this value should be NULL. Names longer than 32 bytes are truncated.
node-oracledb is simply passing a string down, see dpiConn__setAttributeText(). These internal calls are effectively like DBMS_APPLICATION_INFO.SET_CLIENT_INFO calls. There is no initial lookup to find max lengths - that would cost a round trip.
To follow up, node-oracledb 4.1 is out and has the new clientInfo and dbOp properties (in addition to the previous end-to-end tracing properties.
In JDBC driver we can set some connection properties regarding v$session (e.g. v$session.osuser). Is it available in this package?