.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Help with confusing MS SQL backup and Restore issue

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :
I have a MS SQL database that is used in an old proprietary program.  Currently the datafile is running on a server that has SQL server 2008 on it.  When I open SQL 2008 management studio, I can see the database, but none of the tables show up.  Instead I get an error message about running dbcc check data.  However, when I attach to this instance from another server running SQL 2005, I can view the tables and run querys on it.  The program currently works fine, but I need to make sure I can do proper backup and restores.  If I try to run a back up in 2008 managment studio I get an error, if I run the backup from the other server with management studio 2005 I get a successful backup.  However, when I copy the backed up file from the production server to the one where I have 2005 installed, I can't restore the database.  Can anyone guide me in how to solve the problem? 

View Complete Post

More Related Resource Links

SQL Server Backup and Restore (video)

Restore your full backup, then run a few queries before you keep restoring transaction logs. Brent shows how to use the Standby option for restores.

In this five minute video, Brent demonstrates how to do it by creating a database, populating data, and then showing what disaster recovery is like by doing RESTORE WITH STANDBY.

SQL2005 backup Issue

After moving the SPS 2003 portal from one disk to another, I am having a problem in backing up the portal from the spsbackup tool as well as through the SQL Server 2005 database backup option . Following is the error am getting:-   ============================================================================================================================= Backup failed for Server 'sql server name'.  (Microsoft.SqlServer.Smo)   ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Backup+Server&LinkId=20476   ------------------------------ Program Location:      at Microsoft.SqlServer.Management.Smo.Backup.SqlBackup(Server srv)    at Microsoft.SqlServer.Management.SqlManagerUI.BackupPropOptions.OnRunNow(Object sender)   ===================================   System.Data.SqlClient.SqlError: The backup of the file or filegroup "sysft_ix_ContentDatabaseName" is not permitted because it is not online. BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data. (Microsoft.SqlServer.Smo)   ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&LinkId=

SMO Backup and Restore Help

Hello Friends, I am new to SMO, Till now I have only worked with Selct,Insert/update Queries.. Now I want to Implement some backup and restore feature for my application. I looked at some documents of SMO and found it is possible using SMO. First of all I will explain my situation. My application wants to store data belongs to different companies(which is maintained with in application) in to single database server, Sql server 2008. I am planning to use Partition Scheme function and create filegroup for each company. Advantage here is, taking backup of each company will be easy. I am generating primary key for each table without taking into consideration of companies. In other words Particular table's ID 1,2 belongs to Company A, 3 Belongs to Company B and 5 belongs to Company A... But these data will be split in to Different filegroups using Company ID.(horizontal partitioning) Ok... Now the Problem.. My backup for a particular company was taken successfully. Now I want Restore function. When I am trying to restore this backup to somewhere else. Target database may or may not contain Companies installed. When Restoring Will there be any Primary key Violation? I know one solution is to generate primary key by taking into consideration Company Id. But this will cause a complete rewriting of code, as it contains lot of edit/delete queries.  I want to know, whether the

SQL2008 - Cannot Restore a new database from a full backup of a different one, database in use

I am trying to restore a brand new database from a copy of another one and am encountering an error message stating: System.Data.SqlClient.SqlError: The file <Backup source database file location> cannot be overwritten.  It is being used by database <Backup Source Database>. (Microsoft.SqlServer.Smo) I am running the Restore procedure with the REPLACE option and am wondering why it is stating that the source database is the database in use when I am trying to restore and overwrite a completely different database. This issue happens when running the replace both in C# using SMO and when manually restoring with SqlServer Management Studio Interesting note is, the original source database is created / deployed using a database project within VisualStudios 2010 and then deployed to SqlServer through VisualStudios. Any thoughts on why this is happening? Thanks in advance for any help!

What happened to the backup and restore classes in namespace Microsoft.SqlServer.Management.Smo vers

I do not see these two classes in version 10 of this namespace and I am not finding any documentation explaining what happened to them.

Backup and Restore

Hi. I am creating a vb 2010 application and I am using sql server express as my database. I need to create a backup and restore feature for the user so that the user can backup or restore the database while using the program. I have nop clue where to start. Does anyone have some code for or any suggestions?Thanks in advance.

Upgrading platform - Report Services DBs backup /restore

We are upgrading the platform for our production SQL 2005 server.  Of course, I have done this task numerous times....however this is the first time I will be dealing with Reporting Services.  I am concerned that it may not be a simple backup databases and then restore on new server, because of the encryption keys. What do I need to do ? Thanks!

Can't restore database backup file in my database ? using sql server 2005. please help

VERY IMPORTANT i am trying to restore database.bak in sql server 2005 (i know the database.bak was also generated in sql 2005 server) i am trying to restore back up database .bak into the new database i just created in sql server 2005 i have saved my database .bak into c drive and when i select database .bak "From Device", it doesn't get populated in the list below and i see nothing and it keeps on prompting a message "You must select a restore source" Here's the screen shot:   PLEASE HELP..it's really important (i tried restoring database in sql server 2008 and it was sucessful but i am facing this problem in sql server 2005 only)  

Cannot Restore from backUp

