KB Article #178490

Maintenance application execution may cause a SQL Error

When running a maintenance application in ST LEC (ST version 5.3.3 or above) running on partitioned MSSQL, an error may be observed . Issue manifests if

a) after a database backup / database OS backup is restored ;

b) ST maintenance applications have not run / have failed for a period of time exceeding the log retention interval specified within respective application thus there are no already existing partitions for the time of application run

Actual error message :

MSSQL

" SQL Error occurred in st_proc_DropOldPartitions. Error:7716. Message: Can not create or alter a partition function to have zero partitions. Line: 1


EXPLANATION

Upon triggering a maintenance application ST store procedure first drops the old partitions, then create the new ones.
In case the Maintenance application runs post the time, for which the new partitions exist, (cases of DB / DB OS image backup restore or ST maintenance applications have not run / failed ), present time data is logged in the already existing current partition with older datestamp. In such case upon Maintenance Application triggering above stated SQL errors are thrown, however the partitioning is successful.

Resolution

Recommended : When a database backup / database OS backup is restored run manually respective maintenance application twice . Upon first execution the above stated error is thrown and correctly dated partitions are created. Upon second maintenance application run the data , matching the export criteria specified, is exported .

Alternatively, a DB administrator should manually run st_proc_DropOldPartitions (MSSQL) procedure to recreate partitioning so all new ST events are logged in a correctly named partition (for the present time of running the maintenance ).