Alter Partition

Fix invalid or dangling partition references. Change the authorized user who can connect to both databases. Change the name of an application, database, or host (in the event that something was renamed).

Syntax

Syntax diagram for alter partition.DBS-NAMEHOST-NAMEUSER-NAMEPASSWORDAPP-NAMEDBS-STRING

Use alter partition to edit partitions in the following ways:

KeywordDescription

...set connect

Change the user authorized to access the partitioned databases.

...set hostname

Edit the partition definition to include the correct computer name that hosts the partition source database, target database, or both.

...set application as

Edit the partition definition to include a corrected application name. This is useful if one application name was changed; if both application names changed, the partition definition cannot be corrected and you must re-create it.

...set database as

Edit the partition definition to include a corrected database name. This is useful if one database name was changed; if both database names changed, the partition definition cannot be corrected and you must re-create it.

...direction single

See Example 2 (Alter Partition), Example 4 (Alter Partition), , and Example 5 (Alter Partition).

...direction all

See Example 3 (Alter Partition).

Notes

Example

Example 1 (Alter Partition)

The following example changes the user authorized to access the partitioned databases.

/* To change authorized partition user on target, log in to source & then use: */
       alter transparent partition app1.source to app2.target 
       set connect as newuser identified  by newpasswd;

/* To change authorized partition user on source, log in to target & then use: */
       alter transparent partition app2.target from app1.source 
       set connect as newuser identified  by newpasswd;

Example 2 (Alter Partition)

In the following example, alter partition is used to fix a partition definition that became invalid when a host name (oldHost) changed and affected only one half of the partition definition (app2.target):

alter transparent partition app1.source to app2.target at oldHOST 
     set hostname as newHOST instead of oldHOST direction single;

where direction single indicates that only the target host name needs to be changed.

Example 3 (Alter Partition)

In the following example, alter partition is used to fix a partition definition that became invalid when a host-name change affected both the source and the target, because both applications were on the same host:

alter transparent partition app1.source to app1.target at newHOST 
     set hostname as newHOST instead of oldHOST direction all;

where direction all indicates that the host-name change needs to be made on both the target and source halves of the partition definition.

Example 4 (Alter Partition)

In the following example, alter partition is used to fix a partition definition that became invalid when the source application name (oldAppName) changed to newAppName, and affected only one half of the partition definition:

alter transparent partition newAppName.source to app2.target  
    set application as newAppName instead of oldAppName direction single;

where direction single indicates that only one half of the partition definition needs to be corrected.

Note:

The old application name can be discovered by issuing the display partition statement prior to correcting the partition definition.

Example 5 (Alter Partition)

In the following example, alter partition is used to fix a partition definition that became invalid when the source application name (oldAppName) changed to newAppName, and affected both halves of the partition definition because both partitioned databases were on the same application:

alter transparent partition newAppName.source to newAppName.target  
     set application as newAppName instead of oldAppName direction all;

where direction single indicates both halves of the partition definition need to be corrected.