db:11.2.0.3.0
Os:oracle-linux 5.7
To build a table statement:
CREATE TABLE YOON. Yoon_his
(
C_ID number is not NULL,
Yoon_code VARCHAR2 (30),
Create_time DATE,
Update_time DATE NOT NULL,
)
Partition by range (Create_time)
(
Partition part_01 values less than (To_date (' 2012-10-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian '))
Tablespace YOON
Pctfree 10
Initrans 1
Maxtrans 255,
Partition sys_p29637 values less than (To_date (' 2014-08-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ‘))
Tablespace YOON
Pctfree 10
Initrans 1
Maxtrans 255
Storage
(
Initial 8M
Next 1M
Minextents 1
Maxextents Unlimited
),
Partition sys_p30739 values less than (To_date (' 2014-09-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ‘))
Tablespace YOON
Pctfree 10
Initrans 1
Maxtrans 255
Storage
(
Initial 8M
Next 1M
Minextents 1
Maxextents Unlimited
),
Partition sys_p31828 values less than (To_date (' 2014-10-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ‘))
Tablespace YOON
Pctfree 10
Initrans 1
Maxtrans 255
Storage
(
Initial 8M
Next 1M
Minextents 1
Maxextents Unlimited
),
Partition sys_p32711 values less than (To_date (' 2014-11-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ‘))
Tablespace YOON
Pctfree 10
Initrans 1
Maxtrans 255
Storage
(
Initial 8M
Next 1M
Minextents 1
Maxextents Unlimited
),
Partition sys_p33052 values less than (To_date (' 2014-12-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ‘))
Tablespace YOON
Pctfree 10
Initrans 1
Maxtrans 255
Storage
(
Initial 8M
Next 1M
Minextents 1
Maxextents Unlimited
)
);
Create Db_link to extract data by partition table. (The data volume is too large, about 800 million lines, direct extraction will report the undo rollback segment Error)
The method of extracting numbers by partition is as follows:
Insert/*+append*/into YOON. Yoon_his Select/*+ Parallel (t 8) */* from [email protected] t
where create_time<= (To_date (' 2012-10-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian '));
Commit
Insert/*+append*/into YOON. Yoon_his Select/*+ Parallel (t 8) */* from [email protected] t
where Create_time> (To_date (' 2012-10-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ')) and
create_time<= (To_date (' 2014-09-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian '));
Commit
Insert/*+append*/into YOON. Yoon_his Select/*+ Parallel (t 8) */* from [email protected] t
where Create_time> (To_date (' 2014-09-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ')) and
create_time<= (To_date (' 2014-10-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian '));
Commit
Insert/*+append*/into YOON. Yoon_his Select/*+ Parallel (t 8) */* from [email protected] t
where Create_time> (To_date (' 2014-10-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ')) and
create_time<= (To_date (' 2014-11-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian '));
Commit
Insert/*+append*/into YOON. Yoon_his Select/*+ Parallel (t 8) */* from [email protected] t
where Create_time> (To_date (' 2014-11-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ')) and
create_time<= (To_date (' 2014-12-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian '));
Commit
Insert/*+append*/into YOON. Yoon_his Select/*+ Parallel (t 8) */* from [email protected] t
where Create_time> (To_date (' 2014-12-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ')) and
create_time<= (To_date (' 2015-01-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian '));
Commit
Insert/*+append*/into YOON. Yoon_his Select/*+ Parallel (t 8) */* from [email protected] t
where Create_time> (To_date (' 2015-01-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian ')) and
create_time<= (To_date (' 2015-02-01 00:00:00 ', ' syyyy-mm-dd HH24:MI:SS ', ' Nls_calendar=gregorian '));
Commit
Extracting data by Db_link by partition table