Home » SQL & PL/SQL » SQL & PL/SQL » Insert data into SYSTEM partitioned table using DB link (Oracle 11g Release 2, Linux)
Insert data into SYSTEM partitioned table using DB link [message #655415] Tue, 30 August 2016 15:05 Go to next message
anil_mk
Messages: 146
Registered: August 2006
Location: Bangalore, India
Senior Member

Hi All,

I have 2 Oracle databases SRC_DB and TGT_DB, there is DB link DB_LINK1 created at SRC_DB database to point to TGT_DB.

--Run below code in SRC_DB database
CREATE TABLE syspart (c1 NUMBER, c2 NUMBER)
PARTITION BY SYSTEM (
   PARTITION APAC_REGION ,
   PARTITION AMERICA_REGION,
   PARTITION EMEA_region 
);

INSERT INTO SYSPART PARTITION(APAC_REGION) VALUES (1, 2);
INSERT INTO SYSPART PARTITION (AMERICA_REGION) VALUES (3, 4);
commit;

Run below table create script in TGT_DB

CREATE TABLE syspart (c1 NUMBER, c2 NUMBER)
PARTITION BY SYSTEM (
   PARTITION APAC_REGION ,
   PARTITION AMERICA_REGION,
   PARTITION EMEA_region 
);


Now I want to transfer data from SRC_DB to TGT_DB, I tried below INSERT statement but its failing
Run below INSERT statement in SRC_DB
INSERT INTO SYSPART@DB_LINK1 PARTITION(APAC_REGION) SELECT * FROM SYSPART;
COMMIT;

I am getting below error
[Error] Execution (12: 23): ORA-14100: partition extended table name cannot refer to a remote object


Please help me how to INSERT data from system partitioned table data into another system partitioned table(Different DB) of same table structure using DB link .

Thanks
Re: Insert data into SYSTEM partitioned table using DB link [message #655416 is a reply to message #655415] Tue, 30 August 2016 15:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68644
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

ORA-14100: partition extended table name cannot refer to a remote object
 *Cause:  User attempted to use partition-extended table name syntax
          in conjunction with remote object name which is illegal
 *Action: Correct the statement and reenter
Do it in the other way: on remote database use INSERT INTO SYSPART PARTITION(APAC_REGION) SELECT * FROM SYSPART@DB_lINK2;

Re: Insert data into SYSTEM partitioned table using DB link [message #655419 is a reply to message #655416] Tue, 30 August 2016 20:27 Go to previous messageGo to next message
anil_mk
Messages: 146
Registered: August 2006
Location: Bangalore, India
Senior Member

Thanks Michel for the reply.

DB link is created at SRC_DB database, with existing DB link is it possible to INSERT?
INSERT INTO SYSPART@DB_LINK1 PARTITION(APAC_REGION) SELECT * FROM SYSPART PARTITION(APAC_REGION);;
COMMIT;

Thanks
Re: Insert data into SYSTEM partitioned table using DB link [message #655421 is a reply to message #655419] Wed, 31 August 2016 00:46 Go to previous messageGo to next message
Michel Cadot
Messages: 68644
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

What is your opinion about:
"User attempted to use partition-extended table name syntax in conjunction with remote object name which is illegal"?

Why do you think I posted "do it the other way?".

Re: Insert data into SYSTEM partitioned table using DB link [message #655451 is a reply to message #655421] Wed, 31 August 2016 05:34 Go to previous message
anil_mk
Messages: 146
Registered: August 2006
Location: Bangalore, India
Senior Member

Thanks Michel
Previous Topic: query to write rows to column values
Next Topic: Help required in SQL Analytic Funciton
Goto Forum:
  


Current Time: Wed Apr 24 04:19:52 CDT 2024