★ ROACLE中最好性能的SQL查询
SELECT *
FROM (SELECT PARSING_USER_ID EXECUTIONS,
SORTS,
COMMAND_TYPE,
DISK_READS,
sql_text
FROM v$sqlarea
ORDER BY disk_reads DESC )
WHERE ROWNUM < 10;
★ ORACLE中锁表查询及删除SESSION
SELECT /*+ RULE */
LPAD(' ', DECODE(L.XIDUSN, 0, 3, 0)) || L.ORACLE_USERNAME USER_NAME,
O.OWNER,
O.OBJECT_NAME,
O.OBJECT_TYPE,
S.SID,
S.SERIAL#,
P.SPID
FROM V$LOCKED_OBJECT L, DBA_OBJECTS O, V$SESSION S, V$PROCESS P
WHERE L.OBJECT_ID = O.OBJECT_ID
AND L.SESSION_ID = S.SID
AND S.PADDR = P.ADDR
ORDER BY O.OBJECT_ID, XIDUSN DESC;
ALTER SYSTEM KILL SESSION 'SID,SERIR#';