SQL语句case和杀进程

sql①case when的使用

case when

SELECT CASE

         WHEN DUAL.DUMMY IS NOT NULL THEN
          (SELECT DUAL.DUMMY FROM DUAL)
         ELSE
          CASE
            WHEN 2 = 1 THEN
             '3'
            ELSE
             '4'
          END
       END A
  FROM DUAL;
FJK002.SNGC_ID FJV001.USER_ID FJK002.So_Num FJC014.So_Num
  SELECT DECODE(1, 1, '1', 2, '2', '3') FROM DUAL;
SELECT DUAL.DUMMY FROM DUAL;
DECODE(1, '1',(

  SELECT '1' FROM DUAL), '3')


sql②杀进程

SELECT OBJECT_NAME, MACHINE, S.SID, S.SERIAL#
  FROM GV$LOCKED_OBJECT L, DBA_OBJECTS O, GV$SESSION S
 WHERE L.OBJECT_ID  = O.OBJECT_ID
   AND L.SESSION_ID = S.SID;

ALTER system kill session '41,15074';

-- 查询属性
SELECT NAME, VALUE FROM GV$PARAMETER WHERE NAME LIKE '%limit%';
SHOW PARAMETER RESOURCE_LIMIT;
-- 显示停止的绘画进程
SELECT SID, SERIAL#, PADDR, USERNAME, STATUS
  FROM V$SESSION
 WHERE STATUS = 'SNIPED';
 -- 设置空闲时间超时时间
ALTER PROFILE DEFAULT LIMIT IDLE_TIME 30;
-- 查询user的profile文件
select username,profile from DBA_USERS;
-- 查询profile属性
select profile, resource_name, limit from dba_profiles where profile='APP_USER' and resource_name ='IDLE_TIME';


你可能感兴趣的:(SQL语句case和杀进程)