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
Use alter partition to edit partitions in the following ways:
Keyword | Description |
---|---|
...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 |
Notes
The first DBS-NAME is the local database, and the second DBS-NAME is the remote database.
Directing a partition to the remote site means the current database is the source. Creating a partition from the remote site means the current database is the target.
To change the authorized partition user, you must change the user for both partitioned databases, as shown in Example 1 (Alter Partition).
If a partitioned host, application, or database is renamed, the rename does not propagate to the partition definition, so you must use alter partition to change the name in the partition definition. As shown in Examples 2 through 5, you must give the old name and the new name. If both names were changed, the partition definition is not recoverable, and must be re-created.
Example
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;
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.
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.
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. |
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.