Once you have modeled your lifecycle, you can instruct PowerDesigner to generate scripts to automate the creation, movement, and purging of partitions
across your lifecycle phases.
Before you generate your data movement scripts, ensure that you have completed all the steps listed in Modeling a Lifecycle.
The following scripts are generated:
-
Move_date.sql - one script per date on which a data movement action is required between the start and end dates you specify and one for any data purges required for partitions arriving at the end of the lifecycle. For example, if you specify a start date of 01/01/2009 and an end date of 12/31/2009 and a partition range of one month, then twelve scripts will be generated.
-
Purge_date.sql - one script per date on which a data purge action is required for partitions arriving at the end of the lifecycle.
-
Select to open the Generate dialog.
-
Specify a directory in which to generate the scripts and, optionally, select to check your model before generation.
-
On the Selection tab, select the tables for which you want to generate data archiving scripts.
-
On the Options tab, specify the start and end date for the period for which you want to generate scripts, along with the method for creating partitions. You can choose between creating partitions:
- Individually, when the previous partition ends (default)
- All at the beginning of the period
-
On the Generated Files tab you can review the list of scripts that will be generated.
-
Click OK to begin the generation.
The scripts are generated in the specified directory and listed in the Results pane. The scripts should be run on the dates included in their filenames. You can run the scripts manually or use Sybase Control Center to automate this process.