ORA-14404: partitioned table contains partitions in a different tablespace

通過drop命令刪除表空間時若提示:

ORA-14404: partitioned table contains partitions in a different tablespace

此時只需找出存在於多個表空間的表,然後刪除該表即可。假設我這裏的表空間是temp_tablespace,先執行以下命令:

select x.table_name, x.partition_name, x.tablespace_name, y.tablespace_name 
from dba_tab_partitions x, dba_tab_partitions y
where x.tablespace_name = 'temp_tablespace' AND y.tablespace_name <> 'temp_tablespace' 
      AND x.table_name = y.table_name;

結果會顯示所有的跨越不同表空間的表來,假設其中表名爲temp_table,這時可執行以下命令刪除表:

drop table temp_table;

但執行結果有可能會提示

ORA-00942: table or view does not exist

這時可以根據表名查找出該表的owner

select table_name, owner, tablespace_Name from Dba_Tables where Table_Name = 'temp_table';

假設owner爲temp_owner,這時只需執行帶有owner的表名即可。

drop table temp_owner.temp_table;

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章