看了看oracle联机文档中关于v$session 的介绍 这是一个相当重要的动态视图。摘抄下来和大家分享
v%session displays session information for each current session;
这句话说明v$session视图显示的是当前会话的信息,要注意是当前会话。
下面介绍每个字段和每个字段的含义
column description
saddr session address 当前会话在内存中的地址。
sid session identifier 当前会话的id号。
serial# session serial number.used to uniquely identify a
session's objects.guarantees that session-level commands
are applied to the correct session object if then session
ends and another session begins with the same session ID;
会话的串号。被用来唯一确定会话的对象。在会话结束后另一个会话用相同的
会话id连接时,保证在会话级别的命令可以应用到正确的对象上去。
audsid auditing session id 审计会话id
paddr address of the process that owns the session
用户会话的对应的进程地址 关联v$process 的addr字段.可以通过该字段
查询当前会话对应操作系统的进程号
user# oracle user identifier 用户id 对应dba_users 的user_id字段
username oracle username
command command in progress(last statement parsed).for a list of values,
see table 9-2.these values also appear in the audit_actions table
执行的命令,9-2表可以看到关于这些值的信息。这些信息值出现在
audit_actions表中。此字段的值是数字。要与下表对应。
ownerid identifier of the user who owns the migratable session ;the column
contents are invalid if the value is 2147483644.
for operation using parallel slaves,interpret this value as a 4 byte value
the low-order 2 bytes represent the session number and the high-order bytes
represent the instance id of the query coordinator.
tadd address of the transaction state object 事物的地址
关联v$transaction 的addr 通过这个字段可以查询正在使用的回滚段的情况,以及
事情的信息。
lockwait address of the lock the session is waiting for ; null if none;
当前会话正在等待锁的地址,如果没有则为null;
status status of the session :当前会话的状态
* active-session currently executing sql。当前会话正在执行sql.
* inactive-session which is inactive and either has no configured
limits or has not yet exceeded the configured limits.
会话是不活动状态,既没有设置限制也没有超过限制。
* killed-session marked to be killed.会话被标示为已杀掉
* CACHED -session temporarily cached for use by oracle *xa
会话被临时缓存起来。
* sniped -an inactive session that has exceeded some configured
limits(for example,resource limits specified for the resource manage
consumer group or idle_time specified in the user's profile). such
session will not be allowed to become active again.
(被剪断的) 一个不是活跃的会话超过了配置限制(例如,在用户的配置文件中的
一些资源)这些会话不能转变成活动的会话。
server server type:数据库提供服务的方式
* dedicated 专有模式 ,一个会话一个进程。
* shared 共享模式
schema# schema user identifier. schema id
schemaname schema user name
osuser operating system client user name
会话的客户端系统的用户名。
process operating system client process id:会话客户端进程id号
如果有线程的话,线程号也显示出来。
machine operating system machine name :操作系统主机名
port client port number:客户端连接端口号
terminal operating system terminal name:操作系统中端名称
program operating system program name:操作系统通过运行什么程序连接oracle
type session type:创建会话的类型,是用户创建还是后台进程创建的等
sql_address 内存地址used with sql_hash_value to identify the sql statement that is
is currently being executed:通过sql_hash_value确定正在执行的sql语句
sql_hash_value used with sql_address to identify the sql statement that is
currently being executed:通过sql_address 在做hash来唯一确定
正在执行sql语句 关联v$sql,v$sqltext,v$sqlarea.
sql_id sql identifier of the sql statement that is currently being
executed:标示会话正在执行sql语句的id号
sql_child_number child number of the sql statement that is currently being
executed:正在执行sql的子号
sql_exec_start time when the execution of the sql currently executed by this
session started; null if sql_id is null;
当前sql执行开始时间,如果sql_id为空则此项也为空。
sql_exec_id sql execution identifier;null if sql_id is null or if the
execution of that sql has not yet started(see v$sql_monitor)
-----------未完待续