database-restore

Best practice for graceful replace of read-only SQL Server database

I have a read-only database that has cached information which is used to display pages on the site. There are processes that run to generate the database, and those run on a different server. When I need to update the live database, I restore this database to the live server, to a new name and file. Then I drop the live database and rena...

How do I run that database backup and restore scripts from my winform application?

I am developing a small business application which uses Sqlserver 2005 database. Platform: .Net framework 3.5; Application type: windows application; Language: C# Question: I need to take and restore the backup from my application. I have the required script generated from SSME. How do I run that particular script (or scripts) from m...

Restoring a Backup to a different Server - User Permissions

I have backed up and restored a MS SQL Server 2005 database to a new server. What is the best way of recreating the login, the users, and the user permissions? On SQL Server 2000's Enterprise Manager I was able to script the logins, script the users and script the user permissions all seperately. I could then run one after the other a...

Is there a faster way to backup and restore for mysql?

Sql Server and Oracle have commercial products like Idera (Sql Safe) and Quest (LiteSpeed) that dramatically speed up backup and restores. Does mysql have any commercial software like that? I'm working with large amounts of data in mysql and if we have to restore it takes 8-10 hours. So I'm hoping to move to a commercial product that...

Restoring Postgresql database

Do I always have to delete and then create a database to restore it from a pg_dump file? If I don't delete the database, the data being restore is added to the current data in the DB even if some register already are in the database (so the data is duplicated). ...

Restore sql doesnt fire

Hi Im trying restore database from backup dynamically with application code simple sql command for restore con.execute("RESTORE FILELISTONLY FROM DISK='c:\old.bak' " & vbcrlf &_ "RESTORE DATABASE newdb " & vbcrlf &_ "FROM DISK='c:\old.bak' " & vbcrlf &_ "WITH MOVE 'newdb' TO 'c:\newdb.mdf', " & vbcrlf &_ ...

Problem restoring a 2005 SQL DB with 2008

I have a DB I created with SQL Server 2005 and created a backup (*.bak) now I want to restore it with 2008 but ouch, I get the following error: TITLE: Microsoft SQL Server Management Studio ------------------------------ Restore failed for Server 'SHIMMY-PC\SQLEXPRESS'. (Microsoft.SqlServer.SmoExtended) For help, click: http://go.mic...

How do I rescue a small portion of data from a SQL Server database backup?

I have a live database that had some data deleted from it and I need that data back. I have a very recent copy of that database that has already been restored on another machine. Unrelated changes have been made to the live database since the backup, so I do not want to wipe out the live database with a full restore. The data I need is ...

SQL Server 2005 restore one schema only

I am pretty sure this isn't possible.... We have a database with several schemas. Each schema belongs to a different user. One user was asking "if I find out I made a whole load of errors would it be possible to revert to the state my data was in yesterday". Obviously we could restore the whole database, but that would restore the other...

Label.Text change being blocked?

I am attempting to use a Microsoft.SqlServer.Management.Smo.Restore object to restore a SQL Server 2000 database. Just before I begin the restore operation, I change the text of a label so that the user knows what is going on. However, the changed text isn't visible on the GUI (i.e., the text remains the same as it was) until AFTER the f...

Restoring multiple database backups in a transaction

I wrote a stored procedure that restores as set of the database backups. It takes two parameters - a source directory and a restore directory. The procedure looks for all .bak files in the source directory (recursively) and restores all the databases. The stored procedure works as expected, but it has one issue - if I uncomment the tr...

Can I restore a backup if a table is corrupt?

I'm hoping this will be a simple answer for one of you. We've got PHP/MySQL running on a single board computer for a product that will be a web-based admin tool. This product will be a 'set it and forget it' application. One of our concerns (whether or not it's valid) is MySQL table/dbase corruption. We have processes running continu...

Restoring a Differential Backup with an SMO Restore object

I am trying to restore a database by first restoring a full backup and then restoring a differential backup by using the Microsoft.SqlServer.Management.Smo.Restore class. The full backup is restored with the following code: Restore myFullRestore = new Restore(); myFullRestore.Database = "DatabaseName"; myFullRestore.Action = RestoreActi...

View all transaction logs in SQL Server 2008

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 s...

SQL Server 2008 - Restore Database With RESTART

I am trying to restore a database from a backup file on a SQL Server 2008 instance using the following SQL command: BEGIN RESTORE DATABASE [MyDataBase] FROM DISK=@db_location WITH STATS=5, FILE=1, MOVE @db_OldName TO @db_NewFile, MOVE @db_OldLogName TO @db_NewLogFile, NOREWIND, NOUNLOAD, RESTART, RECOV...

import .bak file to a database in sql server

hi, i have a file with .bak extension. how can i import this date to a database in SQL Server. is any one have an idea.please share it with me. thanks ...

Restore a database using SQL Server 2005

I have backed up a database into a file using SQL Server from my old server. Now i would like to restore that file into a new database on my new server. I created a DB with the same name , I am getting an error saying : "The Backup set holds a backup of the database other than the existing '*' database" Any thoughts? Thanks ...

WordPress Database Backup Question

I am working on a charity site and was tasked with moving a WordPress site to another host from Yahoo hosting. I have done this before and thought it would be easy enough. Before moving the site I backed up all the files and backed up the database. The files are fine, but the database backup has me stumped. I ended up with the followin...

SQL Server: Setting database mode to RESTRICTED_USER WITH ROLLBACK IMMEDIATE doesn't always drop all connections

I need to perform a restore of database from .NET using SMO.Prior to the restore I set the database into RESTRICTED_USER WITH ROLLBACK IMMEDIATE mode. This works fine during testing/debugging - all users are dropped. However, when this code is run as part of an automated process at night, sometimes I get the following exception: Micr...

How can I restore the MySQL root user’s full privileges?

I accidentally removed some of the privileges from my MySQL root user, including the ability to alter tables. Is there some way I can restore this user to its original state(with all privileges)? UPDATE mysql.user SET Grant_priv = 'Y', Super_priv = 'Y' WHERE User = 'root';# MySQL returned an empty result set (i.e. zero rows). F...