view · edit · sidebar · attach · print · history

Dropping and Restoring Database from XMLconv

  • sudo -u postgres dropdb sandoz_xmlconv
  • sudo -u postgres createdb -E UTF8 -T template0 sandoz_xmlconv
  • psql --user postgres -h localhost
  • postgres=# ALTER ROLE "sandoz_xmlconv" LOGIN;
  • zcat /var/backup/fast/db/postgresql/March-2017/2017-03-12/22\:00-postgresql_database-sandoz_xmlconv-backup.gz | psql -U sandoz_xmlconv

and

  • zcat /var/backup/fast/db/postgresql/March-2017/2017-03-12/22\:00-postgresql_database-sandoz_bbmb-backup.gz | psql -U postgres
  • postgres=# CREATE ROLE "sandoz_bbmb";
  • ALTER ROLE "sandoz_bbmb" LOGIN;

Above can help if you geht the below error: See File in Slack

/usr/local/lib/ruby/gems/2.3.0/gems/ydbd-pg-0.5.3/lib/dbd/pg/statement.rb:62:in `rescue in execute'
/usr/local/lib/ruby/gems/2.3.0/gems/ydbd-pg-0.5.3/lib/dbd/pg/statement.rb:37:in `execute'
/usr/local/lib/ruby/gems/2.3.0/gems/ydbi-0.5.3/lib/dbi/base_classes/database.rb:96:in `execute'
/usr/local/lib/ruby/gems/2.3.0/gems/ydbi-0.5.3/lib/dbi/base_classes/database.rb:114:in `do'
/usr/local/lib/ruby/gems/2.3.0/gems/ydbi-0.5.3/lib/dbi/handles/database.rb:106:in `do'
/usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/connection_pool.rb:39:in `block in method_missing'
/usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/connection_pool.rb:29:in `next_connection'
/usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/connection_pool.rb:38:in `method_missing'
/usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/storage.rb:537:in `store'
/usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/cache.rb:512:in `store'
/usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:274:in `odba_isolated_store'
/usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:395:in `block in odba_store_unsaved'
/usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:392:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:392:in `odba_store_unsaved'
/usr/local/lib/ruby/gems/2.3.0/gems/odba-1.1.2/lib/odba/persistable.rb:380:in `odba_store'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/persistence/odba.rb:21:in `block in save'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/persistence/odba.rb:21:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/persistence/odba.rb:21:in `save'
/var/www/sandoz.bbmb.ch/lib/bbmb/util/csv_importer.rb:23:in `block in import'
/var/www/sandoz.bbmb.ch/lib/bbmb/util/csv_importer.rb:19:in `each'
/var/www/sandoz.bbmb.ch/lib/bbmb/util/csv_importer.rb:19:in `import'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/updater.rb:20:in `import'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/updater.rb:14:in `block in run'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/polling_manager.rb:31:in `block in poll_path'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/polling_manager.rb:30:in `open'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/polling_manager.rb:30:in `poll_path'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/polling_manager.rb:26:in `block in poll'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/polling_manager.rb:25:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/polling_manager.rb:25:in `poll'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/polling_manager.rb:139:in `block in poll_sources'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/polling_manager.rb:132:in `block in load_sources'
/usr/local/lib/ruby/2.3.0/psych/deprecated.rb:32:in `each'
/usr/local/lib/ruby/2.3.0/psych/deprecated.rb:32:in `load_documents'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/polling_manager.rb:131:in `load_sources'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/polling_manager.rb:138:in `poll_sources'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/updater.rb:11:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/server.rb:161:in `update'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/server.rb:128:in `block (2 levels) in run_updater'
/usr/local/lib/ruby/2.3.0/delegate.rb:85:in `loop'
/usr/local/lib/ruby/2.3.0/delegate.rb:85:in `call'
/usr/local/lib/ruby/2.3.0/delegate.rb:85:in `method_missing'
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.1.3/lib/bbmb/util/server.rb:116:in `block in run_updater'
view · edit · sidebar · attach · print · history
Page last modified on March 16, 2017, at 02:25 PM