Skip Headers

Oracle® Database Advanced Replication Management API Reference
10g Release 1 (10.1)

Part Number B10733-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to current chapter
Up
Go to next page
Next
View PDF

CREATE_MASTER_REPOBJECT Procedure

This procedure makes an object a replicated object by adding the object to a master group. This procedure preserves the object identifier for user-defined types and object tables at all replication sites.

Replication of clustered tables is supported, but the use_existing_object parameter cannot be set to false for clustered tables. In other words, you must create the clustered table at all master sites participating in the master group before you execute the CREATE_MASTER_REPOBJECT procedure. However, these tables do not need to contain the table data. So, the copy_rows parameter can be set to true for clustered tables.

Syntax

DBMS_REPCAT.CREATE_MASTER_REPOBJECT (
   sname                IN   VARCHAR2,
   oname                IN   VARCHAR2, 
   type                 IN   VARCHAR2,
   use_existing_object  IN   BOOLEAN     := true, 
   ddl_text             IN   VARCHAR2    := NULL, 
   comment              IN   VARCHAR2    := '', 
   retry                IN   BOOLEAN     := false,
   copy_rows            IN   BOOLEAN     := true,
   gname                IN   VARCHAR2    := '');

Parameters

The following table describes the parameters for this procedure.

Table 18-54 CREATE_MASTER_REPOBJECT Procedure Parameters  
Parameters Description
sname

Name of the schema in which the object that you want to replicate is located.

oname

Name of the object you are replicating. If ddl_text is NULL, then this object must already exist in the specified schema. To ensure uniqueness, table names should be a maximum of 27 bytes long, and package names should be no more than 24 bytes. The object cannot be a storage table for a nested table.

type

Type of the object that you are replicating. The following types are supported:

FUNCTION                SYNONYM
INDEX                   TABLE
INDEXTYPE               TRIGGER
OPERATOR                TYPE
PACKAGE                 TYPE BODY
PACKAGE BODY            VIEW
PROCEDURE

use_existing_object

Indicate true if you want to reuse any objects of the same type and shape at the current master sites. See Table 18-56 for more information.

Note: This parameter must be set to true for clustered tables.

ddl_text

If the object does not already exist at the master definition site, then you must supply the DDL text necessary to create this object. PL/SQL packages, package bodies, procedures, and functions must have a trailing semicolon. SQL statements do not end with trailing semicolon. Oracle does not parse this DDL before applying it; therefore, you must ensure that your DDL text provides the appropriate schema and object name for the object being created.

If the DDL is supplied without specifying a schema (sname parameter), then the default schema is the replication administrator's schema. Be sure to specify the schema if it is other than the replication administrator's schema.

Note: Do not use the ddl_text parameter to add user-defined types or object tables. Instead, create the object first and then add the object.

comment

This comment is added to the OBJECT_COMMENT field of the DBA_REPOBJECT view.

retry

Indicate true if you want Oracle to reattempt to create an object that it was previously unable to create. Use this if the error was transient or has since been rectified, or if you previously had insufficient resources. If this is true, then Oracle creates the object only at master sites whose object status is not VALID.

copy_rows

Indicate true if you want the initial contents of a newly replicated object to match the contents of the object at the master definition site. See Table 18-56 for more information.

gname

Name of the replication group in which you want to create the replicated object. The schema name is used as the default replication group name if none is specified, and a replication group with the same name as the schema must exist for the procedure to complete successfully in that case.

Exceptions

Table 18-55 CREATE_MASTER_REPOBJECT Procedure Exceptions  
Exceptions Description
nonmasterdef

Invocation site is not the master definition site.

notquiesced

Master group is not quiesced.

duplicateobject

Specified object already exists in the master group and retry is false, or if a name conflict occurs.

missingobject

Object identified by sname and oname does not exist and appropriate DDL has not been provided.

typefailure

Objects of the specified type cannot be replicated.

ddlfailure

DDL at the master definition site did not succeed.

commfailure

At least one master site is not accessible.

Object Creations

Table 18-56 Object Creation at Master Sites  
Object Already Exists? COPY_ROWS USE_EXISTING_
OBJECTS
Result

yes

true
true

duplicatedobject message if objects do not match. For tables, use data from master definition site.

yes

false
true

duplicatedobject message if objects do not match. For tables, DBA must ensure contents are identical.

yes

true/false
false

duplicatedobject message.

no

true
true/false

Object is created. Tables populated using data from master definition site.

no

false
true/false

Object is created. DBA must populate tables and ensure consistency of tables at all sites.