暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 按C # 代码设置客户端标识符

ASKTOM 2019-09-26
308

问题描述

i'm trying to set the Client info in my C#-Application just by calling the Package 'DBMS_APPLICATION_INFO.SET_CLIENT_INFO'.

I notice that, my value is displayed under the 'OSUSER'-Column (V$session-View).

I expected, that my value appear unter the 'CLIENT_IDENTIFIER'-Column.

Here is the Code Section:

using (var cmd = new OracleCommand())
                    {
                        cmd.CommandType = System.Data.CommandType.StoredProcedure;
                        cmd.Connection = connection;
                        cmd.CommandText = "DBMS_APPLICATION_INFO.SET_CLIENT_INFO";

                        cmd.Parameters.Add("client_info", OracleDbType.Varchar2, "MYVALUE123", System.Data.ParameterDirection.Input);

                        connection.Open();
                        cmd.ExecuteNonQuery();
                    }


Can you please tell me how i can solve that

Thanks,
Anouar

专家解答

这里有几件事

1) 我从未见过OSUSER填充了对DBMS_APPLICATION_INFO的调用。我需要看看一些证据。

2) CLIENT_INFO和CLIENT_IDENTIFIER是不同的东西 (都在v $ session中)

客户端 _ 信息-由DBMS_APPLICATION_INFO设置。只包含你喜欢的任何信息。
CLIENT_IDENTIFIER-由DBMS_SESSION设置被各种东西用于连接池、安全上下文和代理用户。

希望这有所帮助。
文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论