表空间数据文件恢复完成后,表空间无法online
alter tablespace APPS_TS_NOLOGGING online
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 7 cannot be read at this time
ORA-01110: data file 7: '/d02/oracle/vssdevdata/APPS_TS_TOOLS01.dbf'
ORA-06512: at line 2

尝试了很多方法都没效果。
最后 在metalink上发现文章, 当用户定义了数据库级的的trigger 并且是alter前触发, 触发器执行SQL正好用要写 所要online的表空间时,就要报此错误。
设置这个触发器,好大一个坑!
SQL> altertablespace APPS_TS_NOLOGGING online;
alter tablespace APPS_TS_NOLOGGING online
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 7 cannot be read at this time
ORA-01110: data file 7: '/d02/oracle/vssdevdata/APPS_TS_TOOLS01.dbf'
ORA-06512: at line 2
总结一下思路:
要online表空间时,会先执行alter的触发器,触发器SQL又要写此表空间,结果发现表空间offline的,触发器无法执行而报错,后续的online也会因为触发器不成功而相继失败。
解决:
alter system set"_system_trig_enabled"=FALSE;
使用隐含参数禁用系统触发器
alter tablespace APPS_TS_TOOLS online;
alter system set"_system_trig_enabled"=TRUE;
恢复隐含参数默认值。
metalink解释原文如下:
Getting Error While Move Relocate (迁移)Datafiles ORA-00604 ORA-00376 ORA-01110 (Doc ID 1958189.1) |
In this Document
APPLIES TO: Oracle Database - Enterprise Edition - Version 11.2.0.3 and later SYMPTOMS Trying to relocate datafiles to a new file system. Unfortunately(不幸地) some datafiles were rename incorrectly. Now 2 tablespaces cannot be onlined, they appear to be pointing to the same datafile:
SQL> alter tablespace APPS_TS_NOLOGGING online;
BEFORE triger,所以---tablespace offline时是可以的;
CAUSE Application user has created custom trigger on database.
CREATE OR REPLACE TRIGGER READONLYDBA.DDL_LOG_BCD_TRG
Due to above trigger,before for every DDL command gets complete above trigger gets invoked. While tablespace recovery, due to ALTER command above trigger gets invoked and it is trying to insert record in ddl_log.
Since tablespace for ddl_log table was offline, trigger execution getting fail and because of that Tablespace recovery ( alter tablespace APPS_TS_NOLOGGING online) getting failed.
So for any method for making tablespace online because of using ALTER command trigger gets invoked and which generates error for single datafile which is involved in trigger.
Below code has bee identified from trace file from 604 trace.
PARSING IN CURSOR #47484096562840 len=237 dep=1 uid=328 oct=47 lid=328 tim=1419955943160751 hv=2607812560 ad='c2f87ce18' sqlid='0ypc526dr03yh' SOLUTION Solution is to invalidate or disable trigger without executing any ddl (ALTER ..) command.
Used below parameter to disable system trigger alter system set "_system_trig_enabled"=FALSE;
sql> alter tablespace APPS_TS_TOOLS online;
REFERENCES NOTE:160705.1 - ORA-00376 and ORA-01110 Database File Unavailable |





