码迷,mamicode.com
首页 > 数据库 > 详细

查看oracle数据库job及会话信息

时间:2019-03-13 21:25:30      阅读:1467      评论:0      收藏:0      [点我收藏+]

标签:name   sha   ken   查看   and   lte   run   work   ora   

查看所有job
select from dba_jobs;
查看正在运行的job
select
from dba_jobs_running;
select job,log_user,priv_user,schema_user,BROKEN from dba_jobs where job=545;
查看数据库建立的回话情况
select sid,serial#,username,program,machine,status
from v$session;
查看对应sid的sql_id
select * from v$session where sid=2272 or sid=327;
知道sql_id后查看sql语句
select SQL_TEXT from v$sql where sql_id=‘3f18ygbqg41mw‘;
给MESPRD赋权
grant execute on DBMS_WORKLOAD_REPOSITORY to MESPRD;
kill会话
alter system kill session ‘sid,serial#‘;
alter system kill session ‘327,8133‘;
查看进程的spid
select spid, program from v$process
where program!= ‘PSEUDO‘
and addr not in (select paddr from v$session)
and addr not in (select paddr from v$bgprocess)
and addr not in (select paddr from v$shared_server);
!ps -ef|grep spid|grep -v grep;
查看进程的spid
SELECT s.username,s.status,
x.ADDR,x.KSLLAPSC,x.KSLLAPSN,x.KSLLASPO,x.KSLLID1R,x.KSLLRTYP,
decode(bitand (x.ksuprflg,2),0,null,1)
FROM x$ksupr x,v$session s
WHERE s.paddr(+)=x.addr
and bitand(ksspaflg,1)!=0;
查看进程的spid
select spid,program from v$process where pid in(327,2272);

查看oracle数据库job及会话信息

标签:name   sha   ken   查看   and   lte   run   work   ora   

原文地址:https://blog.51cto.com/14074978/2362601

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!