.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

Trying to restore a database sent by a vendor

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :Sql Server
I tried to restore a database via a BAK file sent to me from a vendor so I created a new datase then right clicked and did a restore but received the following message:   TITLE: Microsoft SQL Server Management Studio ------------------------------ Specified cast is not valid. (SqlManagerUI) ------------------------------ BUTTONS: OK ------------------------------

View Complete Post

More Related Resource Links

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!

Single-page restore/recover in an online database

I am working with SQL Server 2008 64-bit (10.0.2531) on Windows Server Datacenter 2008 SP2 (64-bit). The problems I am having almost certainly stem from my lack of understanding of how SQL Server's transaction log is handled during recoveries. I am using this document as a rough guide. Here' what I am doing: 1. I intentionally corrupt a single data page in a normal table, so that I can practice single-page recovery. 2. I attempt to read the corrupt block in SQL. As expected I receive an error. 1> select top 10 firstname from ds2.dbo.customers 2> go Msg 824, Level 24, State 2, Server IP-0AF647E0, Line 1 SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 4:896; actual 3:0). It occurred during a read of page (4:896) in database ID 5 at offset 0x00000000700000 in file 'C:\sql\dbfiles\cust1.ndf'. Additional messages in the SQL Server error log or system event log may provide more detail. 3. I take a log tail backup before I do anything to try to fix the corruption: 1> backup log ds2 to disk = 'c:\sqlbackup\ds2.bak' with norecovery 2> go Processed 5 pages for database 'ds2', file 'ds_log' on file 1. BACKUP LOG successfully processed 5 pages in 0.041 seconds (0.857 MB/sec). 4. I  restore the corrupt page from backup: 1> restore database ds2 page='4:896' 2> from disk='c:\sqlbackup\ds2.bak' 3> with norecovery 4&

How to restore a database to the d drive

I have a 2008 database I need to restore, but my C drive is almost full.  How do I telll it to restore my database to the D drive?  

SharePoint Version 2.0 (WSS 2.0 SP3) Content Database restore to new farm

Is it possible to use an SQL backup from a sharepoint Version 2 SP3 database to restore the content on a new server farm and attach to a new web applicaiton. NOTE: This is WSS 2.0. In WSS 3.0 this is a very simple task, but it is not the same in WSS 2.0 (the add content database option CANNOT be used to attach to an existing content database like it does in WSS 3.0). The options I have found appear to say you need the configuration database from the old server then it can be done. I am migrating from an outsourced deployment, so I do not have access to that. Plan B is to do a sharepoint STSADM backup. THis seems to be a more likey way to do it.

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)  

How to restore database from .bak file /

I have a .bak database file and i want to restore it to a new database so that i can get the data inside the .bak fileI am using SSMS 2008 Expresswhat i did :I created a database with the same name as of my .bak file (in my case "RM")now after creating a new database > righclick  on database > tasks > restoreSelected FROM : RM ( empty database that i just created)Selected TO : RM.bak (my backup file)when i press "Ok"i get this error:

Restore 2005 database on 2008 R2 Trial

I've downloaded SQL Server 2008 R2 Trial and installed it on Windows Server 2008 trial running under Virtual PC on XP. I've made backups of databases on my SQL Server 2005 and tried to restore them using a) the wizard - results in a messagebox saying "Specified cast is not valid" and no backup sets are available in the Restore Database window. b) using T-SQL - results in Msg 3183, Level 16, State 2, Line 1 RESTORE detected an error on page (0:0) in database "dp" as read from the backup set. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally. Using the wizard and RESTORE on 2005 for the same database backup works fine. c) Detach on 2005 and Attach on 2008 results in: SQL Server detected a logical consistency-based I/O error: incorrect pageid... Detach and Attach worked fine on 2005 and DBCC CHECKDB revealed no errors. Thanks for any info...

restore database failed

