3 # Table recovery with primary composite and secondary 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)) create index idx2 on t1 (f3,f4)
6 # Add entry for t1 table in csqltable.conf file.
7 # Recover with csqlserver -c option.
8 # Verify that it recovers the table with both the index information and all
9 # the records using csqldump tool
11 input
=${PWD}/cache
/Recovery
/createt1.sql
15 REL_PATH
=${PWD}/cache
/Recovery
17 echo "create table t1(f1 int , f2 int,f3 int,f4 char(10),primary key(f1,f2));">$REL_PATH/t1.sql
18 echo "create index idx2 on t1(f3,f4);">>$REL_PATH/t1.sql
21 cp $REL_PATH/csql.conf
/tmp
22 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
24 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
25 DS
="$DSN $DBUSER $PASSWORD"
26 rm -f /tmp
/csql
/csqlds.conf
27 touch /tmp
/csql
/csqlds.conf
28 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
31 rm -f $REL_PATH/t1.sql
35 isql
$DS < $REL_PATH/t1.sql
> /dev
/null
2>&1
38 rm -f $REL_PATH/t1.sql
42 # edit /tmp/csql/csqltable.conf
43 rm -f /tmp
/csql
/csqltable.conf
44 touch /tmp
/csql
/csqltable.conf
45 echo "1 t1 NULL NULL NULL $DSN" > /tmp
/csql
/csqltable.conf
47 $CSQL_INSTALL_ROOT/bin
/csqlserver
-c > /dev
/null
2>&1 &
51 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csqlds.conf
52 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csqlds.conf
53 echo "drop table t1;">>$REL_PATH/drt1.sql
55 $CSQL_INSTALL_ROOT/bin
/csqldump
58 rm -f $REL_PATH/t1.sql
59 isql
$DS < $REL_PATH/drt1.sql
> /dev
/null
2>&1
60 rm -f $REL_PATH/drt1.sql
64 kill -9 $pid > /dev
/null
2>&1
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