ITPub博客

首页 > Linux操作系统 > Linux操作系统 > v$session的解释

v$session的解释

原创 Linux操作系统 作者:mengzhaoliang 时间:2009-04-13 15:45:16 0 删除 编辑

在本视图中,每一个连接到数据库实例中的session都拥有一条记录。包括用户session及后台进程如DBWRLGWRarcchiver等等。

 

V$SESSION 中的常用列

V$SESSION 是基础信息视图,用于找寻用户SIDSADDR。不过,它也有一些列会动态的变化,可用于检查用户。如例:

 

字段解释:

字段1SARRD: raw(4)Session Address,session的地址

字段2SIDRAW(4):Session Identifier,session的标识符

字段3SERIAL# NUMBER

Session serial numberSession的序列号。 Used to identify uniquely 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

如果某个SID又被其它的session使用的话则此数值自增加(当一个 SESSION 结束,另一个SESSION开始并使用了同一个SID)

字段4AUDSIDnumberAuditing session ID

审查session ID唯一性,确认它通常也用于当寻找并行查询模式。

字段5PARRDRAW(4):Address of the process that owns this session

这个session拥有的进程地址

 

 

字段6USER#numberOracle user identified

Oracle用户的标识符

字段7USERNAMEvarchar2(30):Oracle username,Oracle的用户名

字段8COMMAND:number:

Command in progress (last statement parsed); for a list of values, see Table 3-7

session 的命令所对应的sql对应数字值:默认为0

字段8OWNERID NUMBER 
The column contents are invalid if the value is 2147483644. Otherwise, this column contains the identifier of the user who owns the migratable session

For operations using Parallel Slaves, interpret this value as a 4Byte value. The low-order 2Bytes of which represent the session number, and the high-order bytes the instance ID of the query coordinator

字段9TADDRVARCHAR2(8) Address of transaction state object 

事务状态对象的地址

字段10LOCKWAIT VARCHAR2(8) 
Address of lock waiting for; NULL if none 

锁等待的地址,如果为空的话则没有等待

 

 

字段11STATUS VARCHAR2(8) 
Status of the session: ACTIVE (currently executing
SQL), INACTIVE, KILLED (marked to be killed), CACHED (temporarily cached for use by Oracle*XA), SNIPED (session inactive, waiting on the client) 

这列用来判断session状态是:

Active :活动状态,正执行SQL语句

Inactive :不活动状态

Killed :被标注为删除

CachedOracle中的临时缓冲区使用

SNIPEDsession不活动,等待客户端操作

字段12SERVER VARCHAR2(9) 
Server type: DEDICATED, SHARED, PSEUDO, NONE 

使用连接数据库服务器的类型

DEDICATED:专用服务器

SHARED:共享服务器

PSEUDO

NONE

字段13SCHEMA# NUMBER 
Schema user identifier 

Schema 用户标识符所对应的数字值

字段14SCHEMANAME VARCHAR2(30) 
Schema user name 

Schema的用户名

字段15OSUSER VARCHAR2(15) 
Operating system client user name 

客户端操作系统的用户名

 

 

字段16PROCESS 
VARCHAR2(9) 
Operating system client process ID 

客户端操作系统的进程ID(标识符)

字段17MACHINE 
VARCHAR2(64) 
Operating system machine name 

连接数据库的客户端操作系统的机器名称

字段18TERMINAL 
VARCHAR2(10) 
Operating system terminal name 

连接数据库的客户端操作系统的终端名称

字段19PROGRAM 
VARCHAR2(48) 
Operating system program name 

连接数据库的客户端操作系统的进程名称

字段20TYPE 
VARCHAR2(10) 
Session type 

Session的类型

 

 

字段21SQL_ADDRESS 
RAW(4) 
Used with SQL_HASH_VALUE to identify the SQL statement that is currently being executed 

当前正在执行的SQL语句的SQL_HASH_VALUE

 

字段22SQL_HASH_VALUE 
NUMBER 
Used with SQL_ADDRESS to identify the SQL statement that is currently being executed 

当前正在执行的SQL语句的SQL_ADDRESS

SQL_HASH_VALUE SQL_ADDRESS:这两列用于鉴别默认被session执行的SQL语句。如果为null0,那就说明这个session没有执行任何SQL语句。PREV_HASH_VALUEPREV_ADDRESS两列用来鉴别被session执行的上一条语句。

字段23SQL_ID

VARCHAR2(13)

SQL identifier of the SQL statement that is currently being executed

正在执行的SQL语句的标识符

字段24SQL_CHILD_NUMBER

number

Child number of the SQL statement that is currently being executed

字段25PREV_SQL_ADDR

raw4

Used with PREV_HASH_VALUE to identify the last SQL statement executed

 

 

字段26PREV_HASH_VALUE

Number

Used with SQL_HASH_VALUE to identify the last SQL statement executed

字段27PREV_SQL_ID

Varchar213

