home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
rebuild.bat
< prev
next >
Wrap
DOS Batch File
|
1997-05-27
|
772b
|
28 lines
@echo off
if %1. == . goto usage
if %2. == . goto usage
if not exist %2.db goto ok1
echo Database %2 exists.
echo You must "dberase" it first.
goto done
:ok1
if not exist unload\*.* goto ok2
echo Directory UNLOAD exists, but is needed for rebuilding.
echo You must remove it first.
goto done
:ok2
mkdir unload
set pwd=%3
if %pwd%. == . set pwd=sql
dbunload -c "uid=dba;pwd=%pwd%;dbf=%1" unload
set pwd=
dbinit %2
isql -c "uid=dba;pwd=sql;dbf=%2;dbs=-q -b" read reload.sql
goto done
:usage
echo Usage: rebuild {olddb} {newdb} [{dba-password}]
echo Unloads "{olddb}.db", then creates "{newdb}.db".
echo Do not specify ".db" in the database names.
goto done
:done