Oracle 视图 V$SESSION_CONNECT_INFO 官方解释,作用,如何使用详细说明

本站中文解释

Oracle 视图 V$SESSION_CONNECT_INFO 是一个动态性能视图,统计关于用户和数据库会话连接信息。它存储来自诸如v$session、v$session_longops和v$process之类的动态性能视图的信息。此视图所提供的信息可帮助用户快速了解会话的建立方式、当前连接的储存状态、用户的服务名等。

使用此视图的最常见的场景是,诊断正在连接数据库的用户或过去的连接信息。通过根据SID和SERIAL#查询 V$SESSION_CONNECT_INFO 视图,可以查看详细的用户连接信息,其中包括连接方式、登录IP、服务名等,用来更好的诊断问题及跟踪数据库连接信息。

例如,可用以下面的查询语句确定用户username正在通过哪种方式进行连接:

SELECT PROTOCOL
FROM V$SESSION_CONNECT_INFO
WHERE USERNAME = ‘username’;

另外,还可以使用 v$session_connect_info视图来查看在某个时间点以前正在进行数据库会话的用户列表:

SELECT USERNAME, LOGON_TIME
FROM V$SESSION_CONNECT_INFO
WHERE LOGON_TIME

官方英文解释

V$SESSION_CONNECT_INFO displays information about network connections for all currently logged in sessions.

Column Datatype Description

SID

NUMBER

Session identifier (can be used to join this view with V$SESSION)

SERIAL#

NUMBER

Session serial number. Used to uniquely identify a session’s objects. Guarantees that session-level commands are applied to the correct session objects if the session ends and another session begins with the same session ID. (Can be used to join this view with V$SESSION.)

AUTHENTICATION_TYPE

VARCHAR2(26)

How the user was authenticated:

  • DATABASE – Username/password authentication

  • OS – Operating system external user authentication

  • NETWORK – Network protocol or ANO authentication

  • PROXY – OCI proxy connection authentication

  • SERVER

  • PASSWORD

  • EXTERNAL ADAPTERS

  • INTERNAL

  • GLOBAL

  • EXTERNAL

  • PASSWORD BASED GLOBAL USER

OSUSER

VARCHAR2(128)

External username for this database user

NETWORK_SERVICE_BANNER

VARCHAR2(4000)

Product banners for each Oracle Net service used for this connection (one row per banner)

CLIENT_CHARSET

VARCHAR2(40)

Client character set as specified in the NLS_LANG environment variable or in the OCIEnvNlsCreate() call; Unknown if the Oracle client is older than release 11.1 or the connection is through the JDBC thin driver

CLIENT_CONNECTION

VARCHAR2(13)

Client server connection flags:

  • Heterogeneous

  • Homogeneous

CLIENT_OCI_LIBRARY

VARCHAR2(27)

OCI client library:

  • Home-based

  • Full Instant Client

  • XE Instant Client

  • Light Weight Instant Client

  • OCI

  • Unknown

CLIENT_VERSION

VARCHAR2(40)

Client library version number

CLIENT_DRIVER

VARCHAR2(30)

Client driver name

CLIENT_LOBATTR

VARCHAR2(23)

Client LOB flags:

  • Client Temp Lob Rfc On

  • Client Temp Lob Rfc Off

CLIENT_REGID

NUMBER

Query cache registration ID sent by the client

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data

See Also:

“V$SESSION”


数据运维技术 » Oracle 视图 V$SESSION_CONNECT_INFO 官方解释,作用,如何使用详细说明