-
Notifications
You must be signed in to change notification settings - Fork 52
/
dbsetup.sh
45 lines (31 loc) · 874 Bytes
/
dbsetup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
echo "Compile ASN tool ..."
cd /asncdctools/src
/opt/ibm/db2/V11.5/samples/c/bldrtn asncdc
DBNAME=$1
DB2DIR=/opt/ibm/db2/V11.5
rc=1
echo "Waiting for DB2 start ( $DBNAME ) ."
while [ "$rc" -ne 0 ]
do
sleep 5
db2 connect to $DBNAME
rc=$?
echo '.'
done
# enable metacatalog read via JDBC
cd $HOME/sqllib/bnd
db2 bind db2schema.bnd blocking all grant public sqlerror continue
# do a backup and restart the db
db2 backup db $DBNAME to /dev/null
db2 restart db $DBNAME
db2 connect to $DBNAME
cp /asncdctools/src/asncdc /database/config/db2inst1/sqllib/function
chmod 777 /database/config/db2inst1/sqllib/function
# add UDF / start stop asncap
db2 -tvmf /asncdctools/src/asncdc_UDF.sql
# create asntables
db2 -tvmf /asncdctools/src/asncdctables.sql
# add UDF / add remove asntables
db2 -tvmf /asncdctools/src/asncdcaddremove.sql
echo "done"