日期:2014-05-16 浏览次数:20896 次
----删除此工程相关表数据
SELECT DB_USERNAME INTO V_DB_NAME FROM SYS_SEC_PROJECT WHERE PROJECT_ID = p_project_id;
----删除该用户所有回话
FOR C IN( SELECT count(sid) into v_session_count,username,sid,serial# FROM v\$session WHERE upper(username)=upper(V_DB_NAME))
LOOP
EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION '''
||C.SID
||','
||C.SERIAL#
||'''';
END LOOP;
EXECUTE IMMEDIATE 'DROP USER ' || v_db_name || ' CASCADE';
DELETE FROM SYS_SEC_PROJECT A WHERE A.PROJECT_ID = p_project_id;