Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: Best practi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 4022 of 4206
Post > Topic >>

Re: Best practice to load a huge table from ORACLE to PG

by craig@[EMAIL PROTECTED] (Craig Ringer) Apr 27, 2008 at 02:51 AM

Joshua D. Drake wrote:
> Potluri Srikanth wrote:
>> But do we link oracle trigger to postgres trigger ?
>>
>> i mean :
>>
>> oracle trigger will take a note of what has been changed .
>> but then how do we pass those changes to postgres trigger ?
> 
> I am assuming you can use the java trigger from oracle to load the 
> postgresql jdbc driver, make a connection to postgresql and perform 
> whatever statement needed to be done.

Note that this will be rather inefficient if you're obtaining a new 
connection every time. It looks like Oracle's Java stored procedures and 
triggers run in an appserver-like environment, though, so you should be 
able to use a connection pool, JNDI, or similar.

Some Java stored procedure examples:

http://www.oracle.com/technology/sample_code/tech/java/jsp/oracle9ijsp.html

You could also use a Java trigger to send simpler change message, with a 
serialized row if required, to an external app that's responsible for 
updating the PostgreSQL database. That might cause less load on the DB 
server.

The trouble with this approach, though, is that it might be hard to get 
right when transactions roll back. An alternative is to use an Oracle 
trigger that inserts records in a change tracking / audit table. You can 
then periodically read and clear the audit table, using that change 
history data to update the PostgreSQL database. This method has the 
advantage of being transaction safe, as data will never become visible 
in the audit table until the transaction making the changes has committed.

--
Craig Ringer

-- 
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 3 Posts in Topic:
Re: Best practice to load a huge table from ORACLE to PG
spotluri@[EMAIL PROTECTED  2008-04-26 10:17:28 
Re: Best practice to load a huge table from ORACLE to PG
jd@[EMAIL PROTECTED] (&q  2008-04-26 08:33:12 
Re: Best practice to load a huge table from ORACLE to PG
craig@[EMAIL PROTECTED]   2008-04-27 02:51:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Aug 21 19:09:02 CDT 2008.