表空间READ ONLY ORA-00372

Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE 测试库做传输表空间,一个表空间 READ ONLY 的时候报错。

SQL> ALTER TABLESPACE SMSCSV_DEF READ ONLY;

ALTER TABLESPACE SMSCSV_DEF READ ONLY

*

ERROR at line 1:

ORA-00604: error occurred at recursive SQL level 1

ORA-00372: file 18 cannot be modified at this time

ORA-01110: data file 18: '/u02/oradata/smsdb2/SMSCSV_DEF_1.DBF'

ORA-06512: at line 7

其后查询状态,居然是READ ONLY。不得其解,做10046 TRACE 分析。

TRACE文件中居然发现了如下内容

BEGIN

  --不记录服务器DDL操作

  IF Sys_Context('USERENV', 'HOST')<>'d3main' AND

     Sys_Context('USERENV', 'HOST')<>'mmsbi.d3space.com' AND

     Sys_Context('USERENV', 'TERMINAL')<>'unknown'

  THEN

   INSERT INTO ORADBA.T_Db_Ddllog

                (

                 LOGDATE      ,

                 USERNAME     ,

                 DDLTYPE      ,

                 OBJECTTYPE   ,

                 OBJECTNAME   ,

                 OBJECTOWNNER ,

                 HOSTNAME     ,

                 TERMINALNAME ,

                 OS_USER

                 )

          VALUES(SYSDATE,

                 USER,

                 sys.sysevent,                      --系统DDL事件

                 sys.dictionary_obj_type,           --操作类别table,procedure,index...

                 sys.dictionary_obj_name,           --操作对象名

                 sys.dictionary_obj_owner,          --操作对象拥有者?

                                                                                       Sys_Context('USERENV', 'HOST'),

                 Sys_Context('USERENV', 'TERMINAL'),

                 Sys_Context('USERENV', 'OS_USER')

                 );

  END IF;

END;

这个是一个记录DDL日志的触发器。写了日志文件到T­_DB_DDLLOG中,这个表刚好在SMSCSV表空间中存储,前面READONLY成功,后面又要写东西,怪不得报ORA-00372。将触发器禁用掉,问题解决。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10522540/viewspace-629716/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10522540/viewspace-629716/

你可能感兴趣的:(表空间READ ONLY ORA-00372)