ORACLE强行断开用户链接

首先查找目标用户的进程

select sid,serial# from v$session where username='CRM';

使用此语句会返回一个进程列表,每行有两个数字,然后用数字替代下面的sid和serial

alter system kill session 'sid,serial';

通过select查询的语句可能会出现多行记录。也可以批量生成语句

SELECT 'alter system kill session ' || '''' ||t.sid ||','||t.SERIAL#|| '''' FROM v$session t WHERE t.USERNAME='CGBCRM';
/* NC57 删除数据库 */
drop user NC57 cascade;
 
/* 创建数据库并为用户赋予权限 */
CREATE USER NC57 IDENTIFIED BY a DEFAULT TABLESPACE NNC_DATA01 TEMPORARY 
TABLESPACE temp;  
GRANT connect,dba to NC57;

There are no comment yet.

HTML tag cannot be used in this comment.