DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: interesting question.

  1. #1
    Join Date
    Jan 2000
    Location
    san jose
    Posts
    149
    hi, guys:

    i can use exp to export several table in same point in time
    by using consistent=y.

    does anybody have idea how to do it by using PLSQL?

    let's say we have table parent, child, grandchild and irrevelant
    there are foreign key constraint between parent and child.
    and between child and grandchild.
    irrevelant have no relationship between other tables.

    by use exp consistent=y i can exp those four table at the
    exactly point in time.

    but what i want to do is
    I have another four tables
    parent_mirror, child_mirror,grandchild_mirror and irrevelant_mirror, i want to copy the original table to those
    mirror tables at the exactly point in time.


    one solution i can thought is use serializable transaction.
    but it may fail and need indefinitely times retry.
    is there any other solution?

    also i maybe wrong about how to use serilizable transaction.
    can somebody write me a PLSQL to explain how to copy it
    to mirror and how to retry( handle the exception of can't serializable)

  2. #2
    Join Date
    Aug 2000
    Posts
    462
    consistent = Y guarantees nothing for those related tables. There is no integrity preservation. consistent applies only to one object, not a schema or multiple objects.

  3. #3
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    if consistent=n each table is exported in single transaction therefore consistency is in in single objects
    if consistent=y Oracle set the transaction read only therefore all objects exported are consistent

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by kmesser
    consistent = Y guarantees nothing for those related tables. There is no integrity preservation. consistent applies only to one object, not a schema or multiple objects.
    Wrong. CONSISTENT=Y guarantees read consistency (and thus integrity preservation) for all tables included in the export.

    As an answer to the original question: why don't you lock all four tables with the single LOCK command? This will ensure the tables are read consistent to the same point in time. Eg

    LOCK TABLE parent, child, grandchild, rrevelant IN EXCLUSIVE MODE NOWAIT;

    Then you can safely copy read consistent table data to other tables.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

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


Click Here to Expand Forum to Full Width