Oracle V $ SESSION

Source: Internet
Author: User

Oracle V $ SESSION

SADDR session addressSID session identifier is often used to link other columns SERIAL # SID may be repeated. When the SID of two sessions is repeated, SERIAL # is used to differentiate sessions (in other words, a session is determined by sid and serial #) AUDSID audit session id. you can use audsid to query the sid of the current session. select sid from v $ session where audsid = userenv ('sessionid'); PADDR process address, associate the addr field of v $ process, you can query the sessionUSER # Of the process, which is equivalent to the user_id in dba_users, and the user # Of the internal process in Oracle is 0. USERNAME session's username. it is equal to username in dba_users. the username of the Oracle internal process is empty. the id of the SQL statement being executed by the COMMAND session. 1 indicates create table, and 3 indicates select. the current transaction address of TADDR. it can be used to associate the addr field in v $ transaction. LOCKWAIT can use this field to query information about the currently waiting lock. sid + lockwait corresponds to sid + kaddr in v $ loc. STATUS is used to determine the session STATUS. active: the SQL statement is being executed. inactive: Waiting for operation. killed: marked as killed. SERVER service type. SCHEMA # schema user id. schema # Of the Oracle internal process is 0. SCHEMANAME schema username. the internal process of Oracle is sys. the operating system username of the OSUSER client. PROCESS client process id. MACHINE Client machine name. the TERMINAL name executed by the terminal client. the PROGRAM client application .peat oracle.exeor sqlplus.exe TYPE session TYPE. SQL _ADDRESS, SQL _HASH_VALUE, SQL _ID, SQL _CHILD_NUMBER the status of the SQL session being executed, which corresponds to address, hash_value, SQL _id, child_number in v $ SQL. PREV_ SQL _ADDR, PREV_HASH_VALUE, PREV_ SQL _ID, and PREV_CHILD_NUMBER are the last SQL statement executed. MODULE, MODULE_HASH, ACTION, ACTION_HASH, and CLIENT_INFO are information set through DBMS_APPLICATION_INFO. FIXED_TABLE_SEQUENCE a value added after the session completes a user call. That is to say, if the session is suspended, it will not increase. therefore, you can monitor the session performance since a certain time point based on this field. for example, if the value of this field is 10000 for a session one hour ago and the current value is 20000, it indicates that the user call is frequent within an hour. You can focus on the performance statistics of this session. ROW_WAIT_OBJ # object_id of the table in which the row is locked. associate with object_id in dba_object to get the locked table name. ROW_WAIT_FILE # id of the datafile in which the row is locked. associate with file # In v $ datafile to get datafile name. ROW_WAIT_BLOCK # Same as above, corresponding block. ROW_WAIT_ROW # The row that the session is waiting. LOGON_TIME session logon time.

 

Query the session information of the locked object: SELECT OBJECT_NAME, MACHINE, S. SID, S. SERIAL # from gv $ LOCKED_OBJECT L, DBA_OBJECTS O, GV $ session s where l. OBJECT_ID = O. OBJECT_ID and l. SESSION_ID = S. SID; destroy SESSION: alter system kill session 'sid, # SERIAL '; view the statements executed by the current SESSION and SESSION information: select. SID,. SERIAL #,. USERNAME,. TERMINAL,. PROGRAM, S. SQL _TEXT FROM V $ SESSION A, V $ SQLAREA S WHERE. SQL _ADDRESS = S. ADDRESS (+) and. SQL _HASH_VALUE = S. HASH_VALUE (+) order by. USERNAME,. SID;

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.