database-backups

Why is pg_restore segfaulting in Docker?

时光毁灭记忆、已成空白 提交于 2021-01-28 07:59:35
问题 I am testing a backup/restore procedure for my postgres DB inside a docker container. I dump my db like this: $ docker exec -ti my_postgres_container pg_dump -Fc -U postgres > db.dump Afterwards, I try to restore it like this: $ docker cp db.dump my_postgres_container:/db.dump $ docker exec -ti my_postgres_container pg_restore -U postgres -c -d postgres db.dump The command returns without output or errors, but nothing happens. So instead, I tried to restore it manually like this: $ docker cp

Backup SQL Server database using PHP

谁说我不能喝 提交于 2021-01-27 18:19:30
问题 I am trying to backup a MS SQL database calling a Stored Procedure using PHP. When I execute de SP on SSMS, everything works fine. However, when I call it from the PHP script, I can see a ".bak" in the backup folder and right after the PHP finishes processing, the BackUp.bak file disappears. Here is the Stored Procedure: DECLARE @date VARCHAR(10) SET @date = (SELECT date FROM tbl_date) Declare @fileName VARCHAR(100) SET @fileName = ('C:\db_backup\BackUp_' + @date + '.bak') BACKUP DATABASE

Restore tablespace USERS doesn't work. Oracle backup

橙三吉。 提交于 2020-12-15 03:53:17
问题 I created a schema and my_table_test; ALTER SESSION SET CURRENT_SCHEMA=c##wojtek_admin; CREATE TABLE my_table_test ( id_test INT ); Then I created a backup using: BACKUP TABLESPACE USERS FORMAT 'c:\FRA\users%u'; Then I dropped my_table_test and run below commands: RMAN> RUN{ 2> SQL 'ALTER TABLESPACE USERS OFFLINE'; 3> RESTORE TABLESPACE USERS; 4> RECOVER TABLESPACE USERS; 5> SQL 'ALTER TABLESPACE USERS ONLINE'; 6> } Why my_table_test is dropped after I restored USERS TABLESPACE? 回答1: In a

Restore tablespace USERS doesn't work. Oracle backup

余生颓废 提交于 2020-12-15 03:53:04
问题 I created a schema and my_table_test; ALTER SESSION SET CURRENT_SCHEMA=c##wojtek_admin; CREATE TABLE my_table_test ( id_test INT ); Then I created a backup using: BACKUP TABLESPACE USERS FORMAT 'c:\FRA\users%u'; Then I dropped my_table_test and run below commands: RMAN> RUN{ 2> SQL 'ALTER TABLESPACE USERS OFFLINE'; 3> RESTORE TABLESPACE USERS; 4> RECOVER TABLESPACE USERS; 5> SQL 'ALTER TABLESPACE USERS ONLINE'; 6> } Why my_table_test is dropped after I restored USERS TABLESPACE? 回答1: In a

postgresql: .pgpass not working

瘦欲@ 提交于 2020-11-30 06:15:24
问题 I have created a .pgpass file in my home directory which looks like this localhost:5432:somedb:someuser:somepass I am using a shell script which creates a directory and puts a pg_dump of somedb there : mkdir directory pg_dump somedb > directory/somefile.dump It still prompts for the password. Where is the mistake here ? 回答1: Did you try specifying the host, user, & db? pg_dump -U someuser -h localhost somedb > directory/somefile.dump 回答2: Although question has already been answered and

postgresql: .pgpass not working

末鹿安然 提交于 2020-11-30 06:14:52
问题 I have created a .pgpass file in my home directory which looks like this localhost:5432:somedb:someuser:somepass I am using a shell script which creates a directory and puts a pg_dump of somedb there : mkdir directory pg_dump somedb > directory/somefile.dump It still prompts for the password. Where is the mistake here ? 回答1: Did you try specifying the host, user, & db? pg_dump -U someuser -h localhost somedb > directory/somefile.dump 回答2: Although question has already been answered and

Restoring the database dump of an older version of mongo to a new version of mongo

元气小坏坏 提交于 2020-06-09 18:12:16
问题 Currently, I have an older version of mongo, i.e 2.6 running on my system. I already have my site in production and have a lot of client data. I am planning an upgrade to mongo 3.2. So, my question is whether mongorestore of mongo v3.2 work with data dump of v2.6 ? Or, is it known to create problems? Any answers will be invaluable! Thanks 回答1: I asked this same question on the official MongoDB mailing list. They said not to upgrade more than 1 major version at a time. (Major versions being: 2