Oracle PL/SQL/System Tables Views/sqltext
Версия от 13:45, 26 мая 2010; (обсуждение)
V$SESSION dynamic contains all the currently active users" usernames and the SQL they are executing in the database.
SQL>
SQL> select a.username,
2 s.sql_text
3 from v$session a,v$sqltext s
4 where a.sql_address = s.address
5 and a.sql_hash_value = s.hash_value
6 AND A.STATUS="ACTIVE"
7 order by a.username,a.sid,s.piece
8 /
USERNAME
------------------------------
SQL_TEXT
--------------------------------------------------
sqle
select a.username, s.sql_text from v$session a,v$s
qltext s where
sqle
a.sql_address = s.address and a.sql_hash_value =
s.hash_value A
sqle
ND A.STATUS="ACTIVE" order by a.username,a.sid,s.p
iece
sqle
DECLARE v_MyNumber NUMBER := 0; BEGIN LOOP
IF v_
sqle
MyNumber = 7 THEN EXIT; END IF;
v_MyNumber
USERNAME
------------------------------
SQL_TEXT
--------------------------------------------------
sqle
:= v_MyNumber + 2; END LOOP; END;
6 rows selected.
SQL>
SQL> --