ORA-22868: table with LOBs contains segments in different tablespaces

snowdba發表於2015-05-02
今天做實驗的時候建立了一個表空間lob_tbs, 並且在該表空間上建立了一個包含大物件欄位的表lob_tab。 當實驗結束想要刪除該表空間時報錯ORA-22868。使用Oracle的幫助資訊oerr ora 22868很容易定位問題的原因,根據提示先刪除含有大欄位的表,然後在刪除該表空間就可以了。

問題還原如下:
1. 建立表空間lob_tbs
create tablespace lob_tbs datafile ‘/dbfiles/lob_tbs01.dbf’ size 100m
autoextend on extent management local;

2. 在users表空間建立表lob_tab,  大欄位列儲存在lob_tbs表空間中
create table lob_tab (id int, doc blog) tablespace users
lob(doc) store as securefile(tablespace lob_tbs compress high deduplicate);

3. 刪除表空間lob_tbs報錯ORA-22868
drop tablespace lob_tbs including contents;
drop tablespace lob_tbs including contents
*
ERROR at line 1:
ORA-22868: table with LOBs contains segments in different tablespaces

使用oerr幫助資訊查到提示drop these tables and reissure drop tablespace. 先刪除表,然後在刪除表空間
enmoedu1*PROD1 ~ $ oerr ora 22868
22868, 00000, "table with LOBs contains segments in different tablespaces"
// *Cause: An attempt was made to drop a tablespace which contains the
// segment(s) for the LOB columns of a table but does not contain
// the table segment.
// *Action: Find table(s) with LOB columns which have non-table segments in
// this tablespace. Drop these tables and reissue drop tablespace.


HR@PROD1 > drop table lob_tab;

SYS@PROD1 > drop tablespace lob_tbs;

Tablespace dropped.

遇到報錯資訊時,使用oerr可提供說明,甚至給出指導性建議來幫助我們處理問題。

全文完

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29047826/viewspace-1618998/,如需轉載,請註明出處,否則將追究法律責任。

相關文章