Created
March 19, 2019 14:46
-
-
Save artyom-smirnov/076879ff9edff7f2b58147eb5665f0ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DB_PATH=/tmp/testdb.fdb | |
DB=localhost:$DB_PATH | |
ISQL="/opt/firebird/bin/isql -q -u SYSDBA -p masterkey" | |
cat << EOF > /tmp/fbtrace_custom.conf | |
database | |
{ | |
enabled = true | |
format = 0 | |
log_connections = true | |
log_statement_start =true | |
} | |
EOF | |
cat << EOF > /tmp/createdb.sql | |
create database '$DB'; | |
EOF | |
cat << EOF > /tmp/q.sql | |
connect '$DB'; | |
exit 0; | |
EOF | |
rm -f $DB_PATH | |
$ISQL -i /tmp/createdb.sql | |
while true; do | |
/opt/firebird/bin/fbtracemgr -se service_mgr -user SYSDBA -password masterkey -start -c /tmp/fbtrace_custom.conf & | |
rdbtracemgr_pid=$! | |
sleep 1 | |
kill -TERM $rdbtracemgr_pid | |
$ISQL -i /tmp/q.sql | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment