SELECT s.sid, s.serial#, s.username, s.status, s.sql_id, s.sql_child_number, sq.sql_textFROM v$session s
JOIN v$sql sq ON s.sql_id = sq.sql_id
WHERE s.status='ACTIVE';
杀掉正在执行的sql
-- sid,serial#alter system killsession'7114,14991'
查看未提交的事务
--SQL 语句 1:查询未提交事务 DML 语句SELECT S.SID,S.SERIAL#,S.USERNAME,S.OSUSER ,S.PROGRAM ,S.EVENT,TO_CHAR(S.LOGON_TIME,'YYYY-MM-DD HH24:MI:SS'),TO_CHAR(T.START_DATE,'YYYY-MM-DD HH24:MI:SS'),S.LAST_CALL_ET ,S.BLOCKING_SESSION ,S.STATUS,(SELECT Q.SQL_TEXT FROM V$SQL Q WHERE Q.LAST_ACTIVE_TIME=T.START_DATE AND ROWNUM<=1)AS SQL_TEXT
FROM V$SESSION S, V$TRANSACTION T
WHERE S.SADDR = T.SES_ADDR;
-- 修改数据字段类型DECLARE DATATYPE nvarchar(128)
SET
DATATYPE (SELECT DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME your-table-name
AND COLUMN_NAME your-column-name)
IF DATATYPE text
BEGIN-- 注意 text和ntext互转要先转为中间类型ALTER TABL…