--查詢
select 'drop view ' || object_name || ';'
from user_objects
where object_type='VIEW'
and status='INVALID';
--執行
2. 刪除所有客戶化觸發器,即所有非“_T”結束的觸發器;
備份觸發器trigger_backup.sql
--查詢
select 'DROP trigger ' || trigger_name || ';'
from user_triggers where
(trigger_name not like '%\_T' escape '\')
and (upper(trigger_name) not in (select upper(triggername) from maxtriggers)) ;
--執行
3、
原因:父設備存在的設備編碼,在系統中不存在。
解決:刪除此種數據
select 'update equipment e set e.parent=null where e.eqnum='||a.eqnum|| ';'
from equipment a
where not exists (select 1 from equipment b where a.parent = b.eqnum)
and a.parent is not null