Hi,     I am using SQL Server 2008. I made a backup of a database. its size is about 1000MB. I did a verify the backup and it does not give me any error. I copy the backup file to my Machine(Development Machine). I am using the exact same version of SQL server. When I try restoring from back i get the error. TITLE: Microsoft SQL Server Management Studio ------------------------------ An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ ADDITIONAL INFORMATION: The media family on device 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\dcaRms1-05Bkp.bak' is incorrectly formed. SQL Server cannot process this media family. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241) When I tried doing in from code: just a Restore Verifyonly I get this error: Msg 3241, Level 16, State 7, Line 1 The media family on device 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\dcaRms1-05Bkp.bak' is incorrectly formed. SQL Server cannot process this media family. Msg 3013, Level 16, State 1, Line 1 VERIFY DATABASE is terminating abnormally. I really do not understand. It is not like I am trying to restore the backup created in 2008 to 2005 version. and I am pretty sure the backup file is not corrupt. I can restore it in the same database.

Backup SQL Server 2008 R2 Restore on SQL 2008

I have a SQL Server 2008 R2 instance that I need to backup and restore onto a SQL 2008 instance. When I attempt to restore the back up (.bak) database from the R2 SQL server onto the SQL 2008 server I get the following message: The database was backed up on a server running version 10.50.1600. That version is incompatible with this server, which is running version 10.00.2531. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.Smo) How can i backup the SQL 2008 R2 database to be compatible with SQL 2008?Ian Ceicys

restore log issue while doing the logshipping

We have a database for logshipping, recently we have the following issue which is the restore log job failed in the standby mode database. We uncommonly encounter such issues, and search the answer on the internet with no answers. Can anyone help ? Following is the issue with the details: [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 3142: [Microsoft][ODBC SQL Server Driver][SQL Server]File 'oadb_Log' cannot be restored over the existing 'F:\MSSQL\LOG\oadb_log.ldf'. Reissue the RESTORE statement using WITH REPLACE to overwrite pre-existing files. [Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE LOG is terminating abnormally.happyMan

Replication Subscriptions by using Backup and Restore

I thought this would work, but obviously I've overlooked something. I have SQL Server 2008 on 2 servers. Have database on publisher server and want to merge replicate to subscriber, but didn't want to take days like it did last time. 1. I published the database and ran the snapshot agent. 2. I backed up the database to a .bak file. 3. I copied the .bak file to the subscriber computer. 4. I restored the database on the subscriber computer from the .bak file. 5. Back at the publishing server, I added the subscriber under subscriptions, but I unchecked the "Initialize" box since that was the point of doing the backup, copy and restore. And. Oops. The replication monitor says it has a syntax error at "AccountPK." That would be the primary key for the account table. That wasn't what I hoped for. Suggestions? You can't be successful at this unless you're at least 1/2 a bubble off level.

how to restore msdb database on sql 2008 from sql 2005 backup?

Currently, I am unable to do it. It gives me the error than I cannot be restored because it was created by a different version of the server. What is the work-around? I hate scripting all my maintenance plans and alerts, there are tonns of themJulieShop

"The backup set holds a backup of a database other than existing database. Restore Database is term

I have a problem when i restore my .DAT_BAK file.  I am getting error like "The backup set holds a backup of a database other than existing database.  Restore Database is terminating abnormally".   I tried by using   RESTORE DATABASE <DATABASENAME> FROM DISK = 'D:\DATA\MYTEST.DAT_BAK' WITH MOVE 'VZAI_DATA' TO D:\PROGRAM FILES\..\MSSQL\TEST.MDF', MOVE 'VZAI_LOG' TO D:\PROGRAM FILES\..\MSSQL\TEST.LDF', REPLACE   And also i tried like   RESTORE DATABASE <DATABASENAME> FROM DISK = 'D:\DATA\MYTEST.DAT_BAK' WITH REPLACE   When i use like this,   RESTORE FILELISTONLY FROM DISK = 'D:\DATA\MYTEST.DAT_BAK'. I am able to get the output as LogicalName, PhysicalName, Type, FileGroupName, Size, etc.   Can i anyone please help me out?   Thanks in Advance, Anand Rajagopal

Backup tools fro granular restore - Symantec BAckup Exec Problem

Dear all, we are facing a problem here. Our sys admin set up everything to run the farm backups. He is using Symanteck Backup Exec 2010. In that farm we have 3 web applications which represents 3 content databases on a separate SQL back-end machine. When the backup is done, the report tells the backup succeed. It happens that when we try to recover from the backups, we can recover from an item level from 2 of those web applications, but not from 1. It created the whole site backup, but we cannot dig in to recover an item or a subsite. Did anyone had this problem before? (I gave farm admin levels to the account used by Backup Exec to double check the rights. That user could log on to the site and indeed he could go to all subsites and all item levels. So it is not access I believe). Any other expiriences with this tool? What about other tools? We are having a demo of AvePoint soon. Does anyone worked with that before? Thanks in advance for any help. Regards, GoncaloGonçalo

restore user databases from diff backup

I need to migrate the server from sql server 2005 to 2008. I need to migrate all 500+ user databases. in order for me to minimize the downtime, can I do the following: 1) run full backup on 2005 source and transfer the data over to the destination 2) restore user dbs from these backups 3) shut down the apps on source 4) run diff backup on 2005 source and transfer the data over to the destination 5) restore user dbs from these backups   Is it possible to apply only diff backup on the destination or the dbs should be restored from full+diff only? Please helpJulieShop

Lookup field issue after restore

After restoring a site collection in MOSS 2007, lookup fields cannot link up with the parent list. May I know if this problem fixed in MOSS 2010? Besides, the list item GUID in MOSS 2007 are changed after restoring. Does this case still appear in MOSS 2010? Thanks!
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend