[重慶思莊每日技術分享]-在為表新增了列後執行ALTER TABLE SHRINK SPACE 提示ORA-8102
APPLIES TO:Oracle Database - Standard Edition - Version 12.1.0.1 to 19.7.0.0.0 [Release 12.1 to 19]
Information in this document applies to any platform.
SYMPTOMS
ALTER TABLE SHRINK SPACE command returns ORA-8102 after adding column.
SQL> alter table <TABLE_NAME> shrink space;
alter table <TABLE_NAME> shrink space
*
ERROR at line 1:
ORA-08102: index key not found, obj# NNNNN, file N, block NNNNN (2)
CHANGES
After adding a column with add column optimization and creating a new index on the column.
"add column optimization" is enabled by default when adding a column with DEFAULT value.
alter table <TABLE_NAME> add <COLUMN_NAME_NEW> number default 10 not null;
create index <INDEX_NAME_NEW> on <TABLE_NAME> ( <COLUMN_NAME1>, <COLUMN_NAME_NEW>);
CAUSE
This problem has been investigated under Bug:22473983.
SOLUTION
After the error:
Drop a index on the table for the added column. And rerun ALTER TABLE SHRINK SPACE command.
After completion the shrink table, recreate the index as you need.
drop index <INDEX_NAME_NEW>;
Before the adding columns:
Before adding columns, set parameter "_add_col_optim_enabled" = false.
alter session set "_add_col_optim_enabled" = false;
alter table <TABLE_NAME> add <COLUMN_NAME_NEW> number default 10;
create index <INDEX_NAME_NEW> on <TABLE_NAME> ( <COLUMN_NAME1>, <COLUMN_NAME_NEW>);
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69950318/viewspace-2864602/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [重慶思莊每日技術分享]-expdp按日期匯出表
- [重慶思莊每日技術分享]-重建 oracle Bootstrap IndexesOraclebootIndex
- [重慶思莊每日技術分享]-執行DROP USER ... CASCADE操作刪除很慢
- [重慶思莊每日技術分享]-asynch descriptor resize等待事件事件
- [重慶思莊每日技術分享]-oracle 12c透明加密Oracle加密
- [重慶思莊每日技術分享]-free buffer waits 等待事件AI事件
- [重慶思莊每日技術分享]-清除控制檔案的資訊
- [重慶思莊每日技術分享]-psu報錯“CheckActiveFilesAndExecutables” failedAI
- [重慶思莊每日技術分享]-閃回表時報錯ORA-38305
- [重慶思莊每日技術分享]-$ORACLE_HOME/OPatch/ocm/bin/emocmrsp 不再有了Oracle
- [重慶思莊每日技術分享]-ORA-1142 signalled during: ALTER DATABASE END BACKUPDatabase
- [重慶思莊每日技術分享]-重建LOB欄位上的IndexIndex
- [重慶思莊每日技術分享]-控制檔案自動備份
- [重慶思莊每日技術分享]-監聽的靜默配置安裝
- [重慶思莊每日技術分享]-安裝GI時報錯“Oracle Restart Integrity”OracleREST
- [重慶思莊每日技術分享]-ora-12592包錯誤
- [重慶思莊每日技術分享]-RAC 一節點Listener狀態為Not All Endpoints Registered
- [重慶思莊每日技術分享]-Redhat Linux 6.5安裝ORACLE ASMLIBRedhatLinuxOracleASM
- [重慶思莊每日技術分享]-ORACLE 19C 實現不管大小寫Oracle
- [重慶思莊每日技術分享]-local_listener導致登入異常
- [重慶思莊每日技術分享]-如何禁止普通使用者使用crontab 命令?
- [重慶思莊每日技術分享]-ORACLE19C UNDO共享模式轉換為本地模式Oracle模式
- alter table move 和 alter table shrink space的區別
- ALTER TABLE MOVE | SHRINK SPACE區別
- [重慶思莊每日技術分享]-在自動UNDO管理情況下,如何手工增加undo段
- [重慶思莊每日技術分享]-PSU實施異常unable to get oracle owner forOracle
- [重慶思莊每日技術分享]-ORA-16525 dg broker不可用
- [重慶思莊每日技術分享]-備庫使用RMAN獲得歸檔日誌
- [重慶思莊每日技術分享]-告警日誌中出現ORA-48132 ORA-48170
- [重慶思莊每日技術分享]-Oracle expdp ORA-01775: looping chain of synonymsOracleOOPAI
- [重慶思莊每日技術分享]-ORACLE 12C 新功能 max_idle_timeOracle
- [重慶思莊每日技術分享]-安裝oracle19c時報錯DBT-50000Oracle
- [重慶思莊每日技術分享]-expdp導資料時評估匯出檔案大小
- [重慶思莊每日技術分享]-報警日誌中不停出現ORA-21780
- [重慶思莊每日技術分享]-11G 打補丁遇到:unable to get oracle owner forOracle
- ALTER TABLE MOVE和SHRINK SPACE區別
- [重慶思莊每日技術分享]-ORACLE 19C資料庫啟動後,無監聽服務Oracle資料庫
- [重慶思莊每日技術分享]-安裝19c grid時執行指令碼報CRS-1705錯誤指令碼