V $ session table ^ _ ^ Selected from www.cnong.org http://www.cnoug.org/viewthread.php?tid=38191v (^ ^ ^ ^ ^ ^ ^ ^ ^
SID, Serial #
With SID we can query various statistics related to this session to process information.
a. Select * from v $ sesstat where sid =: sID;
Query users related statistics.
Select A.SID, A.Statistic #, B.Name, A.Value
From V $ SESSSTAT A, V $ STATNAME B
Where a.statistic # = B.Statistic #
And A.SID =: SID;
b. Query users related IO statistics
Select * from v $ sess_io where sid =: sID;
c. Query the user wants the cursor variable that is being opened.
Select * from V $ OPEN_CURSOR WHERE SID =: SID;
d. Query the current wait information of the user. To see why the current statement is so slow / waiting for what resources waiting.
Select * from v $ session_wait where sid =: sID;
e. Query the information of the various events waiting for users within a while. To understand the bottlenecks encountered in this session ^ _ ^
Select * from v $ session_event where sid =: sID;
f. Also, when we want Kill current session, you can process it via SID, Serial #.
Alter System Kill Session ': SID,: SERAIL #';
2. Paddr. Field, Process Addr, through this field we can view information about the current process, system process ID, operating system user information, etc.
SELECT A.PID, A.SPID, B.Name, B.Description, a.latchwait, a.latchspin, a.pga_used_mem, a.pga_alloc_mem, a.pga_freeable_mem, A.PGA_MAX_MEM
From v $ process a, V $ BGPROCESS B
Where a.addr = b.paddr ( )
And a.addr =: paddr
3. Command field indicating the type of statement that is currently executing. Please refer to Reference.
4. Taddr's address of the current transaction, you can view this field to see the current session is executing transaction information, use the rollback segment information, etc. ^ _ ^
Select B.Name RollName, a. *
From V $ Transaction A, V $ ROLLNAME B
WHERE A.XIDUSN = B.USN
And a.addr = '585ec18c';
5. LockWait field, you can query about the information that is currently awaiting lock via this field.
SELECT *
From v $ locoo
WHERE (ID1, ID2) = ("
SELECT ID1, ID2 from V $ LOCK Where Kaddr = '57c68c48'
)
6. (SQL_ADDRESS, SQL_HASH_VALUE) (prev_sql_addr, prev_hash_value) According to these two sets of fields, we can query the details of the SQL statement that is currently executing.
Select * from V $ sqltext where address =: sql_address and has_value =: sql_hash_value;
7.Row_wait_obj #, row_wait_file #, row_wait_block #, row_wait_row # can query the information currently being locked by these fields. ^ _ ^
a. First get the information that is locked
Select * from dba_Objects where object_id =: row_wait_obj #;
b. You can find the information of the corresponding file according to row_wait_file #.
Select * from v $ datafile where file # =: row_wait_file #.
c. RowID information of the locked field is constructed in accordance with the above four fields.
Select dbms_rowid.rowid_create (1,: row_wait_obj # ,: row_wait_file # ,: row_wait_block # ,: row_wait_row #) from DUAL
8. Logon_time The login time of the current session.
9. Last_call_et This session iDle time, updated every 3 seconds ^ _ ^
[Last Edited by Jametong On 2004-11-26 at 11:38]