Skip to content

how to backup invalid object source and drop it

how to backup invalid object source and drop it published on Комментариев к записи how to backup invalid object source and drop it нет

in addition to
how to backup invalid object source :

create table system.invalid_object_backup as 
select  i.owner,i.object_type,i.object_name,dbms_metadata.get_ddl(replace (i.object_type,'PACKAGE BODY','PACKAGE_BODY'),i.object_name,i.owner) as source from 
( SELECT owner,       object_type,       object_name,       status FROM   dba_objects WHERE  status = 'INVALID' ORDER BY owner, object_type, object_name)i ;

and drop them:

select 'drop '||object_type||' '||owner||'.'||object_name||';' from invalid_object_backup  order by owner, object_name; 

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *

Primary Sidebar

Яндекс.Метрика