删除表空间时,遇到了ORA-14404错误

在尝试删除Oracle数据库的表空间时,遇到了ORA-14404错误。该错误通常表示尝试删除的表空间仍然包含活动的数据文件或者被其他对象引用。为了解决这个问题,需要先确保表空间内无对象,然后解除所有数据文件的联接,并在安全模式下执行删除操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


删除表空间时,遇到了ORA-14404错误。

错误信息如下:
SQL> DROP TABLESPACE PART1 INCLUDING CONTENTS AND DATAFILES;
DROP TABLESPACE PART1 INCLUDING CONTENTS AND DATAFILES
ORA-14404: partitioned table contains partitions in a different tablespace

同样查看官方文档的说明:
Oracle Error: ORA-14404

Error Description:
Partitioned table contains partitions in a different tablespace

Error Cause:
An attempt was made to drop a tablespace which contains tables whose partitions are not completely contained in this tablespace.

Action:
Find tables with partitions which span the tablespace being dropped and some other tablespace(s). Drop these tables or move partitions to a different tablespace.

问题分析:
ORA-14404错误说明有某个表不仅仅只在当前表空间,在其他表空间也存有数据。解决方法,Oracle的建议也比较清晰,要么删除这个表,要么把移动partitions到一个单独的表空间中。对于我来说,我删除此表即可。

首先需要找到到底是哪张表跨越了不同表空间:
SQL> SELECT x.table_name,x.partition_name,x.tablespace_name 表空间1, y.tablespace_name 表空间2
  2  FROM dba_tab_partitions x, dba_tab_partitions y
  3  WHERE x.tablespace_name ='PART1' AND y.tablespace_name <> 'PART1' AND x.table_name=y.table_name;
TABLE_NAME                     PARTITION_NAME                 表空间1                        表空间2
------------------------------ ------------------------------ ------------------------------ ------------------------------
RANGE_PART                     YR0                            PART1                          PART2
RANGE_PART                     YR0                            PART1                          PART3
RANGE_PART                     YR0                            PART1                          PART4


即找到名称为RANGE_PART的分区表的数据在表空间PART1PART2PART3上,接下来删除此表即可。
SQL> drop table RANGE_PART;
Table dropped



参考:



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值