6. High Availability : Backup and Restore : Partial Database Backup
 
Share this page                  
Partial Database Backup
If you want the option of a partial database restore then you have to take a partial database backup. For example, if you have to perform data maintenance on a table and you want to make sure that you can revert back to the data set prior to the change, then you should take a backup of the table’s data set. Use CREATE TABLE AS SELECT to store a copy of the data in a different table, or use the COPY statement to export the data from the table into a file. To restore the table, use MODIFY...TO TRUNCATED or the MODIFY...TO COMBINE command to delete all the data from the table:
MODIFY basetable TO TRUNCATED
Then, use INSERT AS SELECT FROM to reinsert the data, or the COPY statement to read the data from the file back into the table.
Warning!  If you drop the table rather than use MODIFY...TO TRUNCATED or the MODIFY...TO COMBINE statement, any dependent objects will be affected--for example, views, grants, constraints.