]>
Commit | Line | Data |
---|---|---|
4d77806d | 1 | #! /bin/sh |
2 | ||
3 | # $Header$ | |
4 | # | |
5 | # Ingres does not come with a utility to rename a database, so we do | |
6 | # it this way. First, rename the directory containing the datafiles. | |
7 | # Then run the program to restore after a system crash. It will cause | |
8 | # the dbdb directory to match where the files are, renaming the | |
9 | # database. | |
10 | ||
11 | if (test $# != 2) then | |
12 | echo Usage: $0 oldname newname | |
13 | exit 1 | |
14 | fi | |
15 | ||
16 | OLDNAME=$1 | |
17 | NEWNAME=$2 | |
18 | INGRES=/usr/rtingres/data/default | |
19 | ||
20 | if (test ! -d $INGRES/$OLDNAME) then | |
21 | echo Database $OLDNAME does not exist! | |
22 | exit 1 | |
23 | fi | |
24 | ||
25 | if (test -r $INGRES/$NEWNAME) then | |
26 | echo Database $NEWNAME already exists! | |
27 | exit 1 | |
28 | fi | |
29 | ||
30 | if (mv $INGRES/$OLDNAME $INGRES/$NEWNAME) then | |
31 | true | |
32 | else | |
33 | echo Unable to move database | |
34 | exit 1 | |
35 | fi | |
36 | ||
37 | echo | /usr/rtingres/bin/finddbs -r |