Wednesday, July 29, 2009

Tip #58 – Restoring Data

If you have some kind of failure that requires you to use a backup you must restore it. Restoring a data dictionary or set of free tables ensures all the data is ready for use. The restore process rebuilds all of the indexes and copies the data to the destination. You can restore data using Advantage Data Architect by right-clicking on an active connection and choosing Restore…

Like backing up data the restore requires a source and destination path. If you are restoring a data dictionary you must provide the adssys password for the dictionary. Choosing Restore… in ARC will bring up the Restore dialog.

ARC_Restore

You can select specific tables to restore from the list displayed on the Advanced tab. Like the Backup dialog the Preview SQL and Command Line tabs display syntax for using the system procedures or command line utility respectively. An example of using sp_RestoreDatabase, sp_RestoreFreeTables and the adsbackup utility are below. The examples are shown without any options specified

EXECUTE PROCEDURE sp_RestoreDatabase( 'C:\Data\Backup\SampleDB.add', 'password', 'C:\Data\SampleDB\SampleDB.add', NULL )

EXECUTE PROCEDURE sp_RestoreFreeTables ( 'C:\Data\Backup', 'C:\Data\FreeTables', NULL, NULL )

adsbackup –r –ppassword "C:\Data\Backup\SampleDB.add" "C:\Data\SampleDB\SampleDB.add"

No comments: