安大
分类: Oracle
2012-09-03 23:54:52
环境是Oracle 11G R1的环境,在执行truncate语句时,竟然报错
truncate表时出现以下错误
ORA-04045: errors during recompilation/revalidation of XDB.XDB_PI_TRIG
ORA-01031: insufficient privileges
查了一下,说 ORA-04045 是oracle的一个bug,执行以下操作可以修复:
sys 用户进入sqlplus
sqlplus / as sysdba
alter system set "_system_trig_enabled" = false scope=spfile;
alter system set aq_tm_processes=0 scope=spfile;
alter system set job_queue_processes=0 scope=spfile;
然后重启数据库
shutdown immediate
startup
切换到原来的用户执行truncate语句,已经正常了