SQL identifier of the last SQL statement executed

Table 7-5 COMMAND Column of V$SESSION and Corresponding Commands

Number Command Number Command

1

CREATE TABLE

2

INSERT

3

SELECT

4

CREATE CLUSTER

5

ALTER CLUSTER

6

UPDATE

7

DELETE

8

DROP CLUSTER

9

CREATE INDEX

10

DROP INDEX

11

ALTER INDEX

12

DROP TABLE

13

CREATE SEQUENCE

14

ALTER SEQUENCE

15

ALTER TABLE

16

DROP SEQUENCE

17

GRANT OBJECT

18

REVOKE OBJECT

19

CREATE SYNONYM

20

DROP SYNONYM

21

CREATE VIEW

22

DROP VIEW

23

VALIDATE INDEX

24

CREATE PROCEDURE

25

ALTER PROCEDURE

26

LOCK

27

NO-OP

28

RENAME

29

COMMENT

30

AUDIT OBJECT

31

NOAUDIT OBJECT

32

CREATE DATABASE LINK

33

DROP DATABASE LINK

34

CREATE DATABASE

35

ALTER DATABASE

36

CREATE ROLLBACK SEG

37

ALTER ROLLBACK SEG

38

DROP ROLLBACK SEG

39

CREATE TABLESPACE

40

ALTER TABLESPACE

41

DROP TABLESPACE

42

ALTER SESSION

43

ALTER USER

44

COMMIT

45

ROLLBACK

46

SAVEPOINT

47

PL/SQL EXECUTE

48

SET TRANSACTION

49

ALTER SYSTEM

50

EXPLAIN

51

CREATE USER

52

CREATE ROLE

53

DROP USER

54

DROP ROLE

55

SET ROLE

56

CREATE SCHEMA

57

CREATE CONTROL FILE

59

CREATE TRIGGER

60

ALTER TRIGGER

61

DROP TRIGGER

62

ANALYZE TABLE

63

ANALYZE INDEX

64

ANALYZE CLUSTER

65

CREATE PROFILE

66

DROP PROFILE

67

ALTER PROFILE

68

DROP PROCEDURE

70

ALTER RESOURCE COST

71

CREATE MATERIALIZED VIEW LOG

72

ALTER MATERIALIZED VIEW LOG

73

DROP MATERIALIZED VIEW LOG

74

CREATE MATERIALIZED VIEW

75

ALTER MATERIALIZED VIEW

76

DROP MATERIALIZED VIEW

77

CREATE TYPE

78

DROP TYPE

79

ALTER ROLE

80

ALTER TYPE

81

CREATE TYPE BODY

82

ALTER TYPE BODY

83

DROP TYPE BODY

84

DROP LIBRARY

85

TRUNCATE TABLE

86

TRUNCATE CLUSTER

91

CREATE FUNCTION

92

ALTER FUNCTION

93

DROP FUNCTION

94

CREATE PACKAGE

95

ALTER PACKAGE

96

DROP PACKAGE

97

CREATE PACKAGE BODY

98

ALTER PACKAGE BODY

99

DROP PACKAGE BODY

100

LOGON

101

LOGOFF

102

LOGOFF BY CLEANUP

103

SESSION REC

104

SYSTEM AUDIT

105

SYSTEM NOAUDIT

106

AUDIT DEFAULT

107

NOAUDIT DEFAULT

108

SYSTEM GRANT

109

SYSTEM REVOKE

110

CREATE PUBLIC SYNONYM

111

DROP PUBLIC SYNONYM

112

CREATE PUBLIC DATABASE LINK

113

DROP PUBLIC DATABASE LINK

114

GRANT ROLE

115

REVOKE ROLE

116

EXECUTE PROCEDURE

117

USER COMMENT

118

ENABLE TRIGGER

119

DISABLE TRIGGER

120

ENABLE ALL TRIGGERS

121

DISABLE ALL TRIGGERS

122

NETWORK ERROR

123

EXECUTE TYPE

157

CREATE DIRECTORY

158

DROP DIRECTORY

159

CREATE LIBRARY

160

CREATE JAVA

161

ALTER JAVA

162

DROP JAVA

163

CREATE OPERATOR

164

CREATE INDEXTYPE

165

DROP INDEXTYPE

167

DROP OPERATOR

168

ASSOCIATE STATISTICS

169

DISASSOCIATE STATISTICS

170

CALL METHOD

171

CREATE SUMMARY

172

ALTER SUMMARY

173

DROP SUMMARY

174

CREATE DIMENSION

175

ALTER DIMENSION

176

DROP DIMENSION

177

CREATE CONTEXT

178

DROP CONTEXT

179

ALTER OUTLINE

180

CREATE OUTLINE

181

DROP OUTLINE

182

UPDATE INDEXES

183

ALTER OPERATOR

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12778571/viewspace-588832/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2008-01-30

  • 博文量
    335
  • 访问量
    2913620