lib/
subdirectory and some shell scripts in a bin
subdirectory.
mysqldump --quick --add-drop-table -p domprodtest > dpt.dumpand entering your password when prompted. Note that the database can be HUGE, so make sure you've got enough diskspace. You can compress the dump by piping it to
bzip2 -c
or
gzip -c
:
mysqldump --quick --add-drop-table -p domprodtest | bzip2 -c > dpt.dump
bin/find_dup_products.sh
finds and removes
duplicate or unreferenced Product and/or Assembly rows
bin/find_orphans.sh
finds and removes references
to any nonexistent IDs in the entire database
-d
option to enable them to make
changes to the database.-v
option to
provide a description of the actions each program is taking.find_dup_products.sh
utility will change the database, you can run:
bin/find_dup_products.sh -vOnce you're confident that the programs won't do any harm, run
bin/find_dup_products.sh -v -d
and
bin/find_orphans.sh -v -d
. This first pass may cause
other unreferenced rows to be exposed, so you should rerun both
programs until no more duplicate/unreferenced rows are found.bin/find_dup_products.sh
is the
really important program to run.bin/find_orphans.sh
is nice to run, it can also take
a long time to run. If you'd like, you can run
bin/list_table_sizes.sh -utester
-ppassword
to list the number of rows in each table in the database, and then
use the -i
option to disable checking of the largest
tables, like:
bin/find_orphans.sh -v -d -i STFResultParameter -i STFResult
master
entry to your
domprodtest.properties
file. Currently we are
synchronizing with glacier.lbl.gov
, but this will
change to a master machine in icecube.wisc.edu
at some
point:
database.master.driver: org.gjt.mm.mysql.Driver database.master.url: jdbc:mysql://glacier.lbl.gov/domprodtest database.master.user: XXX database.master.password: YYYZZZYou'll need to ask Dave Glowacki for the master database user and password and use those to fill in the XXX and YYYZZZ entries above.
bin/sync-domprodtest.sh
application is used to
synchronize the local database with the master database. Unlike the
find_dup_products.sh
and find_orphans.sh
applications, the sync-domprodtest.sh
application makes
changes to the database by default. If you'd like to see what would be
done without any changes being made to the database, specify the
-t
option:
bin/sync-domprodtest.sh -v -tNOTE: This script will instruct you to modify it the first time it is run. Once these changes are made, these modification messages should disappear.
bin/sync-domprodtest.sh -vThis will update your local database with the information for all the DOMs which are in the master database, and simultaneously add to the master database any DOMs in your local database which it doesn't know about.
sync-domprodtest.sh
. Any output from this second run
will fall into one of the following categories:
== Missing table "XXX"
== Extra table "XXX"
== master.XXX does not match
local.XXX
== Missing index "YYY" on XXX
== Extra index "YYY" on XXX
== master.XXX index "YYY" does not match
local.XXX index "YYY"
bin/sync-domprodtest.sh
as a cron job which is run
every night, so that your database continues to stay synchronized.
(Note that you'll need to specify the full path to
sync-domprodtest.sh
when adding it to cron.)