【Oracle】ORA-14400: 插入的分區關鍵字未映射到任何分區

來源:互聯網
上載者:User

標籤:.exe   out   欄位   err   情況   欄位名   stat   except   cal   

問題描述:

  工作中使用kettle將原始庫中的資料幫浦到標準庫中,在抽取過程中報錯:【ORA-14400: 插入的分區關鍵字未映射到任何分區】/【ORA-14400: inserted partition key does not map to any partition】

解決過程:

ORA-14400: 插入的分區關鍵字未映射到任何分區
ORA-06512: 在 "NMS_FMS.BATCH_SAVE", line 1109

ORA-06512: 在 line 1

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:218)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:969)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3476)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4400)
at com.mchange.v2.c3p0.impl.NewProxyCallableStatement.execute(NewProxyCallableStatement.java:3044)

  經過百度,發現出現ORA-14400是表分區出現問題。  

  1.確定該表是否已經添加了表分區。    

select partition_name,high_value from user_tab_partitions t where table_name=‘table_name‘;

  2.查詢表分區綁定的欄位名稱。   

select * from user_part_key_columns t where name=‘table_name‘;

  3.查看當前表分區的具體情況

select * from user_tab_partitions t where table_name=‘table_name‘;

  4.查詢表分區綁定的欄位的最大值。註:此處的table_name應為當前表對應的原始庫中的源表。

select max(key_column) from table_name t;

  5.將查詢到的表分區綁定欄位的最大值插入到當前表中進行測試,發現報錯。

insert into table_name(table_column1,table_column2,......,key_column) values(value1,value2,......,key_value);

  6.經過以上環節確定源表中出現錯誤資料,並且由於錯誤資料的時間跨度大於當前分區的範圍,導致ORA-14400錯誤的出現,但是由於該資料必須保留,因此對錶分區進行擴充。

  7.擴充當前表分區以保證範圍大於綁定欄位的最大值。

alter table  table_name add partition part_key_column_029 values less than (to_date(‘2029-01-01 00:00:00‘,‘YYYY-MM-DD HH24:MI:SS‘,‘NLS_CALENDAR=GREGORIAN‘))       tablespace tablespace_name       pctfree 10        initrans 1       maxtrans255,......,alter table  table_name add partition part_key_column_049 values less than (to_date(‘2049-01-01 00:00:00‘,‘YYYY-MM-DD HH24:MI:SS‘,‘NLS_CALENDAR=GREGORIAN‘))
       tablespace tablespace_name       pctfree 10       initrans 1       maxtrans255,

  8.結束。再次使用kettle進行抽取時順利抽取。

【Oracle】ORA-14400: 插入的分區關鍵字未映射到任何分區

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.