Disclaimer

Monday, 14 February 2022

scheduled, disable and enable Oracle job details for downtime

1) Take all scheduler jobs details with Disable option 

=====================Scheduler_Activity==============================

select 'exec DBMS_SCHEDULER.DISABLE '||'('||''''||owner||'.'||job_name||''''||',FALSE);' from dba_scheduler_jobs where owner not in  ('SYS','EXFSYS') and state = 'SCHEDULED'           

---run first query and save the output < for disabling current running jobs> & run 4th number and also save output

=> total_scheduled_jobs.xls ----------------------FIRST RUN--------
<Enterchange > Note: using above scripts you are disabling the jobs and same jobs you have to enable after downtime over. 

======2)===============

select 'exec DBMS_SCHEDULER.DISABLE '||'('||''''||owner||'.'||job_name||''''||',FALSE);' from dba_scheduler_jobs where owner not in ('SYS','EXFSYS') and state = 'DISABLED'       

save the ouput --<==> total_disabled_jobs.xls>



==========3)=============

select 'exec DBMS_SCHEDULER.ENABLE '||'('||''''||owner||'.'||job_name||''''||');' from dba_scheduler_jobs where owner not in ('SYS','EXFSYS') and  state in  ('DISABLED');  

---run first query and save the output< after_disable_jobs.xls>


==============4)==============

select 'exec DBMS_SCHEDULER.ENABLE '||'('||''''||owner||'.'||job_name||''''||');' from dba_scheduler_jobs where owner not in ('SYS','EXFSYS') and  state in  ('SCHEDULED'); 


----------run this query and save the ouput<for enabling the jobs>

No comments:

Post a Comment

Index rebuild online in Oracle - shell script

  [oracle@rac10p reorg]$ cat index_rebuild_EMP.sh #!/bin/ksh export ORACLE_HOME=/oracle/K12/19 export ORACLE_SID=K12 export PATH=$PATH:/$ORA...