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
droptables.sql
-- OpenNSA SQL Schema (PostgreSQL) -- consider some generic key-value thing for future usage -- ALL timestamps must be in utc drop table generic_backend_connections; drop table sub_connections; drop table service_connections; drop type label;