Automating partition preallocation
Preallocation of partitions is usually done on a daily or weekly basis, depending on your business requirements. Schedule a partition preallocation task to run as often as necessary to ensure that the required count of preallocated business day, audit, and system log partitions is maintained.
The Transaction Server task scheduler must be used to automate partition preallocation when you are using a Transaction Server that is configured with partitioned database tables. Failing to correctly preallocate business day, audit, and system log partitions during nonpeak processing can cause ingestion to fail and corrupt the database.
If a partition preallocation task is configured for a Transaction Server that does not have partitioned tables, it does nothing. Preallocation is not necessary when the tables are not partitioned because business day creation, auditing, and logging does not interfere with the normal processing in this environment.
To preallocate partitions on a configured schedule, set up the
com.ibm.icpcs.transactionserver.scheduler.PreAllocatePartitionsTask task class name as a
recurring task. For weekly preallocation, the start date for the task needs to be configured such that the
scheduled operation runs in nonpeak times and not on the day the Transaction Server was started.
Using a start date that is in the past is a good way to ensure that it is scheduled for the immediate
future.
Example XML for the partition preallocation task
<TASK background="yes">
<NAME>Daily Partition Pre-Allocation</NAME>
<EXEC>
com.ibm.icpcs.transactionserver.scheduler.PreAllocatePartitionsTask
</EXEC>
<PARAMETER name="preAllocationCountForBday">5</PARAMETER>
<PARAMETER name="initialPreAllocationCountForBday">5</PARAMETER>
<PARAMETER name="preAllocationCountForAuditing">5</PARAMETER>
<PARAMETER name="preAllocationCountForSystemLogs">5</PARAMETER>
<TIMER type="repeating">
<STARTING>5:45 am</STARTING>
<INTERVAL>1 bday</INTERVAL>
</TIMER>
</TASK>In this example, preallocation occurs on every business day and starts at 5:45 AM. Enough partitions are created to bring the count to five unused partitions. The preallocation count of five is the target number of unused partitions, not the number of partitions to be allocated when the task runs. For example, if three unused preallocated partitions are left from a prior allocation, only two more partitions are allocated to bring the total to five.
Manually running the partition preallocation task if necessary
A set of business day partitions is used every time a new business day is opened. The audit tables and system log use a new set of partitions for every calendar day. Always preallocate enough business day, audit, and system log partitions so that they do not run out before the next time that the task runs.
If the preallocated partitions do run out, you can force a manual invocation of the preallocation task to bring the totals back up to the configured counts. To manually run the preallocation task, start by running the list schedule command on the Transaction Server to see the currently scheduled tasks.
list schedule
Task Id Next Fire Name
=========== ======================= ================================
-2 01/20/2011 09:32 AM Tracking Monitor
-1 01/20/2011 09:55 AM Daily Business Day Purge
-4 01/23/2011 01:55 AM Weekly Partition Pre-Allocation
-5 Manual ISN Pre-Allocation Task
Scheduled tasks successfully listed
In the example, the weekly partition preallocation task has a task ID of minus four (-4). To force a manual invocation of the task immediately, start the task with the indicated task ID by running the command: fire task -4.
This command causes the partition preallocation task to run immediately to force the counts back up to the configured numbers. Forcing preallocation during normal operational hours is an emergency procedure. All other processing needs to be stopped before a preallocation is attempted.