Thursday, 3 October 2019

dba_scheduler

connect / as sysdba

set time on  timing on  echo on pagesize 200 linesize 200 feed on

show user

select to_char(sysdate, 'YYYYMMDD HH24:MI:SS') from dual;

select NAME from V$DATABASE;

begin
        DBMS_SCHEDULER.create_job(
                job_name                => 'DoDSMaintenance',
                job_type                => 'stored_procedure',
                job_action      => 'DoDSMaintenance',
                start_date              => systimestamp,
                end_date                => null,
                repeat_interval => 'freq=daily; byhour=6; byminute=0; bysecond=0;',
                enabled         => true,
                auto_drop       => false,
                comments        => 'Do daily maintenance on the DS data');
end;
/



quit


select job,schema_user,last_date,next_date,total_time,interval,failures,what from dba_jobs where broken ='N' order by log_user;


select job, log_user,LAST_DATE,NEXT_DATE,NEXT_SEC from dba_jobs;


 col job for 999
col log_user for a14
col priv_user for a14
col schema_user for a14
col what for a49
set lines 120
select job, log_user, priv_user, schema_user, what, broken, failures from dba_jobs;


No comments:

Post a Comment

Featured post

duplicate db from standy to other server

 Duplicate Testuat   $ export ORACLE_SID=Testuat3 $ sqlplus '/as sysdba' Testuat3 SQL> alter system set cluster_database=FALSE sc...