Friday, March 30, 2012

HELP!! Problem in database backup and restore!

Im trying to backup the databse by selecting the database source, backup type = full, name the backup set, and leave the rest as default. The backup seems to be successful.

The problem comes when I need to restore the backup database, I 've tried many times and a few different kinds of selection, all fails. I've selected the source for restore from device, that is the .bak file from backup folder and remains the rest of selection as default. Here is the error message I get:

System.Data.SqlClient.SqlError: The backup set holds a backup of the database other than the existing 'testing' database. (Microsoft.SqlServer.Express.Smo)

Anyone can help to solve this problem?!

Create new Database. In Restore window-> Options tab, check "Force restore over existing database". And then try to restore. This may work for you.

Santosh

|||

Thankz santosh...

the solution u had provided.... had successfully solved the problem mention above....but there are some database that still meets another problem during the database restore

here is the error occurs after that....

TITLE: Microsoft SQL Server Management Studio Express

Restore failed for Server 'COMP1\SQLEXPRESS'. (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476


ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: The file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\JGSQL.mdf' cannot be overwritten. It is being used by database 'JGSQL'. (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&LinkId=20476


BUTTONS:

OK

|||

I've try to do the database restore using sql command as below:

RESTORE DATABASE testJG

FROM DISK = 'c:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Backup\JGsql.bak'

GO

But I get this error message.

Does this means that I need to restore the master database from systems database to the database testJG before I restore the backup database?

Msg 3102, Level 16, State 1, Line 1

RESTORE cannot process database 'testJG' because it is in use by this session. It is recommended that the master database be used when performing this operation.

Msg 3013, Level 16, State 1, Line 1

RESTORE DATABASE is terminating abnormally.

|||It was helpfull to me. Thanx! :)sql

No comments:

Post a Comment