Create a new table with all the columns being the same as in the original table with the additional identity column as the primary key. Load X days of data from the original table. Archive data from the original table to the [Archive] database by running a script in chunks of rows. Verify the result.
How do you create an archive table?
- Create a table with the same columns as the table for which you want to archive data. …
- Designate the original table as an archive-enabled table by issuing an ALTER TABLE statement with the ENABLE ARCHIVE clause. …
- If you want rows to be automatically archived, set the built-in global variable SYSIBMADM.
How do you archive a database?
Archive now Select Database | Manage Database Backup and Restore. In the upper right Databases pane, select the full STORAGE database you wish to archive. The database must have reached its maximum size, and a new database must be started. Right-click the STORAGE database and select Archive.