Oracle creates index for primary key in snapshot base table - Oracle Replication

Q.  Oracle creates an index for the _____________ in the snapshot base table.
- Published on 04 Aug 15

a. Primary key
b. Foreign key
c. Super key
d. Both a and c

ANSWER: Primary key
 

    Discussion

  • Nirja Shah   -Posted on 01 Oct 15
    - Primary key snapshots are the default type of snapshot.

    - They are updateable if the snapshot was created as part of a snapshot group and "FOR UPDATE" was specified when defining the snapshot.

    - Changes are propagated according to the row-level changes that have occurred, as identified by the primary key value of the row (not the ROWID).

    - The SQL statement for creating an updateable, primary key snapshot might look like:

    CREATE SNAPSHOT sales.customer FOR UPDATE AS
    SELECT * FROM sales.customer@dbs1.acme.com;

    - Primary key snapshots may contain a subquery so that you can create a horizontally partitioned subset of data at the remote snapshot site.

    - This subquery may be as simple as a basic WHERE clause or as complex as a multilevel WHERE EXISTS clause.

    - Primary key snapshots that contain a selected class of subqueries can still be incrementally or fast refreshed.

    - The following is a subquery snapshot with a WHERE clause containing a subquery:

    CREATE SNAPSHOT sales.orders REFRESH FAST AS
    SELECT * FROM sales.orders@dbs1.acme.com o
    WHERE EXISTS
    (SELECT 1 FROM sales.customer@dbs1.acme.com c
    WHERE o.c_id = c.c_id AND zip = 19555);

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)