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

ALTER_TEMPLATE_OBJECT Procedure

This procedure alters objects that have been added to a specified deployment template. The most common changes are altering the object DDL and assigning the object to a different deployment template.

Changes made to the template are reflected only at new sites instantiating the deployment template. Remote sites that have already instantiated the template must re-instantiate the deployment template to apply the changes.

Syntax

DBMS_REPCAT_RGT.ALTER_TEMPLATE_OBJECT (
   refresh_template_name       IN   VARCHAR2, 
   object_name                 IN   VARCHAR2,
   object_type                 IN   VARCHAR2,
   new_refresh_template_name   IN   VARCHAR2 := '-',
   new_object_name             IN   VARCHAR2 := '-',
   new_object_type             IN   VARCHAR2 := '-',
   new_ddl_text                IN   CLOB  := '-',
   new_master_rollback_seg     IN   VARCHAR2 := '-',
   new_flavor_id               IN   NUMBER := -1e-130);

Parameters

Table 21-4 ALTER_TEMPLATE_OBJECT Procedure Parameters  
Parameter Description
refresh_template_name

Deployment template name that contains the object that you want to alter.

object_name

Name of the template object that you want to alter.

object_type

Type of object that you want to alter.

new_refresh_template_name

Name of the new deployment template to which you want to reassign this object. Do not specify a value to keep the object assigned to the current deployment template.

new_object_name

New name of the template object. Do not specify a value to keep the current object name.

new_object_type

If specified, then the new object type. Objects of the following type may be specified:

MATERIALIZED VIEW   PROCEDURE
INDEX               FUNCTION
TABLE               PACKAGE
VIEW                PACKAGE BODY
SYNONYM             TRIGGER
SEQUENCE            DATABASE LINK

new_ddl_text

New object DDL for specified object. Do not specify any new DDL text to keep the current object DDL.

new_master_rollback_seg

New master rollback segment for specified object. Do not specify a value to keep the current rollback segment.

new_flavor_id

This parameter is for internal use only.

Note: Do not set this parameter unless directed to do so by Oracle Support Services.

Exceptions

Table 21-5 ALTER_TEMPLATE_OBJECT Procedure Exceptions  
Exception Description
miss_refresh_template

Deployment template name specified is invalid or does not exist.

miss_flavor_id

If you receive this exception, contact Oracle Support Services.

bad_object_type

Object type is specified incorrectly. See Table 21-4 for a list of valid object types.

miss_template_object

Template object name specified is invalid or does not exist.

dupl_template_object

New template name specified in the new_refresh_template_name parameter already exists.

Usage Notes

Because the ALTER_TEMPLATE_OBJECT procedure utilizes a CLOB, you must use the DBMS_LOB package when using the ALTER_TEMPLATE_OBJECT procedure. The following example illustrates how to use the DBMS_LOB package with the ALTER_TEMPLATE_OBJECT procedure:

DECLARE
   tempstring VARCHAR2(100);
   templob CLOB;
BEGIN
   DBMS_LOB.CREATETEMPORARY(templob, TRUE, DBMS_LOB.SESSION);
   tempstring := 'CREATE MATERIALIZED VIEW mview_sales AS SELECT *
      FROM sales WHERE salesperson = :salesid and region_id = :region';
   DBMS_LOB.WRITE(templob, length(tempstring), 1, tempstring);
   DBMS_REPCAT_RGT.ALTER_TEMPLATE_OBJECT(
      refresh_template_name => 'rgt_personnel',
      object_name => 'MVIEW_SALES',
      object_type => 'MATERIALIZED VIEW',
      new_ddl_text => templob);
   DBMS_LOB.FREETEMPORARY(templob);
END;
/