Extracting data by Db_link by partition table

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.