ORACLE 常用SQL(自用、用到更新)

 /**************************************************************************************************************************

*            基础常用                               *

**************************************************************************************************************************/

--杀进程

alter system kill session 'SID,SERIAL#,';

/**************************************************************************************************************************

*            授权相关                               *

**************************************************************************************************************************/

--授予某用户所有表查询权限

grant select any table TO xxx;

----授予某用户所有存储过程权限

扫描二维码关注公众号,回复: 86881 查看本文章

grant execute any procedure to xxx;

/**************************************************************************************************************************

*            JOB相关                               *

**************************************************************************************************************************/

--查看所有job

select * from dba_jobs;

--查看所有正在执行的job
select * from dba_jobs_running;

--查看正在执行的job的进程

select b.SID,b.SERIAL#,c.SPID
from dba_jobs_running a,v$session b,v$process c
where a.sid = b.sid and b.PADDR = c.ADDR;

--停止job ,只能停自己用户的job,先停job再杀进程

DECLARE
begin
DBMS_JOB.BROKEN(183,TRUE);
--dbms_job.remove(183);
--dbms_scheduler.stop_job('183',force=>true);
end;

猜你喜欢

转载自www.cnblogs.com/jeanfear/p/8969256.html
今日推荐