You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »


ForceClear of database for all instances on the local system



DBclear script
# script assumes that opennsa code is at /usr/src/opennsa 
# LOC1m LOC2 ... LOCn represents uPA instances for individual locations. Scripts assumes that aggregator instances is called "main"  
# the SQL file droptable.sql is needed at the same place as this script

cd /usr/src/opennsa
cp datafiles/schema.sql /tmp/
for l in LOC1 LOC2 main; do
        echo "Dropping tables from opennsa-$l"
        su - opennsa -c "
        psql opennsa-$l -c '\i ./droptables.sql'
        "
        su - opennsa -c "
        psql opennsa-$l -c '\i /tmp/schema.sql'
        "

done


for l in LOC1 LOC2 main; do
        /etc/init.d/opennsa-$l restart
        sleep 1
done
  • No labels