在命令行下备份、恢复井工区
Backing Up Projects Using a Command Line Utility 用命令行程序备份井工区
owbackup
The owbackup program is a command line utility that allows you to back up the database tables in an OpenWorks project to a disk file.
External files are not backed up, and external devices are not available. owbackup can be run from any command line interface using the arguments shown below. The program will work both with and without X running.
To run owbackup as a cron job, you must first set OWHOME, ORACLE_HOME, and ORACLE_SID. OWSYSSID also must be set if it is not correctly set in $OWHOME/conf/lgcenv.cf.
Usage:
owbackup <project_name> <backup_file_name>
Arguments:
Examples:
UNIX:
$OWHOME/bin/owbackup TESTDATA $HOME/backup/TESTdata.dmp
$OWHOME/bin/owbackup WERTZ /backup/WERTZ-’date +”%d-%b-%y”’
单位机器上的实例:
blade{owuser:/home/OpenWorks/bin}% owbackup HJQ /home4/hjq_backup/HJQ.dmp
HJQ: project backup successful
blade{owuser:/home/OpenWorks/bin}%
Windows:
%OWHOME%\bin\owbackup TESTDATA D:\backups\TESTdata.dmp
project name: the name of the project to back up
backup file name: the name of the backup file
owbackup-all
The owbackup-all program is a command line utility that allows you to back up all of the OpenWorks project in a directory to which you have manage access to a disk file. External files are not backed up, and external devices are not available.
owbackup-all backs up each project in the specified directory using a file name consisting of the project name and an extension.
owbackup-all can be run from any command line interface using the arguments shown below. The program will work both with and without X running.
To run owbackup-all as a cron job, you must first set OWHOME, ORACLE_HOME, and ORACLE_SID. OWSYSSID also must be set if it is not correctly set in $OWHOME/conf/lgcenv.cf.
Usage:
owbackup-all <directory_name> [<extension>]
Arguments:
Examples:
UNIX:
$OWHOME/bin/owbackup-all /pa/backups
$OWHOME/bin/owbackup-all /export/home/backups ow987.bkup
Windows:
%OWHOME%\bin\owbackup-all D:\backups ow987.bkup
directory name: the directory where the backup file will be created
extension: the extension of the backup file; optional;
.bkup will be used if no argument is provided
Restoring Using a Command Line Utility 用命令行程序恢复井工区
The owrestore program is a command line utility that allows you to restore the database tables in an OpenWorks project that have been backed up to a disk file. External files are not restored, and external devices are not available.
owrestore can be run from any command line interface using the arguments shown below. The program will work both with and without X running.
Usage:
owrestore <project name> <sid> <size in MB> <backup file name>
Arguments:
Examples:
UNIX:
$OWHOME/bin/owrestore TESTDATA owstar 100 $HOME/backup/TESTdata.dmp
$OWHOME/bin/owrestore WERTZ owwertz 200 /backup/WERTZ-’date +”%d-%b-%y”’
*******************
单位机器上的实例:
blade{owuser:/home/OpenWorks/bin}% owrestore HJQ owblade 400 /home4/hjq_backup/HJQ.dmp
HJQ: project restore successful
blade{owuser:/home/OpenWorks/bin}%
************************
Windows:
%OWHOME%\bin\owrestore TESTDATA owst 100 D:\backup\TESTdata.dmp
project name: the name of the project to restore
sid: the Oracle instance to restore the project to
size: the size of the OpenWorks project to create in Mb
backup file name: the name of the backup file
*****
通常,应首选Landmark图形界面进行井工区的备份与恢复操作,尤其当做恢复试验时,可以直接检查出备份文件是否有效。如果使用的是在命令行下操作,在做恢复试验时,当系统给出某某project restore successful时,一定要打开工区管理菜单,看看恢复的井工区是否上去了,如果没上去的话,说明这个备份文件存在错误或者是无效的,就要用前一个有效的备份来恢复井工区。这种错误很多是由于错误的断层数据造成的。
为保证数据的安全与完整性,同时备份整个 /home目录,OpenWorks、oracle、master、所有地震工区,以及重要的外部数据。这样,一旦出现故障,恢复起来就容易多了。