0

如何找出我的所有 Oracle 数据库模式包突然进入无效状态的原因?当我重新编译它时,无效对象编译成功。我在“ddl 之前”创建了触发器,但它对我没有帮助。另外,我从 user_errors 查询以查看问题所在,但该视图中没有错误。有什么建议吗?

这是我的表审计和触发器:

     create table invalidations (
  operation           varchar2(30),
  invalidating_object varchar2(30),
  invalidating_owner  varchar2(30),
  invalidated_object  varchar2(30),
  invalidated_owner   varchar2(30),
  invalidation_date   date,
  ipaddr varchar2(30),
  host varchar2(30),
  curruser varchar2(30),
  currschema varchar2(30),
  fgjob number,
  bgjob number
);

create or replace trigger befddl_trg
before ddl
on schema
declare
begin
  insert into invalidations
  select ora_sysevent, ora_dict_obj_name, ora_dict_obj_owner, d.name, d.owner, sysdate,
  SYS_CONTEXT('USERENV', 'IP_ADDRESS', 15) 
  ,SYS_CONTEXT('USERENV', 'HOST', 16) 
  ,SYS_CONTEXT('USERENV', 'CURRENT_USER', 8) 
  ,SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA', 8) 
  ,SYS_CONTEXT('USERENV', 'FG_JOB_ID', 4) 
  ,SYS_CONTEXT('USERENV', 'BG_JOB_ID', 4) 
  from   all_dependencies d 
  where  referenced_name = ora_dict_obj_name 
  and    referenced_owner = ora_dict_obj_owner;
end befddl_trg;
4

0 回答 0