Generate Script to kill multiple Oracle sessions

发布时间:2020-08-05 10:16:46 作者:hadba
来源:ITPUB博客 阅读:164

$ cd /data/oracle/SHRARS/backup/export/ITSK0004746383

$ sqlplus -s / as sysdba < killsession.sql
set head off
set linesize 80
set pagesize 1000
select 'ALTER SYSTEM KILL SESSION '''|| sid ||','|| SERIAL# ||''' immediate;'
from v\$session
where username IN ('CREDIT', 'METABASE_CREDIT')
order by username;
exit
EOF


$sqlplus / as sysdba;
SQL>@killsession.sql


$ cat killsession.sql

ALTER SYSTEM KILL SESSION '1294,33195' immediate;
ALTER SYSTEM KILL SESSION '1295,50713' immediate;
ALTER SYSTEM KILL SESSION '1298,7193' immediate;
ALTER SYSTEM KILL SESSION '11,6559' immediate;
ALTER SYSTEM KILL SESSION '12,4241' immediate;
ALTER SYSTEM KILL SESSION '13,43041' immediate;
ALTER SYSTEM KILL SESSION '18,33047' immediate;
ALTER SYSTEM KILL SESSION '20,18697' immediate;
ALTER SYSTEM KILL SESSION '22,43179' immediate;
ALTER SYSTEM KILL SESSION '24,22839' immediate;
ALTER SYSTEM KILL SESSION '25,26477' immediate;
ALTER SYSTEM KILL SESSION '27,39063' immediate;
ALTER SYSTEM KILL SESSION '28,16391' immediate;
ALTER SYSTEM KILL SESSION '33,15411' immediate;
ALTER SYSTEM KILL SESSION '265,8067' immediate;
ALTER SYSTEM KILL SESSION '266,18241' immediate;
ALTER SYSTEM KILL SESSION '267,43603' immediate;
ALTER SYSTEM KILL SESSION '268,10399' immediate;
ALTER SYSTEM KILL SESSION '274,1221' immediate;
ALTER SYSTEM KILL SESSION '275,62325' immediate;
ALTER SYSTEM KILL SESSION '277,42223' immediate;
ALTER SYSTEM KILL SESSION '278,7343' immediate;
ALTER SYSTEM KILL SESSION '282,35757' immediate;
ALTER SYSTEM KILL SESSION '284,4955' immediate;
ALTER SYSTEM KILL SESSION '286,36563' immediate;
ALTER SYSTEM KILL SESSION '287,19961' immediate;
ALTER SYSTEM KILL SESSION '515,30293' immediate;
ALTER SYSTEM KILL SESSION '519,32899' immediate;
ALTER SYSTEM KILL SESSION '522,52349' immediate;
ALTER SYSTEM KILL SESSION '527,22901' immediate;
ALTER SYSTEM KILL SESSION '529,32971' immediate;
ALTER SYSTEM KILL SESSION '532,10831' immediate;
ALTER SYSTEM KILL SESSION '533,48323' immediate;
ALTER SYSTEM KILL SESSION '534,20303' immediate;
ALTER SYSTEM KILL SESSION '535,32059' immediate;
ALTER SYSTEM KILL SESSION '536,17155' immediate;
ALTER SYSTEM KILL SESSION '537,35009' immediate;
ALTER SYSTEM KILL SESSION '540,1325' immediate;
ALTER SYSTEM KILL SESSION '544,11927' immediate;
ALTER SYSTEM KILL SESSION '770,20397' immediate;
ALTER SYSTEM KILL SESSION '772,23053' immediate;
ALTER SYSTEM KILL SESSION '773,28053' immediate;
ALTER SYSTEM KILL SESSION '782,2387' immediate;
ALTER SYSTEM KILL SESSION '784,48639' immediate;
ALTER SYSTEM KILL SESSION '785,43135' immediate;
ALTER SYSTEM KILL SESSION '786,40917' immediate;
ALTER SYSTEM KILL SESSION '787,6837' immediate;
ALTER SYSTEM KILL SESSION '790,19759' immediate;
ALTER SYSTEM KILL SESSION '793,15377' immediate;
ALTER SYSTEM KILL SESSION '794,43759' immediate;
ALTER SYSTEM KILL SESSION '795,51489' immediate;
ALTER SYSTEM KILL SESSION '1027,40997' immediate;
ALTER SYSTEM KILL SESSION '1031,65177' immediate;
ALTER SYSTEM KILL SESSION '1033,55291' immediate;
ALTER SYSTEM KILL SESSION '1036,36143' immediate;
ALTER SYSTEM KILL SESSION '1038,59219' immediate;
ALTER SYSTEM KILL SESSION '1040,38831' immediate;
ALTER SYSTEM KILL SESSION '1042,57453' immediate;
ALTER SYSTEM KILL SESSION '1044,25747' immediate;
ALTER SYSTEM KILL SESSION '1045,57295' immediate;
ALTER SYSTEM KILL SESSION '1280,9343' immediate;
ALTER SYSTEM KILL SESSION '1281,2485' immediate;
ALTER SYSTEM KILL SESSION '1284,34733' immediate;
ALTER SYSTEM KILL SESSION '1285,4495' immediate;
ALTER SYSTEM KILL SESSION '1286,34371' immediate;
ALTER SYSTEM KILL SESSION '1287,30681' immediate;
ALTER SYSTEM KILL SESSION '1288,2105' immediate;
ALTER SYSTEM KILL SESSION '8,50775' immediate;
ALTER SYSTEM KILL SESSION '263,4043' immediate;
ALTER SYSTEM KILL SESSION '273,58961' immediate;
ALTER SYSTEM KILL SESSION '524,44481' immediate;
ALTER SYSTEM KILL SESSION '531,26673' immediate;
ALTER SYSTEM KILL SESSION '1299,25877' immediate;

73 rows selected.

推荐阅读:
  1. C++数据结构之文件压缩(哈夫曼树)实例详解
  2. jquery设置css样式的多种方法(总结)

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

generate oracle script

上一篇:产品开发和PHP开发有什么区别

下一篇:centos7虚拟机添加新的硬盘

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》