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

How to recovery PDB when PDB database is dropped in Oracle

  How to recovery PDB when PDB database is dropped :) [oracle@rac01 ~]$ sqlplus '/as sysdba' SQL*Plus: Release 21.0.0.0.0 - Product...