Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2002
    Posts
    3

    Unanswered: Two phase commit

    I have Oracle 9i testdb1 and testdb2 on Linux.


    Where can I find some information regarding what is two phase commit and how to implement? Is it hard to implement? Do I have to install/config Oracle differently? Does two phase commit happen in client level or at the server and how?

    Thanks your help in advance!

    Regards.

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Two phase commit

    Look in the Oracle documentation:

    http://technet.oracle.com/docs/produ...s.htm#CNCPT016

    It is pretty much transparent to the user. If you insert/update/delete across a database link then COMMIT, Oracle will perform a two-phase commit for you. So it is in the server.

  3. #3
    Join Date
    Dec 2002
    Posts
    3
    Thanks for your input. So it that mean as far as database setup, I really don’t to do anything special?

    This is what I have to do it. I have to install two databases with exactly same data on Redhat Linux. Developer will be doing insert, update, delete on both database and I have to do this through 2PC. So that both database would be the same. My question is, do developer has to change their code? Can you give me an example? Do I have to create a dblink to handle it?

    Regards,

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Originally posted by dhaka
    Thanks for your input. So it that mean as far as database setup, I really don’t to do anything special?

    This is what I have to do it. I have to install two databases with exactly same data on Redhat Linux. Developer will be doing insert, update, delete on both database and I have to do this through 2PC. So that both database would be the same. My question is, do developer has to change their code? Can you give me an example? Do I have to create a dblink to handle it?

    Regards,
    Well, that's it as far as how two phase commit works. Yes, you would need to create a dblink. Then you could log in to testdb1 and do things like this:

    INSERT INTO mytable( a,b,c )
    SELECT x,y,z
    FROM yourtable@testdb2;

    UPDATE yourtable@testdb2
    SET y=2
    WHERE x-1;

    COMMIT;

    You have accessed and modified data in testdb1 and testdb2. When you commit, all the changes are committed in both databases, transparently. The term "two phase commit" refers to the internals of how Oracle does it, it is not something you have to program or ask for.

    However, from your latest post I get the impression that what you are really interested in is REPLICATION, i.e.

    - On testdb1 there is a table called MYTABLE
    - On testdb2 there is a table called YOURTABLE
    - On testdb1 I insert a new row into MYTABLE
    - That row is automatically copied over to YOURTABLE@testdb2

    If so, you should read the Oracle Replication guide:

    hhttp://technet.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96567/repoverview.htm

  5. #5
    Join Date
    Dec 2002
    Posts
    3
    Thanks! I couldn’t agree more. I think Replication is the best solution; maybe standby database might a good idea too. But unfortunately my boss totally disagree with me and he think it will be a complicate task. He is "know it all' kind a person. Anyway you have been a great great help.
    I do appreciate your help very much.

    Regards,

  6. #6
    Join Date
    Sep 2002
    Location
    ITALY
    Posts
    53
    Originally posted by dhaka
    Thanks for your input. So it that mean as far as database setup, I really don’t to do anything special?

    This is what I have to do it. I have to install two databases with exactly same data on Redhat Linux. Developer will be doing insert, update, delete on both database and I have to do this through 2PC. So that both database would be the same. My question is, do developer has to change their code? Can you give me an example? Do I have to create a dblink to handle it?

    Regards,
    Your requirements are so that you need to implement ad advanced replication environment, not so and easy task even for a good dba.
    You need a Oracle 9i EE release, and an experienced consultant to help you.

    Don't worry about 2PC, it's embedded in the distributed transaction evironment of oracle replication schemes.
    Franco Ceotto
    SIPTI srl
    OnSite Services
    9i OCP DBA, Performance Engineer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •