设为首页 加入收藏

TOP

【翻译自mos文章】在alter/drop表空间时遇到错误ORA-38301,ORA-00604,purgedba_recyclebin也不行
2015-07-24 11:55:26 来源: 作者: 【 】 浏览:5
Tags:翻译 mos 文章 alter/drop 空间 遇到 错误 ORA-38301 ORA-00604 purgedba_recyclebin 不行

在alter/drop表空间时遇到错误ORA-38301,ORA-00604,purge dba_recyclebin 也不行

适用于:
Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
Information in this document applies to any platform.

症状:
当你试图drop一个empty的tablespace时,遇到与recyclebin相关的错误

SQL> drop tablespace TEST_TBS including contents and datafiles;
 drop tablespace TEST_TBS including contents and datafiles
 *
 ERROR at line 1:
 ORA-00604: error occurred at recursive SQL level 1
 ORA-38301: can not perform DDL/DML over objects in Recycle Bin

尝试purge dba_recyclebin 并 offline该tablespace也不行:

SQL> purge dba_recyclebin;

DBA Recyclebin purged.

SQL> alter tablespace TEST_TBS offline;

Tablespace altered.

SQL> drop tablespace TEST_TBS including contents and datafiles;
 drop tablespace TEST_TBS including contents and datafiles
 *
 ERROR at line 1:
 ORA-00604: error occurred at recursive SQL level 1
 ORA-38301: can not perform DDL/DML over objects in Recycle Bin 


原因:
查询 dba_segments显示该表空间内还有segments

SQL> select SEGMENT_NAME,SEGMENT_TYPE,owner from dba_segments where tablespace_name='TEST_TBS';

 SEGMENT_NAME                   SEGMENT_TYPE       OWNER
 ------------------------------ ------------------ ------------------------------
 BIN$Pks1AnxmMCTgQ8+Ct10wJA==$0 TABLE              ORACLE     
 BIN$Pks790fcQEzgQ8+Ct11ATA==$0 TABLE              ORACLE 

解决方案:

用该schema的owner登陆sqlplus,然后执行purge recyclebin,然后再删除drop tablespace

SQL> purge recyclebin;

SQL> drop tablespace TEST_TBS including contents and datafiles; 


若是这么还是不解决问题,最快速的变通方法就是disable掉recyclebin,再drop tablespace,再enable recyclbin

SQL> conn / as sysdba

SQL> alter system set recyclebin=off;

SQL> drop tablespace TEST_TBS including contents and datafiles;

SQL> alter system set recyclebin=on;

---提醒:11gR2里边,recyclebin貌似是静态参数。

若是上面的步骤不能解决问题,请用下面的方法:

1) sqlplus / as sysdba
2) ALTER SYSTEM SET recyclebin = OFF DEFERRED;
3) disconnect and exit sqlplus
4) sqlplus / as sysdba
5) drop tablespace........
6) sqlplus / as sysdba
7) ALTER SYSTEM SET recyclebin = ON DEFERRED; or ALTER SYSTEM SET recyclebin = ON;

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇timestamp数据类型 下一篇随机森林和GBDT的学习

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Sphinx : 高性能SQL (2025-12-24 10:18:11)
·Pandas 性能优化 - (2025-12-24 10:18:08)
·MySQL 索引 - 菜鸟教 (2025-12-24 10:18:06)
·Shell 基本运算符 - (2025-12-24 09:52:56)
·Shell 函数 | 菜鸟教 (2025-12-24 09:52:54)