我需要将一个表中的数据插入到antoher中。两个表都是分区的。当我尝试插入时,我收到此错误:ORA-14400:插入的分区键不映射到任何分区。
我发现这可能意味着我在表中插入值并且没有为它定义分区。但是我在创建表时使用了这段代码:
CREATE TABLE CENTRUMADMIN.AUD$_BACKUP2
TABLESPACE CUZK_BACKUP
PARTITION BY RANGE (NTIMESTAMP#)
(
PARTITION P_2005 VALUES LESS THAN (TO_DATE('1-1-2006', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2006 VALUES LESS THAN (TO_DATE('1-1-2007', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2007 VALUES LESS THAN (TO_DATE('1-1-2008', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2008 VALUES LESS THAN (TO_DATE('1-1-2009', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2009 VALUES LESS THAN (TO_DATE('1-1-2010', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2010 VALUES LESS THAN (TO_DATE('1-1-2011', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2011 VALUES LESS THAN (TO_DATE('1-1-2011', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2012 VALUES LESS THAN (TO_DATE('1-1-2013', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2013 VALUES LESS THAN (TO_DATE('1-1-2014', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2014_01 VALUES LESS THAN (TO_DATE('1-2-2014', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2014_02 VALUES LESS THAN (TO_DATE('1-3-2014', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2014_03 VALUES LESS THAN (TO_DATE('1-4-2014', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2014_04 VALUES LESS THAN (TO_DATE('1-5-2014', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2014_05 VALUES LESS THAN (TO_DATE('1-6-2014', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2014_06 VALUES LESS THAN (TO_DATE('1-7-2014', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
, PARTITION P_2014_07 VALUES LESS THAN (TO_DATE('1-8-2014', 'DD-MM-YYYY')) TABLESPACE CUZK_BACKUP
)
AS select * from SYS.AUD$ where 1=2;
当我这样做时,如何定义分区?我从表中插入了数十亿行和数据,从2005年到现在。
INSERT INTO CENTRUMADMIN.AUD$_BACKUP2 SELECT
SESSIONID,
ENTRYID,
STATEMENT,
TIMESTAMP#,
USERID,
USERHOST,
TERMINAL,
ACTION#,
RETURNCODE,
OBJ$CREATOR,
OBJ$NAME,
AUTH$PRIVILEGES,
AUTH$GRANTEE,
NEW$OWNER,
NEW$NAME,
SES$ACTIONS,
SES$TID,
LOGOFF$LREAD,
LOGOFF$PREAD,
LOGOFF$LWRITE,
LOGOFF$DEAD,
LOGOFF$TIME,
COMMENT$TEXT,
CLIENTID,
SPARE1,
SPARE2,
OBJ$LABEL,
SES$LABEL,
PRIV$USED,
SESSIONCPU,
NTIMESTAMP#,
PROXY$SID,
USER$GUID,
INSTANCE#,
PROCESS#,
XID,
AUDITID,
SCN,
DBID,
SQLBIND,
SQLTEXT
FROM ISKN.AUD$_BACKUP;
我的数据库版本是10.2.0.4.0。
感谢您的回答。
洪扎