database-restore

back up and restore mysql database c#

两盒软妹~` 提交于 2019-12-13 15:47:27
问题 I am looking for a way how I can via c# back up some database from mysql (file backup). And also via c# restore database from backup file to some new location. Can you help me with some ideas how to get started here . Thanks. 回答1: ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe"); Process.Start(startInfo); startInfo.Arguments = "mysqldump -u admin -p admin test > c:\backupfile.sql"; Process.Start(startInfo); You can hide the dos prompt with startInfo.WindowStyle if you need. 回答2:

Recover database with no backups

允我心安 提交于 2019-12-12 02:05:55
问题 I want to know if there is a way to revover the state of a database at a certain date. Unfortunately I don't have a backup. 回答1: Without backups of any kind, there is nothing you can do - since previous state has been wiped away by checkpoints (even in full recovery, it acts like simple recovery until you've bothered to take a backup). This situation is precisely what backups are for. If you jump out of a plane without a parachute, don't bother looking for the ripcord... 回答2: As Aaron said

Undo table updates in SQL Server 2008

早过忘川 提交于 2019-12-11 19:44:03
问题 I updated a table in my SQL Server 2008 by accident, I was updating a table from another by copying cell by cell, but I have overwritten the original table. Is there a way that I can restore my table contents as it was? 回答1: This tool says it can do it, a bit pricey though. There is a trial period, maybe that will be long enough to get your data back: http://www.apexsql.com/sql_tools_log.asp?_kk=log%20explorer&_kt=49fb8026-ca7c-4c5e-bb06-99ee95393472&gclid=CPWP48T3i6ICFY1a2godtTS7UQ 回答2: No.

Managed document not working in MarkLogic 10 after xdmp:document-insert

守給你的承諾、 提交于 2019-12-11 15:52:33
问题 First time manage document using dls:document-insert-and-manage Update the same document using xdmp:document-insert Document get lost from the dls latest version collection cts:search(/scopedIntervention/id , dls:documents-query()) First time manage document <scopedIntervention> <id>someId12345</id> <scopedInterventionName> First Name </scopedInterventionName> <forTestOnly> true </forTestOnly> <inactive> true </inactive> </scopedIntervention>)``` **Document inserted with versioning** Verify

Restore Database “Restore failed for Server 'xxx' ”

六月ゝ 毕业季﹏ 提交于 2019-12-11 06:39:53
问题 I have a problem. I tried the code like belov. But i am getting exception. and the exception is : "Restore failed for Server 'SMART0090\SQL2008RR2'." FailedOperationException. .... the error is at "restore.SqlRestore(server);" line What do you think about the problem? The code is : public void RestoreToDatabase(string NewDatabaseName, string BackUpFile, string ServerName, string UserName, string Password) { ServerConnection connection = new ServerConnection(ServerName, UserName, Password);

Higher speed options for executing very large (20 GB) .sql file in MySQL

余生长醉 提交于 2019-12-10 22:16:54
问题 My firm was delivered a 20+ GB .sql file in reponse to a request for data from the gov't. I don't have many options for getting the data in a different format, so I need options for how to import it in a reasonable amount of time. I'm running it on a high end server (Win 2008 64bit, MySQL 5.1) using Navicat's batch execution tool. It's been running for 14 hours and shows no signs of being near completion. Does anyone know of any higher speed options for such a transaction? Or is this what I

View all transaction logs in SQL Server 2008

萝らか妹 提交于 2019-12-10 10:46:44
问题 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. 回答1: To replay log you always start from a full log, apply the differentials and

How do I recreate an FRM file for an MySQL InnoDB table with only the ibdata and *.ibd files?

隐身守侯 提交于 2019-12-09 06:21:51
问题 This is a slightly different question than the related InnoDB repair questions I have seen on stackoverflow. Assume that I have restored the following in my MySQL 5.1 database with innodb_file_per_table=1: db/tablename.ibd innodb/ibdata1 innodb/ib_logfile0 innodb/ib_logfile1 I have lost the db/tablename.frm file. I can start the database server, but InnoDB complains: 110723 13:26:33 InnoDB: Error: table 'db/tablename' InnoDB: in InnoDB data dictionary has tablespace id 5943, InnoDB: but

SQL Server “RESTORE FILELISTONLY” Resultset

烈酒焚心 提交于 2019-12-09 02:28:06
问题 I'm trying to write an automated backup and restore T-SQL scripts. I've done BACKUP part but I'm struggling on RESTORE. When I run following statement on SS Management Studio; EXEC('RESTORE FILELISTONLY FROM DISK = ''C:\backup.bak''') I get a result set in a grid and also I can use INSERT INTO <temp_table> EXEC('RESTORE FILELISTONLY FROM DISK = ''C:\backup.bak''') to populate a temp table. However I get syntax error, when I try to select from that resultset. e.g SELECT * FROM EXEC('RESTORE

how to convert Mdf/ldf database files to .bak file (db restore) using T-SQL or .net code

左心房为你撑大大i 提交于 2019-12-07 06:41:45
问题 I have sql server database files (Mdf/Ldf) and i want to convert them to backup file using T-SQL commands or .net Code (C# or Vb.net). any suggestions. thans 回答1: BACKUP DATABASE [NameOfDatabase] TO DISK = N'D:\path\filename.bak' WITH NOFORMAT, NOINIT, NAME = N'NameOfDatabase-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 Replace NameOfDatabase with name of your database. Replace D:\path\filename.bak with place you want to backup with Replace Name = N database name for cosmetic