#查询是否死锁
select object_name,machine,s.sid,s.serial# from v$locked_object l,dba_objects o ,v$session s where l.object_id = o.object_id and l.session_id=s.sid
SELECT
S.USERNAME,
DECODE(L.TYPE, 'TM', 'TABLE LOCK', 'TX', 'ROW LOCK', NULL) LOCK_LEVEL,
O.OWNER,
O.OBJECT_NAME,
O.OBJECT_TYPE,
S.SID,
S.SERIAL#,
S.TERMINAL,
S.MACHINE,
S.PROGRAM,
S.OSUSER
FROM V$SESSION S, V$LOCK L, DBA_OBJECTS O
WHERE L.SID = S.SID
AND L.ID1 = O.OBJECT_ID(+)
杀死SID:
ALTER SYSTEM KILL SESSION 'si_id名,serial名'
oracle 分页查询:
SELECT ROWNUM,t.* FROM (SELECT ROWNUM r,b.* FROM tableName b WHERE ROWNUM<= 10) t WHERE r>0;
创建自增ID:
CREATE SEQUENCE CATI_FTP_DATA_TMP_SEQ
MINVALUE 1
MAXVALUE 99999999
START WITH 1
INCREMENT BY 1
NOCACHE