Ideas:
1. Query the table half a year ago
select table_name from user_tables where table_name in (
select TABLE_NAME from (
select u.TABLE_NAME from user_tables u,
(select add_months(sysdate,-6) half_year from dual) a
where u.LAST_ANALYZED<=half_year
order by u.LAST_ANALYZED)) and table_name like '%筛选表名%';
2. Create a stored procedure
Test execution stored procedure
call stored procedure name3. Create job timing execution
(1), fill in the stored procedure to be executed in the what value, multiple can be separated
(2), fill in the execution time strategy in the interval; (see the following remarks for the specific writing method)
Note: Job timing execution and time interval description
Interval/ interval refers to the time interval from the end of the previous execution to the start of the next execution. When the interval is set to null, the job will be deleted from the queue after the execution ends. If we need the job to be executed periodically, use 'sysdate+m'. (1). Execute Interval => TRUNC(sysdate,'mi') + 1/ (24*60)
every minute
Execute every hour
Interval => TRUNC(sysdate,'hh') + 1/ (24)
(2). Regular execution every day. For example: execute Interval => TRUNC(sysdate+ 1) +1/ (24) (3)
at 1 am every day . Weekly timed execution for example: Interval => TRUNC(next_day(sysdate,'Monday'))+1/24 (4). Monthly timed execution for example: Interval is executed at 1:00 am on the 1st of each month =>TRUNC(LAST_DAY(SYSDATE))+1+1/24 (5). Regular execution every quarter. For example, Interval => TRUNC(ADD_MONTHS(SYSDATE,3),'Q') + 1/24 (6). Regular execution every six months. For example: every July 1st and January 1st at 1:00 AM Interval => ADD_MONTHS(trunc(sysdate,'yyyy'),6)+1/24 (7) . Regular execution every year For example: Interval =>ADD_MONTHS(trunc(sysdate,'yyyy'),12)+1/24 every year at 1:00 am on January 1st