X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=doc%2FMAINTENANCE;h=1f0c387b7a64da898d58e23b8c87c669f19adb80;hb=66139347c71685bdab6f72473f68e80ddd31baa4;hp=2055a8338f07ff4c7545be1dfd4100192b5e03f9;hpb=098ba7747de3b627e98e7c619045afdd8ad1a97b;p=mir.git diff --git a/doc/MAINTENANCE b/doc/MAINTENANCE index 2055a833..1f0c387b 100755 --- a/doc/MAINTENANCE +++ b/doc/MAINTENANCE @@ -1,5 +1,40 @@ To dump mir database : + pg_dumplo -a -d -s /dumpdir/dir + pg_dump -c -D -f /dumpdir/.sql +this generates a dir with all blobs and a sql-file with all data. - pg_dump -b -o -F t > mir_dump.tar +To restore the database: + psql < .sql + pgdump_lo -i -d -s /dumpdir/dir -This generates a tar file including blobs as data. \ No newline at end of file +Every once in a while (or make a script) postgresql database should +be "cleaned". See postgresql docs for commands VACUUM and VACUUM ANALYZE + +Every once in a while (or make a script) postgresql database should +be "cleaned". See postgresql docs for commands VACUUM and VACUUM ANALYZE + +We also have misc. perl scripts to merge Large Objects from other DB's. +these can be used as a basis to write your own custom scripts. + + +USER MANAGMENT IN POSTGRESQL + +-- set owner of datbase +select * from pg_database; +select * from pg_user; +update pg_database set datdba=ID_FROM_PG_USER where datname=DATABASENAME + +-- find all tables to grant privs / select is just building sql +-- to be exectued + +select 'grant all on '||relname||' to "de_indy";' +from pg_class +where relname not like 'pg%' +order by relname; + +-- alter table owner / select is just building sql +-- to be exectued +select 'alter table '||relname||' owner to "de_indy";' +from pg_class +where relname not like 'pg%' +order by relname; \ No newline at end of file