Oracle connection information
View user connections
Select s. osuser OS _user_name, decode (sign (48-command), 1, to_char (command ),
'Action Code # '| to_char (command) Action, p. program oracle_process,
Status session_status, s. terminal, s. program,
S. username user_name, & nbs
P; s. fixed _
Table_sequence activity_meter, ''query,
0 memory, 0 max_memory, 0 cpu_usage, s. sid, s. serial # serial_num
From v $ session s, v $ process p where s. paddr = p. addr and s. type = 'user'
Order by s. username, s. osuser
2) view the resource usage of the corresponding connection according to v. sid.
Select n. name,
V. value,
N. class,
N. statistic #
From v $ statname n,
V $ sesstat v
Where v. sid = 71 and
V. statistic # = n. statistic #
Order by n. class, n. statistic #
3) view the SQL statement that the connection is running based on the sid.
Select/* + PUSH_SUBQ */
Command_type,
SQL _text,
Sharable_mem,
Persistent_mem,
Runtime_mem,
Sorts,
Version_count,
Loaded_versions,
Open_versions,
Users_opening,
Executions,
Users_executing,
Loads,
First_load_time,
Invalidations,
Parse_cils,
Disk_reads,
Buffer_gets,
Rows_processed,
Sysdate start_time,
Sysdate finish_time,
'>' | Address SQL _address,
'N' status
From v $ sqlarea
Where address = (select SQL _address from v $ session where sid = 71)