Try OpenEdge Now
skip to main content
Managing Table Partitioning in Databases
Managing Table Partitioning in a Database : Creating a table partition : Creating a table partition policy
 

Creating a table partition policy

You can create a table partition policy and partition a table using the Create the Table Partition Policy wizard.
Before you begin, ensure that you have selected a database connection and the database server is running.
To create a new table partition policy and partition a table:
1. Do one of the following to open the Create Table Partition Policy wizard:
*From the management console, select Database Administration > Data Connections. The Connection page appears. From the list of connections, select the connection in which you want to create the partition policy. Then, in the Storage Management section, click Create partition policy. The Create Table Partition Policy wizard appears.
*From the management console, select Database Administration > Data Connections. The Connection page appears. From the list of connections, select the connection in which you want to create the partition policy. Then, in the Storage Management section, click Partition policies. The Table Partition Policies page appears.
Click New from the page menu options. The Create Table Partition Policy wizard appears.
*From the management console, select Database Administration > New > Partition Policy. The Create Table Partition Policy wizard appears.
2. Provide the following information:
*Policy name — Specify a unique name for the partition policy. The name can contain only alphanumeric characters. It must not contain blank spaces or special characters, except underscore (“_”) and hyphen (“-”).
*Description — Describe the partition policy. Description is an optional field.
*Database connection name — Enter a database connection name to which you want to add the new policy.
You can either enter the database connection name or click Search to select a database connection from the list of connections in the Connection Selection dialog box. To refine your search you can Apply Filter to the connection name based on its AdminServer and/or Category details.
By default, the last used database connection name appears in the Database connection field.
Note: When you type the name of the database connection, follow the format that OpenEdge Management and OpenEdge Explorer use to define a connection: adminserver-name.database-name. A database server must be running to connect to the database. You cannot update the database connection name after you create a table partition policy.
*Table — Specify the table for which the partition policy must be created. Enter a name or click the Search icon to select a table to be partitioned from the Table Selection dialog box.
Note: You cannot update the table selection details after you create a table partition policy.
*Default data area — Specify the default storage location for the table data. Enter an area name or click the Search icon to select an area from the Area Selection dialog box.
In the Area Selection dialog box, you can Apply Filter to the area name based on its Records per block and/or Cluster size details.
*Default index area — Specify the default storage location for the indexes. Enter an area name or click the Search icon to select an area from the Area Selection dialog box. To refine your search you can also Apply Filter to the area name based on its Records per block and/or Cluster size details.
*Default LOB area — Specify the default storage area for the partition's LOB fields. Enter an area name or click the Search icon to select an area from the Area Selection dialog box. To refine your search you can also Apply Filter to the area name based on its Records per block and/or Cluster size details.
*Object allocation rule — Specify Set new partitions not to allocate space to not allocate any space for the new partitions or Set new partitions to allocate space to allocate storage space for the new partitions.
*Read-only composite — Set this option to set a composite table partition policy as read-only.
3. Click Next to specify partition fields and partition aligned indexes for the table partition policy.
Note: The Next button is disabled until all the mandatory fields are specified.
4. Define the partition fields in the Partition fields area using the following:
Note: You cannot update the field selection details after you create a table partition policy.
*Select the Has Range check box if you want to partition the table based on a value range associated with a particular column.
The column supports the following data types: numeric, character, date, datetime, and datetimetz. For example, a partition can be based on a range of values for a data type, such as a historical (date) range or a salary (numeric) range.
*Click Add fields from table to add fields from the table associated with the partitioning. Select fields from the list of fields from the Field Selection dialog box.
*Click Add fields from index to add fields from the index. Select an index from the list of indexes from the Index Selection dialog box.
*Select an existing field and click Remove Field to remove the field from the Table Partition Policy.
*Click the Move field up icon to move a field above an existing field in the list of fields.
*Click the Move field down icon to move a field down.
5. In the Partition aligned indexes area, select one or more indexes from the list of indexes as Local index.
Note: The indexes in this area are populated based on the partition fields added in the Partition fields area. The indexes that are common to the fields in the Partition field area are displayed in the Partition aligned indexes area. You must have at least one aligned index to create table partition policy. If no indexes are displayed in the Partition aligned indexes area, you must add or remove fields added in the Partition fields area or create an index that is aligned with the fields you want to add in the Partition fields area.
6. Click Next to load partition policy details.
Note: The Next button is disabled until all the mandatory fields are specified.
7. Click Properties to set a template for automatically assigning unique names to discovered partition policy details. The Template Properties dialog appears. The default template is in the &{PartitionPolicyName}-&{Number} format.
Note: This feature is useful if there is a large number of discovered partition policy details.
8. Select the Name template location and template property to change the default template.
Note: Properties, such as Values[1] and Values[2], are partition fields with which the indexes are aligned.
9. Click Copy to add the selected template property at the specified Name template location. You can also enter a string manually in the Name template.
10. Click OK to apply the name template changes or click Cancel to exit without changing the default name template.
For example, consider that you create a partition policy, Salary_Partition, on the salary column that stores all the salary details in the Employee table. You can have a partition based on whether the salary is equal to 5000 and another partition based on whether the salary is equal to 6000. The Values[1] property is the EmpID column. To set a name template as &{PartitionPolicyName}-&{Number}-&{Values[1]}EMP_ID:
a. Select the right-most location in Name template and click the Values[1] property.
b. Click Copy to add -&{Values[1]} to the Name template.
c. Select the right-most location in Name template and enter EMP_ID.
The partition policy detail names can be Salary_Partition-1-103988EMP_ID and Salary_Partition-2-102415EMP_ID.
11. Click Load Details for OpenEdge Management or OpenEdge Explorer to discover and load partition policy details to the table partition policy. The names of the discovered policy details are defined based on the partition policy detail name template. After the details load, you can edit them, or commit the existing details.
Note: If the table does not have any data, you must manually add the partition policy details in the next page of the wizard. Note that even though the partitions are discovered and created, the table data does not migrate to the respective partitions until you perform the splittarget operation. Also, the splittarget operation can be performed only on the table partition policy that has the Has range option selected. For information on splittarget, see the Managing table partition policy details section.
12. Click Next to manually load partition policy details or click Finish to accept the default partition policy details loaded in the previous step, or Click Generate policy program to generate OpenEdge ABL code (.p) that you can use in OpenEdge ABL programs to create a table partition policy. Note that generating the policy program only generates the policy program; you must click Finish to commit and add the partition policy to the database.
13. View any of the default partition policy details and perform any of the following:
*Click Add and then specify the partition policy detail values, name, allocation, and area details to manually add a partition policy detail. Click Update to add the partition policy detail or click Cancel to delete the partition policy detail. This adds the policy detail after all the existing policy details.
You can also select an existing partition policy detail and click Insert Before or Insert After to manually add a partition policy detail at a required position in the list of partition policy details.
*Double-click any of the existing table partition policy details to edit the Name/Description, Allocation, and Areas values, and then click Update to incorporate the recently made edits or click Cancel to ignore the recently made edits. For more information on setting table partition policy details, see Creating table partition policy details.
Allocation and Areas values are editable only if the partition policy details are not already in the allocated state.
*Click Reset to ignore all the recently made edits to the partition policy details.
*Select a partition policy detail and click Delete to delete that partition policy detail.
14. Click:
*Finish to commit and add the table partition policy in the database.
*Previous to navigate to a previous page of the wizard and edit any details of the table partition policy.
*Cancel to not add this table partition policy in the database.
*Generate policy program to generate an OpenEdge ABL code (.p) that you can use in OpenEdge ABL programs to create a table partition policy. Note that generating the policy program only generates the policy program; you must click Finish to add the partition policy to the database.
* Loading a partition policy and partition policy details