Oracle7 Server Distributed Systems Volume II: Replicated Data

Contents Index Home Previous Next

Altering a Replicated Object

DDL changes to a replicated object must be made by calling DBMS_REPCAT.ALTER_MASTER_REPOBJECT from the master definition site. The ALTER_MASTER_REPOBJECT procedure lets you supply the DDL that you want to have applied to the replicated object.

To ensure that the change is properly applied at all master sites, you should apply these changes in the following order:

Supplying the DDL

To alter an object in your replicated environment, call the ALTER_MASTER_REPOBJECT procedure in the DBMS_REPCAT package, as shown in the following example:

DBMS_REPCAT.ALTER_MASTER_REPOBJECT(
    sname    => 'acct_rec', 
    oname    => 'emp', 
    type     => 'table', 
    ddl_text => 'ALTER TABLE acct_rec.emp ADD 
                (healthplan NUMBER(7,2) DEFAULT 100 NOT NULL)',
    comment  => `updated by '||user ||' on `||SYSDATE);

This example adds another column to the EMP table. The DDL text supplied is asynchronously applied at each master site as described [*]. If you had made this change using the ALTER TABLE command, instead of by passing this command as an argument to the ALTER_MASTER_REPOBJECT procedure, this change would not have been propagated to the other master sites in the replicated environment.

Local customization of individual replicas at snapshot or master sites is outside the scope of Oracle's symmetric replication facility. As a replication administrator, you must ensure that local customizations do not interfere with any global customizations done with ALTER_MASTER_REPOBJECT.

Additional Information: The parameters for the ALTER_MASTER_REPOBJECT procedure are described in Table 12 - 74, and the exceptions are listed in Table 12 - 75.


Contents Index Home Previous Next