### Check the no.of rows in WRI$_ADV_OBJECTS for Auto Stats Advisor Task ###
SQL> select count(*) from wri$_adv_objects where task_id=(select distinct id from wri$_adv_tasks where name='AUTO_STATS_ADVISOR_TASK');
COUNT(*)
----------
46324479
### Do CTAS from WRI$_ADV_OBJECTS to keep the rows apart from AUTO_STATS_ADVISOR_TASK ###
SQL> create table wri$_adv_objects_new as select * from wri$_adv_objects where task_id !=(select distinct id from wri$_adv_tasks where name='AUTO_STATS_ADVISOR_TASK');
SQL> select count(*) from wri$_adv_objects_new;
COUNT(*)
----------
359
### Truncate the table ###
SQL> truncate table wri$_adv_objects;
### Insert the rows from backed up table WRI$_ADV_OBJECTS_NEW to restore the records of ther advisor objects ###
SQL> insert /*+ APPEND */ into wri$_adv_objects select * from wri$_adv_objects_new;
SQL> commit;
SQL> drop table wri$_adv_objects_new;
### Reorganize the indexes ###
SQL> alter index wri$_adv_objects_idx_01 rebuild;
SQL> alter index wri$_adv_objects_pk rebuild;