How Do I Archive a Table in Sql

How Do I Archive a Table in Sql

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?

  1. Create a table with the same columns as the table for which you want to archive data. …
  2. Designate the original table as an archive-enabled table by issuing an ALTER TABLE statement with the ENABLE ARCHIVE clause. …
  3. 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.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.