问题描述
我真的需要帮助。
我运行此脚本并提示错误消息如下:
drop trigger log_errors_trig;
drop trigger log_errors_trig
第1行的错误:
ORA04080:触发''LOG_ERRORS-TRIG''不存在
drop table log_errors_tab;
drop table log_errors_tab
第1行的错误:
ORA00942:表或视图不存在
创建表log_errors_tab(
错误varchar2(30),
时间戳日期,
用户名varchar2(30) ,
osuser varchar2(30),
machine varchar2(64),
process varchar2(8),
program varchar2(48));
创建或替换触发器log_errors_trig
数据库上的servererror之后
声明
var_user varchar2(30);
var_osuser varchar2(30);
var_machine varchar2(64);
var_process varchar2(8 );
var_program varchar2(48);
begin
选择用户名,osuser,机器,进程,程序
到var_user, var_osuser,var_machine,var_process,var_program
来自sys.v_ $ session
其中audsid = userenv(''sessionid'');
插入log_errors_tab
值(dbms_standard.server_error(1),sysdate,var_u ser,
var_osuser,var_machine,var_process,var_program);
end;
/
WARINING:使用编译错误创建的触发器。
SQL>回滚;
回滚完成。
之后我在SQL中收到错误消息:
错误在第1行:
ORA-04098:触发''SYSTEM.LOG_ERRORS_TRIG''无效且失败
重新验证
我在user_objects& user_errors,结果如下:
1 select * from user_objects
2 * WHERE STATUS<>''VALID''
SQL /
OBJECT_NAME
----------------------------- -------------------------------------------------- ---------------------
SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
创建LAST_DDL_
------------------------------ --------- ---------- ----
------------------ --------- ---------
TIMESTAMP状态TGS
------------------- ------- - - -
LOG_ERRORS_TRIG
47321 TRIGGER
06-FEB-04 06-FEB-04
2004-02-06:14:56 :15无效NNN
SQLselect *来自user_errors;
名称类型序列行
POSITION
------------------------------ ------------ -------- - ---------
---------
TEXT
------------------------------------------- -------------------------------------------------- -------
LOG_ERRORS_TRIG TRIGGER 1 10
13
PL / SQL:ORA-00942:表或视图不存在
LOG_ERRORS_TRIG TRIGGER 2 8
2
PL / SQL:忽略SQL语句
怎么能我解决了这个问题?我在触发后回滚,为什么
这仍然发生?
问候。
tracy kim
Hi, I really need help.
I run this script and error message appeal as below:
drop trigger log_errors_trig;
drop trigger log_errors_trig
ERROR at line 1:
ORA04080: trigger ''LOG_ERRORS-TRIG'' does not exist
drop table log_errors_tab;
drop table log_errors_tab
ERROR at line 1:
ORA00942: table or view does not exist
create table log_errors_tab (
error varchar2(30),
timestamp date,
username varchar2(30),
osuser varchar2(30),
machine varchar2(64),
process varchar2(8),
program varchar2(48));
create or replace trigger log_errors_trig
after servererror on database
declare
var_user varchar2(30);
var_osuser varchar2(30);
var_machine varchar2(64);
var_process varchar2(8);
var_program varchar2(48);
begin
select username, osuser, machine, process, program
into var_user, var_osuser, var_machine, var_process, var_program
from sys.v_$session
where audsid = userenv(''sessionid'');
insert into log_errors_tab
values(dbms_standard.server_error(1),sysdate,var_u ser,
var_osuser,var_machine,var_process,var_program);
end;
/
WARINING: trigger created with compilation errors.
SQL>roll back;
Rollback complete.
After that i got error message in my SQL:
ERROR at line 1:
ORA-04098: trigger ''SYSTEM.LOG_ERRORS_TRIG'' is invalid and failed
re-validation
I check under user_objects & user_errors, result as below:
1 select * from user_objects
2* WHERE STATUS <>''VALID''
SQL/
OBJECT_NAME
----------------------------------------------------------------------------------------------------
SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
CREATED LAST_DDL_
------------------------------ --------- --------------
------------------ --------- ---------
TIMESTAMP STATUS T G S
------------------- ------- - - -
LOG_ERRORS_TRIG
47321 TRIGGER
06-FEB-04 06-FEB-04
2004-02-06:14:56:15 INVALID N N N
SQLselect * from user_errors;
NAME TYPE SEQUENCE LINE
POSITION
------------------------------ ------------ --------- ---------
---------
TEXT
----------------------------------------------------------------------------------------------------
LOG_ERRORS_TRIG TRIGGER 1 10
13
PL/SQL: ORA-00942: table or view does not exist
LOG_ERRORS_TRIG TRIGGER 2 8
2
PL/SQL: SQL Statement ignored
How can i fix this problem? I roll back after I run the trigger, why
this still happened?
Regards.
tracy kim
推荐答案
这篇关于帮助帮助:ORA04080:触发'LOG_ERRORS-TRIG'不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!