Hi everyone.   I had installed sql server 2008 on my local machine to develop a project.After i had done more than a half of that i had some problems with my computer so i had to format it.I backed up the database and i copied the file nomedatabase.bak. After formating and reinstalling the slq server 2008 r2 develope edition i would like to restore the database i had before but when i chose to restore the database  (i created a new database with the same name and than right click on the database -> tasks -> restore ->database  ) i get the following error.   TITLE: Microsoft SQL Server Management Studio ------------------------------ Restore failed for Server 'ALDUXO-PC\ALDUXO'. (Microsoft.SqlServer.SmoExtended) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476 ------------------------------ ADDITIONAL INFORMATION: System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'aldux_test' database. (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1447.4+((KJ_RTM).100213-0103+)&LinkI

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

SQL Server database restore with multiple logicalfiles by using t-sql

Hi,   I have set of database backups created in the production sql server 2005. I need restore these backups into another sql server 2005 by using t-sql script(stored procedure). Each database will have different number of logical files in it. The physical location of the target server may be different for these logical files. I know that i should use WITH MOVE 'YourMDFLogicalName' TO 'D:DataYourMDFFile.mdf' clause. Now i want to know how would i put it in a t-script stored procedure such a way that it automatically identifies all the logical files and create a physical file on the target server. User will supply source of bakup file and target folder for mdf,ldf, etc files. Do i need to populate the sql query as string by looping through all the logical files? If so how would i execute the populated sql query as string ?  Mr Genius

Error when running an SQL script to restore a database on SQL Server 2008 R2 Express

Hi, At work, I use SQL Server 2008 Express running on Windows XP Professional Service Pack 3. At home, I also use SQL Server 2008 Express running on Windows XP Professional Service Pack 3. Whenever I do work on the database at work, I usually restore the database at home (or vice versa) I have been using the following SQL scripts to back up the database and to restore the same database (at work or at home). BackupRealEstate.sql USE Master BACKUP DATABASE [RealEstate] TO DISK = N'F:\My Documents\My Database\RealEstate.bak' WITH NOFORMAT, INIT, NAME = N'RealEstate-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO RestoreRealEstate.sql USE Master RESTORE DATABASE [RealEstate] FROM DISK = N'F:\My Documents\My Database\RealEstate.bak' WITH  FILE = 1, NOUNLOAD, REPLACE, STATS = 10 GO Everything worked fine until I replaced my 8yo home computer with a newer and faster one. My new home computer is running Windows 7 Home Premium and I use the latest SQL Server 2008 R2 Express. When I tried to run the above restore SQL script, I got the following error message: Msg 3101, Level 16, State 1, Line 2 Exclusive access could not be obtained because the database is in use. Msg 3013, Level 16, State 1, Line 2 RESTORE DATABASE is terminating abnormally. There was no other application/process using this database. Can someone please help me? Regards,

Error during database restore

Hi,I'm trying to restore a database backup but I get this error.  What does it mean exactly?Thanks!TITLE: Microsoft SQL Server Management Studio------------------------------ Restore failed for Server 'WHIDBEY1'.  (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1314.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476 ------------------------------ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ The media set has 2 media families but only 1 are provided. All members must be provided.RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3132) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1314&EvtSrc=MSSQLServer&EvtID=3132&LinkId=20476 ------------------------------BUTTONS: OK------------------------------

SQL Server 2008 Database Restore(Database Mirroring)

HI,I tried to impliment Database mirrorin in SQL Server 2008.I have 3 Sqlserver 2008 Eneterprise Edition in 3 diiferent computers with same domain.Pricnicipal server =TCP://SPHDev.sphinet.com.sg:5022.Mirror=TCP://SPHPrimary.sphinet.com.sg:5022 and witness =TCP://wsc211.sphinet.com.sg:5022.But when i click start mirroring button i got an error TITLE: Database Properties------------------------------ An error occurred while starting mirroring. ------------------------------ADDITIONAL INFORMATION: Alter failed for Database 'SPH_MSCRM'.  (Microsoft.SqlServer.Smo) ------------------------------ An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ The server network address "TCP://SPHPRIMARY.sphinet.com.sg:5022" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (Microsoft SQL Server, Error: 1418).This is the error message i got from Error Log"2009-06-03 17:01:08.89 spid27s     Database mirroring connection error 2 'DNS lookup failed with error: '11001(No such host is known.)'.' for 'TCP://SPHPRIMARY.sphinet.com.sg:5022"I restored Principal server DB  by using RESTORE WITH NORECOVERY and now this  database in mirror server is now look like as DBName(Restoring....).How i can identify

Logshipping Restore Secondary database

Hi Team,   i have monitoring log shipping jobs in the prod environment right users are using secondary server my client is suggested to restore the secondary server is it possible to restore secondary server if yes how can we do could you please explain me   Txsubu

Need to restore MDF or LDF file from BAK without creating database.

I need to restore the actual MDF or LDF files within a BAK file without creating/restoring to another database. I just need the physical MDF or LDF files only. Is there a way to do this?
What is not explicitly allowed should be implicitly denied

What does stsadm -restore do to the SQL database?


I have migrated site collection between server farms using stsadm - restore -url <URL> -filename d:\backup.bak -overwrite.

However I have recently encountered an "Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))" error when restoring a site collection. When checking around, it is supposedly caused by a full log file on the SQL database but checking with the DBA team, there is plenty of space on the hard drive for the database and log.

One weirdness that I found is that the content database ballooned to around 2.1 GB in size from the 500MB size with the backup file. I checked another restored site collection (using the stsadm -restore method) and it was around 1.1GB when it should be 500MB.

What does SharePoint do exactly with the restore command? Wouldn't the overwrite flag "overwrite" data instead of ballooning the database? What can be done to avoid this?


That's SharePoint for you...
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