trigger creatcompiled with errorscompilation errors

Create Stored Procedure For Logon Trigger with user SYSTEM gives ORA-00942 [ID ]_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
Create Stored Procedure For Logon Trigger with user SYSTEM gives ORA-00942 [ID ]
&&Create Stored Procedure For Logon Trigger with user SYSTEM gives ORA-00942
oracle 创建登录触发器,报错 ORA-00942
阅读已结束,下载文档到电脑
想免费下载更多文档?
定制HR最喜欢的简历
你可能喜欢5487人阅读
日记(62)
IMP-00041: Warning: object created with compilation warnings
昨天导入数据的时候,最后报错
IMP-00041: Warning: object created with compilation warnings
&CREATE TRIGGER &KFPT2&.SYN_khgl_qyjbxx_D after delete on khgl_qyjbxx
p_id syn_control_send_sql.id%begin
select count(1) into num from syn_control_receive_sql s where (upper(s.ta&
&ble_name)='khgl_qyjbxx') and (s.condition_clause='(NSRSBH='''||:OLD.NSRSBH|&
&|''')') and s.handle_flag='0';
if(num=0)then
select seq_syn_control_i&
&d.nextval into p_
insert into syn_control_send_sql(id,t&
&able_name,action_type,condition_clause,sql_clause,fzjg_dm,update_clob_field&
&s,update_blob_fields,update_date,syn_flag)
values(p_id,'khgl_qyjbxx','&
&DELETE','(NSRSBH='''||:OLD.NSRSBH||''')','delete from khgl_qyjbxx where (NS&
&RSBH='''||:OLD.NSRSBH||''')',''||replace(:OLD.FZJG_DM,'''','''''')||'','','&
&',sysdate,'0');
end SYN_khgl_qyjbxx_D;&
IMP-00041: Warning: object created with compilation warnings
&CREATE TRIGGER &KFPT2&.SYN_khgl_qyjbxx_U after update on khgl_qyjbxx
p_id syn_control_send_sql.id%
p_sql_cla&
&use varchar2(4000);
p_update_clob_fields syn_control_send_sql.update_clob_&
p_update_blob_fields syn_control_send_sql.update_blob_fields%&
select count(1) into num from syn_control_receive_sql s w&
&here (upper(s.table_name)='khgl_qyjbxx') and (s.condition_clause='(NSRSBH='&
&''||:NEW.NSRSBH||''')') and s.handle_flag='0';
if(num=0)then
if(nvl(:NEW.&
&LWNSRSBH,'-12345')!=nvl(:OLD.LWNSRSBH,'-12345')) then
if(p_sql_clause is&
& null)then
p_sql_clause:='update khgl_qyjbxx set LWNSRSBH='''||replace(&
&:NEW.LWNSRSBH,'''','''''')||'''';
p_sql_clause:=p_sql_clause||'&
&,LWNSRSBH='''||replace(:NEW.LWNSRSBH,'''','''''')||'''';
if(nvl(:NEW.NSRSBH,'-12345')!=nvl(:OLD.NSRSBH,'-12345')) then
&ql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set NSRSBH='''&
&||replace(:NEW.NSRSBH,'''','''''')||'''';
p_sql_clause:=p_sql_c&
&lause||',NSRSBH='''||replace(:NEW.NSRSBH,'''','''''')||'''';
if(nvl(:NEW.NSRMC,'-12345')!=nvl(:OLD.NSRMC,'-12345')) then
&_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set NSRMC=''&
&'||replace(:NEW.NSRMC,'''','''''')||'''';
p_sql_clause:=p_sql_c&
&lause||',NSRMC='''||replace(:NEW.NSRMC,'''','''''')||'''';
if(nvl(:NEW.NSRBM,'-12345')!=nvl(:OLD.NSRBM,'-12345')) then
&ql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set NSRBM='''|&
&|replace(:NEW.NSRBM,'''','''''')||'''';
p_sql_clause:=p_sql_cla&
&use||',NSRBM='''||replace(:NEW.NSRBM,'''','''''')||'''';
if(nvl(:NEW.SWJG_DM,'-12345')!=nvl(:OLD.SWJG_DM,'-12345')) then
&_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set SWJG_DM=&
&'''||replace(:NEW.SWJG_DM,'''','''''')||'''';
p_sql_clause:=p_s&
&ql_clause||',SWJG_DM='''||replace(:NEW.SWJG_DM,'''','''''')||'''';
if(nvl(:NEW.ZCBM,'-12345')!=nvl(:OLD.ZCBM,'-12345')) then
&if(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set ZCBM&
&='''||replace(:NEW.ZCBM,'''','''''')||'''';
p_sql_clause:=p_sql&
&_clause||',ZCBM='''||replace(:NEW.ZCBM,'''','''''')||'''';
if(nvl(:NEW.NSRLB_DM,'-12345')!=nvl(:OLD.NSRLB_DM,'-12345')) then
&if(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set NSRL&
&B_DM='''||replace(:NEW.NSRLB_DM,'''','''''')||'''';
p_sql_claus&
&e:=p_sql_clause||',NSRLB_DM='''||replace(:NEW.NSRLB_DM,'''','''''')||''''; &
if(nvl(:NEW.DHHM,'-12345')!=nvl(:OLD.DHHM,'-12345')) &
if(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx &
&set DHHM='''||replace(:NEW.DHHM,'''','''''')||'''';
p_sql_claus&
&e:=p_sql_clause||',DHHM='''||replace(:NEW.DHHM,'''','''''')||'''';
if(nvl(:NEW.JYDZ,'-12345')!=nvl(:OLD.JYDZ,'-12345')) then
&if(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set JYDZ&
&='''||replace(:NEW.JYDZ,'''','''''')||'''';
p_sql_clause:=p_sql&
&_clause||',JYDZ='''||replace(:NEW.JYDZ,'''','''''')||'''';
if(nvl(:NEW.ZCDZ,'-12345')!=nvl(:OLD.ZCDZ,'-12345')) then
&_clause is null)then
p_sql_clause:='update khgl_qyjbxx set ZCDZ='''||re&
&place(:NEW.ZCDZ,'''','''''')||'''';
p_sql_clause:=p_sql_clause|&
&|',ZCDZ='''||replace(:NEW.ZCDZ,'''','''''')||'''';
&(nvl(:NEW.LXRMC,'-12345')!=nvl(:OLD.LXRMC,'-12345')) then
if(p_sql_claus&
&e is null)then
p_sql_clause:='update khgl_qyjbxx set LXRMC='''||replace&
&(:NEW.LXRMC,'''','''''')||'''';
p_sql_clause:=p_sql_clause||',L&
&XRMC='''||replace(:NEW.LXRMC,'''','''''')||'''';
&vl(:NEW.LXRSJ,'-12345')!=nvl(:OLD.LXRSJ,'-12345')) then
if(p_sql_clause &
&is null)then
p_sql_clause:='update khgl_qyjbxx set LXRSJ='''||replace(:&
&NEW.LXRSJ,'''','''''')||'''';
p_sql_clause:=p_sql_clause||',LXR&
&SJ='''||replace(:NEW.LXRSJ,'''','''''')||'''';
&(:NEW.XZQH_DM,'-12345')!=nvl(:OLD.XZQH_DM,'-12345')) then
if(p_sql_claus&
&e is null)then
p_sql_clause:='update khgl_qyjbxx set XZQH_DM='''||repla&
&ce(:NEW.XZQH_DM,'''','''''')||'''';
p_sql_clause:=p_sql_clause|&
&|',XZQH_DM='''||replace(:NEW.XZQH_DM,'''','''''')||'''';
if(nvl(:NEW.KHYHMC,'-12345')!=nvl(:OLD.KHYHMC,'-12345')) then
&ql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set KHYHMC='''&
&||replace(:NEW.KHYHMC,'''','''''')||'''';
p_sql_clause:=p_sql_c&
&lause||',KHYHMC='''||replace(:NEW.KHYHMC,'''','''''')||'''';
if(nvl(:NEW.KHYHZH,'-12345')!=nvl(:OLD.KHYHZH,'-12345')) then
&(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set KHYHZH&
&='''||replace(:NEW.KHYHZH,'''','''''')||'''';
p_sql_clause:=p_s&
&ql_clause||',KHYHZH='''||replace(:NEW.KHYHZH,'''','''''')||''''; &
if(nvl(:NEW.KPDZ,'-12345')!=nvl(:OLD.KPDZ,'-12345')) then
&(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set KPDZ='&
&''||replace(:NEW.KPDZ,'''','''''')||'''';
p_sql_clause:=p_sql_c&
&lause||',KPDZ='''||replace(:NEW.KPDZ,'''','''''')||'''';
if(nvl(:NEW.YZBM,'-12345')!=nvl(:OLD.YZBM,'-12345')) then
if(p_sql_c&
&lause is null)then
p_sql_clause:='update khgl_qyjbxx set YZBM='''||repl&
&ace(:NEW.YZBM,'''','''''')||'''';
p_sql_clause:=p_sql_clause||'&
&,YZBM='''||replace(:NEW.YZBM,'''','''''')||'''';
&vl(:NEW.EMAIL,'-12345')!=nvl(:OLD.EMAIL,'-12345')) then
if(p_sql_clause &
&is null)then
p_sql_clause:='update khgl_qyjbxx set EMAIL='''||replace(:&
&NEW.EMAIL,'''','''''')||'''';
p_sql_clause:=p_sql_clause||',EMA&
&IL='''||replace(:NEW.EMAIL,'''','''''')||'''';
&(:NEW.JTLX,'-12345')!=nvl(:OLD.JTLX,'-12345')) then
if(p_sql_clause is n&
p_sql_clause:='update khgl_qyjbxx set JTLX='''||replace(:NEW.J&
&TLX,'''','''''')||'''';
p_sql_clause:=p_sql_clause||',JTLX='''|&
&|replace(:NEW.JTLX,'''','''''')||'''';
if(nvl(:NEW.CZ&
&HM,'-12345')!=nvl(:OLD.CZHM,'-12345')) then
if(p_sql_clause is null)then&
p_sql_clause:='update khgl_qyjbxx set CZHM='''||replace(:NEW.CZHM,''''&
&,'''''')||'''';
p_sql_clause:=p_sql_clause||',CZHM='''||replace&
&(:NEW.CZHM,'''','''''')||'''';
if(nvl(:NEW.MSN,'-1234&
&5')!=nvl(:OLD.MSN,'-12345')) then
if(p_sql_clause is null)then
&_clause:='update khgl_qyjbxx set MSN='''||replace(:NEW.MSN,'''','''''')||''&
p_sql_clause:=p_sql_clause||',MSN='''||replace(:NEW.MSN,'''&
&','''''')||'''';
if(nvl(:NEW.QQ,'-12345')!=nvl(:OLD.Q&
&Q,'-12345')) then
if(p_sql_clause is null)then
p_sql_clause:='update&
& khgl_qyjbxx set QQ='''||replace(:NEW.QQ,'''','''''')||'''';
&sql_clause:=p_sql_clause||',QQ='''||replace(:NEW.QQ,'''','''''')||'''';
if(nvl(:NEW.ZGYMC,'-12345')!=nvl(:OLD.ZGYMC,'-12345')) t&
if(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx s&
&et ZGYMC='''||replace(:NEW.ZGYMC,'''','''''')||'''';
p_sql_clau&
&se:=p_sql_clause||',ZGYMC='''||replace(:NEW.ZGYMC,'''','''''')||'''';
if(nvl(:NEW.SWFS_DM,'-12345')!=nvl(:OLD.SWFS_DM,'-12345'))&
if(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx&
& set SWFS_DM='''||replace(:NEW.SWFS_DM,'''','''''')||'''';
&l_clause:=p_sql_clause||',SWFS_DM='''||replace(:NEW.SWFS_DM,'''','''''')||'&
if(nvl(:NEW.OS,'-12345')!=nvl(:OLD.OS,'-12345'))&
if(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx&
& set OS='''||replace(:NEW.OS,'''','''''')||'''';
p_sql_clause:=&
&p_sql_clause||',OS='''||replace(:NEW.OS,'''','''''')||'''';
if(nvl(:NEW.DYJLX_DM,'-12345')!=nvl(:OLD.DYJLX_DM,'-12345')) then
& if(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set DYJ&
&LX_DM='''||replace(:NEW.DYJLX_DM,'''','''''')||'''';
p_sql_clau&
&se:=p_sql_clause||',DYJLX_DM='''||replace(:NEW.DYJLX_DM,'''','''''')||'''';&
if(nvl(:NEW.SMYXH,'-12345')!=nvl(:OLD.SMYXH,'-12345'&
if(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjb&
&xx set SMYXH='''||replace(:NEW.SMYXH,'''','''''')||'''';
&clause:=p_sql_clause||',SMYXH='''||replace(:NEW.SMYXH,'''','''''')||'''';
if(nvl(:NEW.ISDLQY,'-12345')!=nvl(:OLD.ISDLQY,'-12345'&
if(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjb&
&xx set ISDLQY='''||replace(:NEW.ISDLQY,'''','''''')||'''';
&l_clause:=p_sql_clause||',ISDLQY='''||replace(:NEW.ISDLQY,'''','''''')||'''&
if(nvl(:NEW.FZJG_DM,'-12345')!=nvl(:OLD.FZJG_DM,'-&
&12345')) then
if(p_sql_clause is null)then
p_sql_clause:='update khg&
&l_qyjbxx set FZJG_DM='''||replace(:NEW.FZJG_DM,'''','''''')||'''';
p_sql_clause:=p_sql_clause||',FZJG_DM='''||replace(:NEW.FZJG_DM,'''',''&
&'''')||'''';
if(nvl(:NEW.LRR_DM,'-12345')!=nvl(:OLD.L&
&RR_DM,'-12345')) then
if(p_sql_clause is null)then
p_sql_clause:='up&
&date khgl_qyjbxx set LRR_DM='''||replace(:NEW.LRR_DM,'''','''''')||'''';
p_sql_clause:=p_sql_clause||',LRR_DM='''||replace(:NEW.LRR_DM,'''&
&','''''')||'''';
if(nvl(:NEW.LRRQ,sysdate)!=nvl(:OLD.&
&LRRQ,to_date(' 00:00:00','yyyy-mm-dd hh24:mi:ss'))) then
&sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set LRRQ=to_d&
&ate('''||to_char(:NEW.LRRQ,'yyyy-mm-dd hh24:mi:ss')||''',''yyyy-mm-dd hh24:&
&mi:ss'')';
p_sql_clause:=p_sql_clause||',LRRQ=to_date('''||to_c&
&har(:NEW.LRRQ,'yyyy-mm-dd hh24:mi:ss')||''',''yyyy-mm-dd hh24:mi:ss'')';
if(nvl(:NEW.ZHXQRQ,sysdate)!=nvl(:OLD.ZHXQRQ,to_date('1&
&900-01-01 00:00:00','yyyy-mm-dd hh24:mi:ss'))) then
if(p_sql_clause is n&
p_sql_clause:='update khgl_qyjbxx set ZHXQRQ=to_date('''||to_c&
&har(:NEW.ZHXQRQ,'yyyy-mm-dd hh24:mi:ss')||''',''yyyy-mm-dd hh24:mi:ss'')'; &
p_sql_clause:=p_sql_clause||',ZHXQRQ=to_date('''||to_char(:NEW.&
&ZHXQRQ,'yyyy-mm-dd hh24:mi:ss')||''',''yyyy-mm-dd hh24:mi:ss'')';&
if(nvl(:NEW.ZTBZ,'-12345')!=nvl(:OLD.ZTBZ,'-12345')) then
&f(p_sql_clause is null)then
p_sql_clause:='update khgl_qyjbxx set ZTBZ=&
&'''||replace(:NEW.ZTBZ,'''','''''')||'''';
p_sql_clause:=p_sql_&
&clause||',ZTBZ='''||replace(:NEW.ZTBZ,'''','''''')||'''';
if(nvl(:NEW.BZ,'-12345')!=nvl(:OLD.BZ,'-12345')) then
if(p_sql_clau&
&se is null)then
p_sql_clause:='update khgl_qyjbxx set BZ='''||replace(:&
&NEW.BZ,'''','''''')||'''';
p_sql_clause:=p_sql_clause||',BZ='''&
&||replace(:NEW.BZ,'''','''''')||'''';
if(nvl(:NEW.QYL&
&X_DM,'-12345')!=nvl(:OLD.QYLX_DM,'-12345')) then
if(p_sql_clause is null&
p_sql_clause:='update khgl_qyjbxx set QYLX_DM='''||replace(:NEW.Q&
&YLX_DM,'''','''''')||'''';
p_sql_clause:=p_sql_clause||',QYLX_D&
&M='''||replace(:NEW.QYLX_DM,'''','''''')||'''';
&p_sql_clause is not null)then
p_sql_clause:=p_sql_clause||' where (NSR&
&SBH='''||:OLD.NSRSBH||''')';
select seq_syn_control_id.nextval &
insert into syn_control_send_sql(id,table_name,a&
&ction_type,fzjg_dm,condition_clause,sql_clause,update_clob_fields,update_bl&
&ob_fields,update_date,syn_flag)
values(p_id,'khgl_qyjbxx','UPDATE',''|&
&|replace(:OLD.FZJG_DM,'''','''''')||'','(NSRSBH='''||:NEW.NSRSBH||''')',p_s&
&ql_clause,p_update_clob_fields,p_update_blob_fields,sysdate,'0');&
end SYN_khgl_qyjbxx_U;&
IMP-00041: Warning: object created with compilation warnings
&CREATE TRIGGER &KFPT2&.SYN_khgl_qyjbxx_I after insert on khgl_qyjbxx
p_id syn_control_send_sql.id%
sql_claus&
&e syn_control_send_sql.sql_clause%begin
select count(1) into nu&
&m from syn_control_receive_sql s where (upper(s.table_name)='khgl_qyjbxx') &
&and (s.condition_clause='(NSRSBH='''||:NEW.NSRSBH||''')') and s.handle_flag&
if(num=0)then
select seq_syn_control_id.nextval into p_id from &
sql_clause:= 'insert into khgl_qyjbxx(LWNSRSBH,NSRSBH,NSRMC,NS&
&RBM,SWJG_DM,ZCBM,NSRLB_DM,DHHM,JYDZ,ZCDZ,LXRMC,LXRSJ,XZQH_DM,KHYHMC,KHYHZH,&
&KPDZ,YZBM,EMAIL,JTLX,CZHM,MSN,QQ,ZGYMC,SWFS_DM,OS,DYJLX_DM,SMYXH,ISDLQY,FZJ&
&G_DM,LRR_DM,LRRQ,ZHXQRQ,ZTBZ,BZ,QYLX_DM)values('''||replace(:NEW.LWNSRSBH,'&
&''','''''')||''','''||replace(:NEW.NSRSBH,'''','''''')||''','''||replace(:N&
&EW.NSRMC,'''','''''')||''','''||replace(:NEW.NSRBM,'''','''''')||''','''||r&
&eplace(:NEW.SWJG_DM,'''','''''')||''','''||replace(:NEW.ZCBM,'''','''''')||&
&''','''||replace(:NEW.NSRLB_DM,'''','''''')||''','''||replace(:NEW.DHHM,'''&
&','''''')||''','''||replace(:NEW.JYDZ,'''','''''')||''','''||replace(:NEW.Z&
&CDZ,'''','''''')||''','''||replace(:NEW.LXRMC,'''','''''')||''','''||replac&
&e(:NEW.LXRSJ,'''','''''')||''','''||replace(:NEW.XZQH_DM,'''','''''')||''',&
&'''||replace(:NEW.KHYHMC,'''','''''')||''','''||replace(:NEW.KHYHZH,'''',''&
&'''')||''','''||replace(:NEW.KPDZ,'''','''''')||''','''||replace(:NEW.YZBM,&
&'''','''''')||''','''||replace(:NEW.EMAIL,'''','''''')||''','''||replace(:N&
&EW.JTLX,'''','''''')||''','''||replace(:NEW.CZHM,'''','''''')||''','''||rep&
&lace(:NEW.MSN,'''','''''')||''','''||replace(:NEW.QQ,'''','''''')||''','''|&
&|replace(:NEW.ZGYMC,'''','''''')||''','''||replace(:NEW.SWFS_DM,'''',''''''&
&)||''','''||replace(:NEW.OS,'''','''''')||''','''||replace(:NEW.DYJLX_DM,''&
&'','''''')||''','''||replace(:NEW.SMYXH,'''','''''')||''','''||replace(:NEW&
&.ISDLQY,'''','''''')||''','''||replace(:NEW.FZJG_DM,'''','''''')||''','''||&
&replace(:NEW.LRR_DM,'''','''''')||''',to_date('''||to_char(:NEW.LRRQ,'yyyy-&
&mm-dd hh24:mi:ss')||''',''yyyy-mm-dd hh24:mi:ss''),to_date('''||to_char(:NE&
&W.ZHXQRQ,'yyyy-mm-dd hh24:mi:ss')||''',''yyyy-mm-dd hh24:mi:ss''),'''||repl&
&ace(:NEW.ZTBZ,'''','''''')||''','''||replace(:NEW.BZ,'''','''''')||''','''|&
&|replace(:NEW.QYLX_DM,'''','''''')||''')';
insert into syn_control_&
&send_sql(id,table_name,action_type,condition_clause,sql_clause,fzjg_dm,upda&
&te_clob_fields,update_blob_fields,update_date,syn_flag)
values(p_id,'k&
&hgl_qyjbxx','INSERT','(NSRSBH='''||:NEW.NSRSBH||''')',
sql_clause
&''||replace(:NEW.FZJG_DM,'''','''''')||'','','',sysdate,'0');
&nd SYN_khgl_qyjbxx_I;&
About to enable constraints...
Import terminated successfully with warnings.
解决办法,重新编译无效的对象
SQL&sqlplus / as
SQL& @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/utlrp.sql
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN
The following PL/SQL block invokes UTL_RECOMP to recompile invalid
objects in the database. Recompilation time is proportional to the
number of invalid objects in the database, so this command may take
a long time to execute on a database with a large number of invalid
Use the following queries to track recompilation progress:
1. Query returning the number of invalid objects remaining. This
number should decrease with time.
SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
2. Query returning the number of objects compiled so far. This number
should increase with time.
SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
This script automatically chooses serial or parallel recompilation
based on the number of CPUs available (parameter cpu_count) multiplied
by the number of threads per CPU (parameter parallel_threads_per_cpu).
On RAC, this number is added across all RAC nodes.
UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
recompilation. Jobs are created without instance affinity so that they
can migrate across RAC nodes. Use the following queries to verify
whether UTL_RECOMP jobs are being created and run correctly:
1. Query showing jobs created by UTL_RECOMP
SELECT job_name FROM dba_scheduler_jobs
WHERE job_name like 'UTL_RECOMP_SLAVE_%';
2. Query showing UTL_RECOMP jobs that are running
SELECT job_name FROM dba_scheduler_running_jobs
WHERE job_name like 'UTL_RECOMP_SLAVE_%';
PL/SQL procedure successfully completed.
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END
PL/SQL procedure successfully completed.
DOC& The following query reports the number of objects that have compiled
DOC& with errors (objects that compile with errors have status set to 3 in
DOC& obj$). If the number is higher than expected, please examine the error
DOC& messages reported with each object (using SHOW ERRORS) to see if they
DOC& point to system misconfiguration or resource constraints that must be
DOC& fixed before attempting to recompile these objects.
OBJECTS WITH ERRORS
-------------------
DOC& The following query reports the number of errors caught during
DOC& recompilation. If this number is non-zero, please query the error
DOC& messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC& are due to misconfiguration or resource constraints that must be
DOC& fixed before objects can compile successfully.
ERRORS DURING RECOMPILATION
---------------------------
PL/SQL procedure successfully completed.
造成错误的原因,参考一下解释
Applies to:
Oracle Server - Enterprise Edition - Version: 8.1.7.0 to 10.2.0.4
This problem can occur on any platform.
This note is meant for the users who get the following set of errors while performing an import:
IMP-00041: Warning: object created with compilation warnings
&CREATE FORCE VIEW
IMP-00041: Warning: object created with compilation warnings
&CREATE TRIGGER
Sometimes invalid objects indicated by IMP-00041 errors can be compiled manually after the IMPORT command is used.
Other times, even after the import is complete, you are not able to compile them manually.
And manually recreating them on the importing database gives:
ORA-01031 : insufficient privileges
ORA-00942: table or view does not exist
There could be several causes for this problem:
a) The objects on which you are getting the errors refer to the objects (tables, etc.) which:
either do not exist in the database or lie in the other schema which, though existed in the exporting database, does not exist in the importing database.
b) The importing user does not have necessary privileges on the referred objects.
c) The referred objects are dba_ views or other data dictionary tables, etc.
Try recompiling those objects, or use the following solution for each of the above causes:
a) Either pre-create the referred objects in the importing database
pre-import the schema carrying the referred objects before carrying out the import of the schema receiving the errors.
b) Provide the necessary privileges to the importing user prior to import.
c) Grant 'select any table' system privilege to the importing user prior to import
be sure the init.ora parameter 'O7_DICTIONARY_ACCESSIBILITY' is set to TRUE on the importing database.
Note: The init.ora parameter 'O7_DICTIONARY_ACCESSIBILITY' parameter is by default FALSE in Oracle9i and TRUE in Oracle8i.
For more information on init.ora parameter 'O7_DICTIONARY_ACCESSIBILITY', please refer to Note 47316.1
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:808362次
积分:8962
积分:8962
排名:第2394名
原创:137篇
转载:45篇
评论:44条
此博客为笔者的DT工作记录,欢迎一起交流学习工作中的点滴,若博客文章观点存在原理的错误、纰漏,笔者非常欢迎各位不保留地指出
(4)(3)(3)(4)(8)(2)(1)(1)(1)(1)(6)(2)(1)(12)(2)(5)(1)(1)(4)(5)(6)(1)(8)(3)(7)(6)(34)(11)(1)(5)(9)(12)(6)(7)(8)
(window.slotbydup = window.slotbydup || []).push({
id: '4740890',
container: s,
size: '250,250',
display: 'inlay-fix'本帖子已过去太久远了,不再提供回复功能。Keyboard Shortcuts?
Next menu item
Previous menu item
Previous man page
Next man page
Scroll to bottom
Scroll to top
Goto homepage
Goto search(current page)
Focus search box
Change language:
Brazilian Portuguese
Chinese (Simplified)
trigger_error
trigger_error & Generates a user-level error/warning/notice message
Description
bool trigger_error
( string $error_msg
[, int $error_type = E_USER_NOTICE
This function is useful when you need to generate a particular response to
an exception at runtime.
Parameters
The designated error message for this error. It's limited to 1024
bytes in length. Any additional characters beyond 1024 bytes will be
truncated.
error_type
The designated error type for this error. It only works with the E_USER
family of constants, and will default to E_USER_NOTICE.
Return Values
This function returns FALSE if wrong error_type is
specified, TRUE otherwise.
Example #1 trigger_error() example
for a more extensive example.
&?phpif&($divisor&==&0)&{&&&&trigger_error("Cannot&divide&by&zero",&E_USER_ERROR);}?&
HTML entities in error_msg are not
escaped. Use
on the message if
the error is to be displayed in a browser.
- Sets which PHP errors are reported
- Sets a user-defined error handler function
- Restores the previous error handler function
the idea is never to give out file names, line numbers, and cryptic codes to the user. Use trigger_error() after you used set_error_handler() to register your own callback function which either logs or emails the error codes to you, and echo a simple friendly message to the user.
And turn on a more verbose error handler function when you need to debug your scripts. In my init.php scripts I always have:
if (_DEBUG_) {
& & set_error_handler ('debug_error_handler');
}
else {
& & set_error_handler ('nice_error_handler');
}
trigger_error always reports the line and file that trigger_error was called on. Which isn't very useful.
main.php:
&?php
include('functions.php');
$x = 'test';
doFunction($x);
?&
functions.php:
&?php
function doFunction($var) {
if(is_numeric($var)) {
trigger_error('var must be numeric');
}
}
?&
will output "Notice: var must be numeric in functions.php on line 6"
whereas "Notice: var must be numeric in main.php on line 4" would be more useful
here's a function to do that:
function error($message, $level=E_USER_NOTICE) {
$caller = next(debug_backtrace());
trigger_error($message.' in &strong&'.$caller['function'].'&/strong& called from &strong&'.$caller['file'].'&/strong& on line &strong&'.$caller['line'].'&/strong&'."\n&br /&error handler", $level);
}
?&
So now in our example:
main.php:
&?php
include('functions.php');
$x = 'test';
doFunction($x);
?&
functions.php:
&?php
function doFunction($var) {
& & if(is_numeric($var)) {
& & & && } else {
& & & && error('var must be numeric');
& & }
}
function error($message, $level=E_USER_NOTICE) {
& & $caller = next(debug_backtrace());
& & trigger_error($message.' in &strong&'.$caller['function'].'&/strong& called from &strong&'.$caller['file'].'&/strong& on line &strong&'.$caller['line'].'&/strong&'."\n&br /&error handler", $level);
}
?&
now outputs:
"Notice: var must be numeric in doFunction called from main.php on line 4"
For those of you wanting one (or more) lines of context on your call to trigger_error, I offer this. Would be nice to use \n to get a proper stack trace, but it seems trigger_ therefore, I use a comma.&?phpfunction trigger_error_with_context($error_msg, $error_type, $context = 1) {& & $stack = debug_backtrace();& & for ($i = 0; $i & $context; $i++)& & {& & & & if (false === ($frame = next($stack))& & & & & && & & & $error_msg .= ", from " . $frame['function'] . ':' . $frame['file'] . ' line ' . $frame['line'];& & }& & return trigger_error($error_msg, $error_type);}?&
If error_type is E_USER_ERROR then trigger_error throw FATAL ERROR and script stopped after this line.&?php$msg = 'This is the test message for echo';trigger_error('Error message', E_USER_ERROR); echo $msg; ?&
Beware, trigger_error() is absolutely useless for transporting your own function's error messages in $php_errormsg:ini_set('track_errors', TRUE);function x() { trigger_error('MY ERROR'); }@x();echo "Error 1: \\"$php_errormsg\\"\\n";@file_get_contents('/nonexisting');echo "Error 2: \\"$php_errormsg\\"\\n";This outputs:Error 1: ""Error 2: "failed to open stream: No such file or directory"This behaviour is consistent with the description of $php_errormsg, which says that the variable will only be available within the scope in which the error occurred. The problem can be worked around with a custom error handler like the one below. However, I'm undecided whether changing the language in this way is good:function errHandler($errno, $errstr, $errfile, $errline) {& global $php_ $php_errormsg = $}set_error_handler('errHandler');
It actually turns out - at least on PHP 5.2.6 on XAMPP (Windows) that for the custom error handler, you will need to set $errorType as the first parameter, and only the second parameter as $message, i.e. in reverse order compared to how the manual states it now.
i recently began using a custom error handling class. the biggest problem is that, with call time pass by reference deprecated, you can't manipulate the error handler class after assigning at as the error handler (and it appears not to be returned by the set_error_handler method as the old error handler). my goal was to be able to store up all my non-fatal errors and print them at the end of script execution. that way i can use 'trigger_error' (which i actually have wrapped in a static method ErrorHandler::throwException for portability purposes... which is a pain because it always has the same line number information!!) for all kinds of errors, including user input erros. so when i check a user's password, for instance i would trigger a warning that said 'incorrect password'. of course i would only want this to print out the error once the script had completed. so in my error handler class i have the following in the constructor:function ErrorHandler(){& & $this-&error_messages& = array();& & error_reporting (E_ALL);& & set_error_handler(array($this,"assignError"));}and my assignError method://accept the required argumentsfunction assignError($errno, $errstr, $errfile, $errline){& & //get the error string& & $error_message = $//if in debug mode, add line number and file info if(ErrorHandler::DEBUG()) $error_message .= "&br&".basename($errfile).",line: ".$& & & & & & switch ($errno)& & & & & & {& & & & & & & & //if the error was fatal, then add the error& & & & & & & & //display an error page and exit& & & & & & & & case ErrorHandler::FATAL():& & & & & & & & & & $this-&setType('Fatal');& & & & & & & & & & $this-&addError($error_message);& & & & & & & & & & Display::errorPage($this-&errorMessages());& & & & & & & & & & exit(1);& & & & & & & && & & & & & & & //if it was an error message, add a message of& & & & & & & & //type error& & & & & & & & case ErrorHandler::ERROR():& & & & & & & & & & $this-&setType('Error');& & & & & & & & & & $this-&addError($error_message);& & & & & & & && & & & & & & & //if it was a warning, add a message of type& & & & & & & & //warning& & & & & & & & case ErrorHandler::WARNING():& & & & & & & & & & $this-&setType('Warning');& & & & & & & & & & $this-&addError($error_message);& & & & & & & && & & & & & & & //if it was some other code then display all& & & & & & & & //the error messages that were added& & & & & & & & default:& & & & & & & & & & Display::errorRows($this-&errorMessages());& & & & & & & && & & & & & }& & & & & & //return a value so that the script will continue& & & & & & //execution& & & & & & return 1;}the key part there is the 'default' behaviour. i found that if i call trigger_error with anything other than E_USER_ERROR, E_USER_WARNING or E_USER_NOTICE, then error code '2' is passed to the handler method. so when it is time to print all my non-fatal errors, like 'password and confirm password don't match' or something, i call ErrorHandler::printAllErrors()& & & & function printAllErrors()& & & & {& & & & & & trigger_error("",2);& & & & }which leads to the default behaviour in my switch statement in the assignError method above. the only problem with this is that the weird bug 'Problem with method call' that occurs with some static method calls (that one person on the bug lists said was fixed and another said wouldn't be fixed until version 5) also produces error code 2!! i have just taken to suppressing these errors with @, because despite the alledged problem with the method call, the script still seems to execute fine.iain.
Some might think that trigger_error is like a throw() or an err.raise construction, and @ works like catch(){} one - in fact it's NOT.function badgirl(){& & trigger_error("shame on me",E_USER_ERROR);& &}$sheis = @badgirl();echo "You will never see this line - @ only supress message, not a control flow";
For those of you looking to use your own file or line number in the error (possibly using debug_backtrace()) instead of the ones created by trigger_error(), here is a solution:Create a custom function to handle E_USER_ERRORs that simply outputs the error type and message, while excluding the line number and file trigger_error() reports. You may also configure it to handle user warnings and notices if necessary (I did in the example below).&?phpfunction error_handler($level, $message, $file, $line, $context) {& & if($level === E_USER_ERROR || $level === E_USER_WARNING || $level === E_USER_NOTICE) {& & & & echo '&strong&Error:&/strong& '.$message;& & & & return(true); }& & return(false); }function trigger_my_error($message, $level) {& & $callee = next(debug_backtrace());& & trigger_error($message.' in &strong&'.$callee['file'].'&/strong& on line &strong&'.$callee['line'].'&/strong&', $level);}set_error_handler('error_handler');function abc($str) {& & if(!is_string($str)) {& & & & trigger_my_error('abc() expects parameter 1 to be a string', E_USER_ERROR);& & }}abc('Hello world!'); abc(18); ?&This is a pretty simple concept and I'm sure most of you know this, but for those that don't, let it serve as a good example!
I am not so familiar with this but I think you can reach some of the functionality of try..catch with this function. I would disagree or correct the previous note. The @ is not the catch, it sets the error_reporting to 0 tempolary but with set_error_handler you can try to imitate some behavior like catch.I've just made this to try if it possible, I never tried in projects but I think could work in php 4. Actually if you want to have the Trace of the error you need to use php4.3+.Maybe not many of you will create new scripts in php4 and try to have some features from php5 but in some cases (extending older projects) this could be better error handling.If this is a wrong approach, waiting for comments, if its not, use it!&?function catch($errno, $errstr, $errfile, $errline){& & $GLOBALS['throw'] = $& & $GLOBALS['throw_info'] = array(& & & & 'Message'=&$errstr& & & & ,'Code'=&$errno& & & & ,'Line'=&$errline& & & & ,'File'=&$errfile& & & & ,'Trace'=&debug_backtrace()& & );& & }set_error_handler('catch');function badgirl(){& & if(true){ //error occure& & & & trigger_error("BadGirlWithError",E_USER_NOTICE); // as throw with notice& & & & // ...because trigger_error does not stop the function& & }else{& & &&& & }}// Try $GLOBALS['throw'] = // ...try...$sheis = badgirl(); //could be @badgirl, display_errors is something else, this just the handling// ..tryif($GLOBALS['throw']){& // This actually catch re-throws too...& & switch($GLOBALS['throw']){ // Catch& & & & case 'GoodGirlException':& & & & & & die('No bad girl today!');& & & && & & & case 'BadGirlWithError':& & & & & & die('Bad girl has some error');& & & && & & & default:& & & & & & // or you can make another trigger_error and re-throw another 'exception' or some other action& & }}echo "You will never see this line - @ only supress message, not a control flow";echo "Wrong! You could see this:)";?&.mano
This one took me some time ...When you use trigger_error with your own error handler, the class instances are destroyed (don't know how to say it better, I am not an expert).So, if you try to call a class function from within the error handler function, you will get 'Call to a member function on a non-object' error, even if this function works perfectly in the rest of your script.Solution : re-use the xxx = new yyy to re-create the instance in the beginning of your error handler ... and then you can call the class functions you want !
We wanted to be able to pass an SQL query to the error handler on our site so we could monitor SQL problems, you cant do this through normal methods so we came up with this bridge script that 100% works&?phpfunction myErrorHandler($errno, $errstr, $errfile, $errline){& & switch ($errno) {& & case E_USER_ERROR:& & & & if ($errstr == "(SQL)"){& & & & & & echo "&b&SQL Error&/b& [$errno] " . SQLMESSAGE . "&br /&\n";& & & & & & echo "Query : " . SQLQUERY . "&br /&\n";& & & & & & echo "On line " . SQLERRORLINE . " in file " . SQLERRORFILE . " ";& & & & & & echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")&br /&\n";& & & & & & echo "Aborting...&br /&\n";& & & & } else {& & & & & & echo "&b&My ERROR&/b& [$errno] $errstr&br /&\n";& & & & & & echo "& Fatal error on line $errline in file $errfile";& & & & & & echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")&br /&\n";& & & & & & echo "Aborting...&br /&\n";& & & & }& & & & exit(1);& & & && & case E_USER_WARNING:& & case E_USER_NOTICE:& & }& & return true;}function sqlerrorhandler($ERROR, $QUERY, $PHPFILE, $LINE){& & define("SQLQUERY", $QUERY);& & define("SQLMESSAGE", $ERROR);& & define("SQLERRORLINE", $LINE);& & define("SQLERRORFILE", $PHPFILE);& & trigger_error("(SQL)", E_USER_ERROR);}set_error_handler("myErrorHandler");$query = "SELECT * FROM tbl LIMIT 1";$sql = @mysql_query($query)& & or sqlerrorhandler("(".mysql_errno().") ".mysql_error(), $query, $_SERVER['PHP_SELF'], __LINE__);& & ?&
Well this is a good way on debuging your php scripts, but i wouldn't feeltoo comfortable by giving out my web servers structure.Notice that what helps you finding and isolating errors in your php helps also a potential attacker.Or maybe i am just paranoid, but its worth mention it.
You should be using set_error_handler (possibly in conjuction with error_log and/or trigger_error) if you want FILE and LINE number information.You don't need macros for this.

我要回帖

更多关于 vusers with errors 的文章

 

随机推荐