3 # Table recovery with composite index.
4 # Start TDB and create table in TDB t1 (f1 int,f2 int,f3 int,f4 char(10),i
5 # primary key(f1,f2)), Add entry for t1 table in csqltable.conf file.
6 # Recover with csqlserver -c option.
7 # Verify that it recovers the table with both the index information i
8 # and all the records using csqldump tool
10 CSQL_CONF
=${PWD}/cache
/Recovery
/csql.conf
11 input
=${PWD}/cache
/Recovery
/createt1.sql
13 if [ -s "$input" -a -s "$CSQL_CONF" ]
15 REL_PATH
=${PWD}/cache
/Recovery
20 echo "create table t1(f1 int not null, f2 int not null,f3 int,f4 char(10),primary key(f1,f2));">$REL_PATH/t1.sql
22 echo "create table t1(f1 int , f2 int,f3 int,f4 char(10),primary key(f1,f2));">$REL_PATH/t1.sql
24 cp $REL_PATH/csql.conf
/tmp
25 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
27 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
28 DS
="$DSN $DBUSER $PASSWORD"
29 rm -f /tmp
/csql
/csqlds.conf
30 touch /tmp
/csql
/csqlds.conf
31 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
34 rm -f $REL_PATH/t1.sql
38 isql
$DS < $REL_PATH/t1.sql
> /dev
/null
2>&1
41 rm -f $REL_PATH/t1.sql
45 # edit /tmp/csql/csqltable.conf
46 rm -f /tmp
/csql
/csqltable.conf
47 touch /tmp
/csql
/csqltable.conf
48 echo "1 t1 NULL NULL NULL $DSN" >> /tmp
/csql
/csqltable.conf
49 $CSQL_INSTALL_ROOT/bin
/csqlserver
-c >/dev
/null
2>&1 &
53 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csqlds.conf
54 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csqlds.conf
56 $CSQL_INSTALL_ROOT/bin
/csqldump
59 rm -f $REL_PATH/t1.sql
63 kill -9 $pid > /dev
/null
2>&1
64 echo "drop table t1;">>$REL_PATH/drt1.sql
65 isql
$DSN < $REL_PATH/drt1.sql
> /dev
/null
2>&1
66 rm -f $REL_PATH/t1.sql
67 rm -f $REL_PATH/drt1.sql
69 rm -f /tmp
/csql
/csqltable.conf
70 touch /tmp
/csql
/csqltable.conf