You couple of options:
- Use CAST to force the datatype . You'll have to find the mismatch columns and use cast to align it with the table1 datatype. Example create table table2 as select cast( col1 as varchar2(20) ) as col1 etc.... where date_text <= '2015-12-31' . Refrain from using * and list out all columns in the source table table1.
Beside CTAS above , you may try :
- Using the "FOR PARTITION EXCHANGE" option of the create table command. This is a two steps process
- Create table2 tablespace TS_table1_2014 for exchange with table1;
- Insert into table2 select * from table1;
- dbms_metadata.get_ddl('TABLE', 'TABLE2');
then get the ddl code and execute it, when table2 is created,
insert the data with
insert into TABLE2 select * from TABLE1;