RADE |
Source Code Manager |
Backup and RestoreTools and methods for saving and repairing databases or user workspaces |
Technical Article |
AbstractThis article explains how to save SCM databases or workspace images and how to restore them after a crash. |
The purpose of backups is to allow, in case of hardware breakdown or error of manipulation, to find the most recent possible state of data in the past. For that, data are copied out regularly on a media that is stored in a safe place.
In the worst of cases, after restoration, what was made by user since the last backup is lost. In addition, it is not possible to work during a backup or a restoration.
Some of these perturbations can be avoided by using replication mechanisms like RAID (Redundant Array of Inexpensive Disks). For more information, see RAID documentation . RAID-5 prevents from stopping databases due to one hard disk failures without loss of space and access time.
Anyway backups are needed to avoid to loose data in case of a general accident (fire, inundation, etc).
[Top]
SCM commands register all modifications applied on objects inside workspaces. Those modifications are stored in different repositories split in relational database(s) and one or several SCM file servers. Any command operates in a transaction mode that ensures consistency between image's contents, database's contents and file servers' contents.
Any SCM command that performs changes (adl_co, adl_sync, ...) is composed of (at least) one transaction.
In theory, performing a backup at a given time should need
In concrete, saving databases and file servers' contents is a short operation (few minutes when incremental backups are used) and may often be performed at a time where SCM commands are not used (for instance during the night). Conversely, saving users' images is a long operation (and more there are users, more long this operation will be).
Due to the time needed for saving users' images, we advice to split the backup operation in two tasks:
When restoring images or repositories, this solution leads to check and restore the consistency of images against repositories' contents. This is explained in Repairing One Image's Contents..
[Top]
Here are the steps to follow for backuping SCM repositories.
Step | Action |
---|---|
Stop the monitor to forbid the use of SCM commands | adl_mo_admin -stop |
Stop all file servers (1) | adl_fs_admin -host hostname -port port_number -stop |
Save all databases | For example for Oracle: exp system/manager FULL=Y FILE=XXX (2) |
Save all file server's data | For a given file server: save the directories specified when launching this file server using the -data and -files options (3). |
Start all file servers | telnet hostname -l adl ... adl_file_server -port port_number |
Start the monitor | telnet hostname -l adl ... adl_monitor -port port_number |
(1) the list of file servers can be obtained by adl_ls_contents_server
command)
(2) or any command for saving databases
(3) a fast method could be to first copy these directories on a local disk
of the directories specified using -data and -file options. This copy is
very quick and can be done in incremental to only save modified files. For
example, on Unix, use the commands find OriginDir -newer LastCopyFile -print |
cpio -pdmu DestDir and echo LastCopyFile. When the copy is achieved, the
file servers and the monitor can be started again and the copies can be saved.
[Top]
Users' file systems are saved regularly at different points of time and with different frequencies. Any usual tool can be used for that purpose.
Note: incremental backups can be used but they can lead (when restoring) for deleted files to reappear.
[Top]
Here are the steps to follow for restoring SCM repositories.
Step | Action |
---|---|
Stop the monitor | adl_mo_admin -stop |
Stop all file server's (1) | adl_fs_admin -host hostname -port port_number -stop |
Restore all file servers | For a given file server: restore the directories specified when launching this file server using the -data and -files options |
Restore databases | Use the database tools for analyzing and/or repairing the database. For instance for Oracle: imp system/manager FULL=Y FILE=xxx |
Restart file servers | telnet hostname -l adl ... adl_file_server -port port_number |
Restart the monitor | telnet hostname -l adl ... adl_monitor -port port_number |
Restore users's images against databases' contents | See Restoring Images. |
(1) the list of file servers can be obtained by adl_ls_contents_server command)
Note: even if databases and File Server(s) can be saved at different points in time, it is important - when restoring - to choose a File Server's backup that is more recent than the database's backup to be used. Restoring a File Server's backup that is more recent will produce a consistent restoration, not the reverse!
[Top]
SCM does not provide any tool dedicated neither to save nor to restore a user's file system. The process of restoring an SCM image consists in
[Top]
Repairing means restoring deleted or damaged data using data that are stored in another place (may be under another format).
The directory containing information data for a File Server (the one specified by the -data option) can be rebuilt from the directory containing file versions (the one specified using the -files option).
To do that one must:
[Top]
Here are some methods for repairing one workspace image when it seems it has been damaged.
adl_restore_image -all_fw -format
adl_restore_image -all_fw -format
adl_chk
adl_restore_image filename
adl_co filename
Note: the adl_chk
command can be used at any time for comparing one
image's contents against what is managed in SCM repositories.
[Top]
SCM repositories (Oracle and File Server) must be saved as often as possible.
All repositories must be restored together and using a File Server's backup that is more recent than the database's backup.
Workspace Images can be restored from database contents using the adl_restore_image command and Images' contents can be checked using the adl_chk command.
[Top]
Version: 1 [Mar 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.