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


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

restore database

Posted By: rashmi     Posted Date: April 28, 2011    Points:5   Category :Sql Server
i have one backup file but when i try to attach that file i get error
like this

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\PiyushDB is not a primary database file. (.Net SqlClient Data Provider)

and when i try to restore that file i get this type of error

System.Data.SqlClient.SqlError: The media set has 2 media families but only 1 are provided. All members must be provided. (Microsoft.SqlServer.Express.Smo)

plz any one help me how can i solve this problem

Responses
Author: kamlesh             
Posted Date: April 28, 2011     Points: 20   

j

Thanks And Regards.
Kamlesh Nikam
Author: rashmi             
Posted Date: April 28, 2011     Points: 20   

how to check the service using services.msc command in cmd prompt.

Author: Dinkar             
Posted Date: April 28, 2011     Points: 20   

for this first u have to go ic c:\\ drive and check whether log filr created or not in MSSQL.1 or MSSQL.2or MSSQL.3 in this copy all path and pasr in option drive in sql sqerver when u restore database

Author: rashmi             
Posted Date: April 28, 2011     Points: 20   

Actually the database of project is not attach on my pc and i have a backup of that project and i want to restore but i found error so plz help me how can i restore

Author: kamlesh             
Posted Date: April 28, 2011     Points: 20   

got throuth below :

click on start - > Run -> type services.msc

Thanks And Regards.
Kamlesh Nikam
Author: kamlesh             
Posted Date: April 28, 2011     Points: 20   

or u r not trying the restore the database file and let me know what is ur backup file extension is it (.bak or other)

Thanks And Regards.
Kamlesh Nikam
Author: kamlesh             
Posted Date: April 28, 2011     Points: 20   

Open SQL Server
Go to Database . Right click on it and select new database. write ur database name in database name option and click ok now ur database is ready.
again right click on Database file and select Task -- > Restore -- > Database --> ok
Their are two radio button click on From Deveice Select ur .Bak file.and check that file and select page (Left side ) their are one restore option : again check to Overwrite the existing database and press ok button and wait for some time

this is the procedure for restoring the database

Thanks And Regards.
Kamlesh Nikam
Author: kamlesh             
Posted Date: April 28, 2011     Points: 20   

Go through below link
http://msdn.microsoft.com/en-us/library/ms177429.aspx
http://www.tech-recipes.com/rx/2081/sql_server_2005_how_to_restore_database_backup/

Thanks And Regards.
Kamlesh Nikam
Author: rashmi             
Posted Date: April 28, 2011     Points: 20   

Actually the database of project is not attach on my pc and i have a backup(PiyushDB.bak) of that project and i want to restore but i found error so plz help me how can i restore

Author: kamlesh             
Posted Date: April 28, 2011     Points: 20   

Go through below link
http://msdn.microsoft.com/en-us/library/ms177429.aspx
http://www.tech-recipes.com/rx/2081/sql_server_2005_how_to_restore_database_backup/

do the same from above link

Thanks And Regards.
Kamlesh Nikam
Author: rashmi             
Posted Date: April 28, 2011     Points: 20   

i have done it but still i have a same error

System.Data.SqlClient.SqlError: The media set has 2 media families but only 1 are provided. All members must be provided.

Author: kamlesh             
Posted Date: April 28, 2011     Points: 20   

goto this path and delete that database name files(.mdf, .ldf)

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ (Database name with.mdf and .ldg files)
delete that files and then restore

Thanks And Regards.
Kamlesh Nikam
Author: rashmi             
Posted Date: April 28, 2011     Points: 20   


thanku sir

but still i have a same error

Actually the database of project is not attach on my pc and i have a backup(PiyushDB.bak) of that project and i want to restore but i found error so plz help me how can i restore


Author: kamlesh             
Posted Date: April 28, 2011     Points: 20   

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ (Database name with.mdf and .ldg files)
on this path if PiyushDB.mdf and PiyushDB.ldf file is available then delete it and then u can restore

Thanks And Regards.
Kamlesh Nikam
Author: rashmi             
Posted Date: April 28, 2011     Points: 20   

In C: drive .mdf and .ldf file not available

Author: Ani             
Posted Date: May 06, 2011     Points: 20   

Hi rashmi

If the database is not available in C or D drive , may that is the error. Please ensure you are specifying correctly (ie the path of the database,both mdf and ldf).I think you specified the location C or D and there is no files.That is the reason of the error.So identify the location of the database and give the path correctly.

Hope this helps :)


Author: sriram             
Posted Date: October 27, 2011     Points: 20   

Check for Sql server Services ..check u r path correctly ..


BACKUP DATABASE FROM DISK='D:\BACKUP\PUBS.BAK'

RESTORE DATABASE TO DISK='D:\BACKUP\PUBS.BAK'


hope this will help..
let me know any Questions

Regards
Sriram.R

Author: Ned Misher             
Posted Date: June 04, 2012     Points: 20   

Make use of next software http://www.recoverytoolbox.com/sql.html
Application is able to restore system tables and user tables, stored procedures, views, user defined data types and functions



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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