ORA-04098错误解决方法
ORA-04098错误解决方法数据库版本:8.1.5 平台:SOLARIS 5.7背景:用户建立了一个TRIGGER:create or replace trigger ddl_denybefore create or alter or drop on database declarebegininsert into ddl_logs values(ora_dict_obj_owner,ora_dict_obj_name,sysdate);exceptionwhen no_data_found thennull;end;目的大概就是记录下所有的DDL操作,但TRIGGER建立有错误,发现:11:30:08 system@ORA250>alter trigger ddl_deny disable;alter trigger ddl_deny disable*ERROR 位于第 1 行:ORA-04098: 触发器 'DDL_DENY' 无效且未通过重新验证11:31:45 system@ORA250>drop trigger ddl_deny;drop trigger ddl_deny*ERROR 位于第 1 行:ORA-04098: 触发器 'DDL_DENY' 无效且未通过重新验证此时触发器不能编译过去,也不能删除了,因为触发器本身里面定义了DDL操作的触发,产生ORA-04098: 触发器 'DDL_DENY' 无效且未通过重新验证。解决方法:1、首先查看用户的权限是否正确:select owner, object_name, object_type, status from dba_objects where object_name = '<TRIGGER_NAME>';12:42:38 system@ORA250>select owner, object_name, object_type, status from dba_objects where object_name='DDL_DENY';OWNER; OBJECT_NAMEOBJECT_TYPE STATUS------------------------------------ --------------SYSTEMDDL_DENY;;TRIGGER INVALID发现用户权限没有问题。2、接着设置诊断事件alter session set events='4098 trace name errorstack level 3';,查看trace文件的内容如下:Dump file /db1/app/Oracle/admin/ora250/udump/ora250_ora_6834.trcOracle8i Enterprise Edition Release 8.1.5.0.0 - ProdUCtionWith the Partitioning and Java optionsPL/SQL Release 8.1.5.0.0 - ProductionORACLE_HOME = /db1/app/oracle/product/8.1.5System name: SunOSNode name: db250Release: 5.7Version: Generic_106541-08Machine: sun4uInstance name: ora250Redo thread mounted by this instance: 1Oracle process number: 17Unix process pid: 6834, image: oracle@db250 (TNS V1-V3)*** SESSION ID30.829) 2004.11.17.20.53.38.000*** 2004.11.17.20.53.38.000ksedmp: internal or fatal errorORA-04098: 触发器'DDL_DENY' 无效且未通过重新验证Current SQL statement for this session:alter trigger ddl_deny disable----- Call Stack Trace -----calling call entry argument values in hexlocation type point (? means dubious value)-------------------- -------- -------------------- ----------------------------ksedmp()+160 CALL ksedst()+0 508 ? 1 ? FFBEB31C ?FFBEADC0 ? FFBEADA4 ? 0 ?ksddoa()+248 PTR_CALL 00000000 3 ? 0 ? 0 ? 16594FC ?C0000025 ? 0 ?ksdpcg()+212 CALL ksddoa()+0 16EB0AC ? 16E4C24 ? 3 ?24939C ? 16EB0AC ? 16EB090 ?ksdpec()+236 CALL ksdpcg()+0 1002 ? FFBEB8E4 ? 16E4C24 ?0 ? 0 ? 0 ?ksfpec()+136 CALL ksdpec()+0 1002 ? 165A800 ? 165A800 ?7F3 ? 1659995 ? 16594FC ?kgesev()+100 PTR_CALL 00000000 1659494 ? 1002 ? 262F80 ?1002 ? 1 ? 0 ?ksesec1()+48 CALL kgesev()+0 1659494 ? 16E8CA4 ? 1002 ?1 ? FFBEBA60 ? 1 ?kkttrex()+2112 CALL ksesec1()+0 1002 ? 1 ? 8 ? 8E859D26 ? 2 ?2 ?kktexeevt()+616 CALL kkttrex()+0 8E996A20 ? 8E973B48 ?FFBEBAE4 ? 1659000 ?8E859D6C ? 165E800 ?.....发现是内部严重错误,其他看不出太多错误信息,于是想到采用隐含参数_system_trigger_enabled=false,在数据库启动的时候让所有触发器不起作用,然后删除。 数据库8.1.5的提示没这个参数,于是查询了一下:14:28:32 system@ORA815>select ksppinm from x$ksppi where substr(ksppinm,1,1)='_'and ksppinm like '%tri%' order by ksppinm;KSPPINM-------------------------------------------------------------------------------_cleanup_rollback_entries_distributed_lock_timeout_distributed_recovery_connection_hold_time_number_cached_attributes_system_trig_enabled发现8.1.5版本的参数是_system_trig_enabled,于是让用户在初始化参数文件中设置此参数为false,然后重启数据库,删除trigger,删除成功。至此问题解决。
相关文章: