ORACLE common SQL (self-use, used to update)

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

*Basic common use*

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

--kill process

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

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

*License related*

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

--Grant a user permission to query all tables

grant select any table TO xxx;

---- Grant all stored procedure permissions to a user

grant execute any procedure to xxx;

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

*JOB related*

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

-- view all jobs

select * from dba_jobs;

--View all running jobs
select * from dba_jobs_running;

--View the process of the job being executed

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;

--Stop the job, you can only stop the job of your own user, stop the job first and then kill the process

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325016503&siteId=291194637