database-backups

How list all tables with data changes in the last 24 hours?

对着背影说爱祢 提交于 2019-12-07 10:10:33
问题 We had an ugly problem, by mistake, a balancer redirect some requests to a test instance with pretty similar data than production, now I know that there are data recorded in the test Postgres that belongs to production Is there a way to list all the tables with data changes in the last 24 hours in Postgres? Postgres version is 9.3 and I have around 250 tables. 回答1: First consider my comment. Postgres up to and including 9.4 does not by itself record timestamps when rows were inserted or

why is the `tcgetattr` error seen when ssh is used for dumping the backup file on another server?

我的梦境 提交于 2019-12-07 03:11:43
问题 I want to dump a tables backup on another server and I am using ssh for doing it. when I run the below command, it gives an error but dump file is copied to destination. mysqldump -u username -ppassword dbname tablename | ssh -t -t servers_username@domain_name 'cat > /tmp/bckp.sql'; tcgetattr: Invalid argument If I press CTRL + c then it appends error message with Killed by signal 2. Why is this error? 回答1: I've seen this error when forcing pseudo-terminal allocation using ssh -t -t or ssh

Reverse changes from transaction log in SQL Server 2008 R2?

一曲冷凌霜 提交于 2019-12-06 16:00:03
We have a SQL Server 2008 R2 database that backs up transaction logs every now and then. Today there was a big error in the database caused at around 12am... I have transaction logs up to 8am and then 12am - 16pm - etc. My question is: can I sort of reverse-merge those transaction logs into database, so that I return to the database state at 8am? Or is my best chance to recover an older full backup and restore all transaction logs up to 8am? The first option is preferable since full backup has been performed a bit of a while ago and I am afraid to f*ck things up restoring from there and

Unable to restore a MYSQL backup to a new Database

纵饮孤独 提交于 2019-12-06 09:51:54
问题 I successfully created a mysqldump file myDump.sql of a myDb1 database using guidelines from this thread. Also I created a second database myDb2 , navigated to the directory containing myDump.sql and trying to restore it into the new database myDb2 but failing, Two methods I tried: > mysql -u root -p myDb2 < myDump.sql; > -- entered password and: > mysql -u root -p mysql> -- entered password mysql> USE myDb2; mysql> SOURCE myDump.sql; Both have the same error message: ERROR: ASCII '\0'

View all transaction logs in SQL Server 2008

回眸只為那壹抹淺笑 提交于 2019-12-06 04:19:50
The problem is this: t0: Insert is made into my database t1: Delete is executed t2: Full backup is made t3: Transaction log backup is made How can i recover the deleted record after t3 (which is now)? I want the database in a state between t0 and t1. The log level was Full. Edit: I have already run DBCC LOG(DB-Name, 3), but the log seems to be truncated. There are only 10 items although there must be thousands. To replay log you always start from a full log, apply the differentials and then the log backups. The time line is always forward from the full backup, never backwards. So to get to the

Restore PostgreSQL db from backup without foreign key constraint issue

会有一股神秘感。 提交于 2019-12-05 21:18:00
问题 I have a postgresql db with about 85+ tables. I make backups regularly using pg_dump (via php-pgadmin) in copy mode and the size of the backup file is almost 10-12 MB. Now the problem I am facing is that whenever I try to restore the database, foreign key constraint problem occur. The scenario is as follows: There are two tables: 1) users and 2) zones . I have stored the id of zone in users table to identify the user's zone and have set it as foreign key. When I take the db dump, the entries

How list all tables with data changes in the last 24 hours?

两盒软妹~` 提交于 2019-12-05 12:17:52
We had an ugly problem, by mistake, a balancer redirect some requests to a test instance with pretty similar data than production, now I know that there are data recorded in the test Postgres that belongs to production Is there a way to list all the tables with data changes in the last 24 hours in Postgres? Postgres version is 9.3 and I have around 250 tables. First consider my comment. Postgres up to and including 9.4 does not by itself record timestamps when rows were inserted or updated. There are some system columns in the row headers that can help in the forensic work. The physical order

why is the `tcgetattr` error seen when ssh is used for dumping the backup file on another server?

做~自己de王妃 提交于 2019-12-05 08:35:45
I want to dump a tables backup on another server and I am using ssh for doing it. when I run the below command, it gives an error but dump file is copied to destination. mysqldump -u username -ppassword dbname tablename | ssh -t -t servers_username@domain_name 'cat > /tmp/bckp.sql'; tcgetattr: Invalid argument If I press CTRL + c then it appends error message with Killed by signal 2. Why is this error? I've seen this error when forcing pseudo-terminal allocation using ssh -t -t or ssh -tt . The tcgetattr function is used to look up the attributes of the pseudoterminal represented by a file

Error “invalid byte sequence” while restoring PostgreSQL database

孤街醉人 提交于 2019-12-05 03:44:23
问题 Earlier today, I was trying to restore my PostgreSQL (8.1.22) database from production using pgAdmin III. However, after the restoration procedure finished, it started throwing errors like: WARNING: errors ignored on restore: 4 Also, upon investigation I found that out of all the tables 3 tables hadn't been restored (contained 0 rows). When I checked the log, I found the follwoing error near the 3 tables: pg_restore: [archiver (db)] Error from TOC entry 5390; 0 442375 TABLE DATA tablename

PDO MySQL backups function

时光总嘲笑我的痴心妄想 提交于 2019-12-05 02:05:10
问题 this function here http://davidwalsh.name/backup-mysql-database-php has been floating around the internets for a while and is pretty famous, but its in standard mysql. does anyone have the same but in PDO? if not does anyone want to make one? is it even possible, i read somewhere that PDO doesnt do SHOW CREATE TABLE - is that right? finally, can someone explain wht difference between that function and using SELECT * INTO OUTFILE is? (please dont mark this down for containing too many