|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, November 25, 2009 5:07 AM
Points: 3,
Visits: 11
|
|
Hello all
i ve backuped a DB using Microsft SQL Server Management Studio right clik on db -> tasks ->back up the backup was completed successfully ,but when i try to restore the database , i get this message [Directory lookup for file ...Operating system error 21] what is it wrong that i did?
PS :i heard people talking that MSSMS creates two file (.bak,.log) why the MSSMS have created ONLY ONE FILE for my database ?
PLZ help
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Friday, February 26, 2010 10:06 PM
Points: 1,504,
Visits: 775
|
|
What kind of backup did you perform.
Use the following query to check the list of files in your .bak file.
RESTORE FILELISTONLY FROM DISK = N'D:\DB_name.BAK' And also verify if the drive to which you are trying to roster actually exits. If not try changing the file path to an existing drive.
Tanx
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, March 04, 2010 7:36 AM
Points: 1,425,
Visits: 1,499
|
|
alaminfad (11/17/2009) but when i try to restore the database , i get this message [Directory lookup for file ...Operating system error 21] what is it wrong that i did?
After taking the backup you are immediately restoring it on the same server? Details are not mentioned clearly.
PS :i heard people talking that MSSMS creates two file (.bak,.log) why the MSSMS have created ONLY ONE FILE for my database ? PLZ help
What you might have heard is SQL Server creates 2 files when a database is created not when backup is taken. By default a Database is created with 2 files 1 .MDF File (data file) and .LDF (log file).
You are confused that with the backups (.bak,.log) which is not true. When a backup is performed, it would be placed in the Backup Directory of that instance and would be a single .bak file (unless you have mentioned another file for backup by selecting ADD button)
Give more info here about the restore you tried and definitely someone would give a solution to your problem.
Have a nice day
Bru Medishetty
To get quick answers read the article How to post data/code on a forum to get the best help
My Blog - learnsqlwithbru.com
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Tuesday, March 02, 2010 5:18 AM
Points: 404,
Visits: 351
|
|
Check the permissions for the account used to run the SQL Server service as this sounds like it is missing create permissions for the target directory. I encountered this a while ago but cannot remember the exact error message I received.
Regarding backups. * If you run a full backup, you get a .bak file * If you run a tranaction log backup, you get a .log file
You can change the file extension but these a typical values.
Hope this helps.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, March 04, 2010 7:36 AM
Points: 1,425,
Visits: 1,499
|
|
Mark_Pratt (11/18/2009)
Regarding backups. * If you run a full backup, you get a .bak file * If you run a tranaction log backup, you get a .log file
You can change the file extension but these a typical values.
Hope this helps. Generally I use the default transaction log files extension .trn.
I am not aware of what extensions others use.
Bru Medishetty
To get quick answers read the article How to post data/code on a forum to get the best help
My Blog - learnsqlwithbru.com
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, November 25, 2009 5:07 AM
Points: 3,
Visits: 11
|
|
Thank you Sir for replying
Firstly
I want to restore the DB on a different server which is my local machine ,After have taken the backup , i copied the file to my local drive ,then i tried to restore it and the error appeared
SECONDLY
the backup which i've taken was a FULL BACK UP
THIRDLY
i noticed the path was incorrect here >> Restore wizard (Restore DB >> Options >>Restore the database files as : >> Restore As
E:\Netsoft DataBases\Employee.mdf
i do not even have an E drive
i hope that clarify the problem
THNX
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, November 25, 2009 5:07 AM
Points: 3,
Visits: 11
|
|
Thank you Sir for replying
You were right the path was incorrect here >> Restore wizard (Restore DB >> Options >>Restore the database files as : >> Restore As E:\Netsoft DataBases\Employee.mdf E:\Netsoft DataBases\Employee_log.LDF
i do not even have an E drive
when i changed the path for one file this error appears
System.data.sqlclient.sqlerror:The operation System returned the error 32 ...while Attempting 'Restore Container :: ValidateTargetforcreation on (....) (Misrosoft.SqlServer.smo)
when i changed the path for both files this error appears
System.data.sqlclient.sqlerror: file(...) is claimed by 'Employee_log'(2) and 'Employee' (1)The with move clause ....etc
Your Query was informative but the data are not editable
PS :the backup which i've taken was a FULL BACK UP
i hope that clarify the problem
THNX
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, March 10, 2010 9:25 AM
Points: 37,
Visits: 206
|
|
| Retore the database using T-SQL commands. You will learn more if you use T-SQL instead of GUI
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, March 10, 2010 10:31 AM
Points: 253,
Visits: 377
|
|
Lookup backups in BOL, specifically, look at the section where you are creating a database from a backup. I believe there is an example in there as well that will have all of the arguments that you will need to use.
Joie Andrew "Since 1982"
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, November 30, 2009 2:13 AM
Points: 9,
Visits: 7
|
|
Actually when you backup a database you will get only a database.bak file. But when you restore the above database.bak file you should use datasbase.mdf and databse_log.ldf file of the default database. These .mdf and .ldf files are generated at the time of database creation and not during the .bak restoring process. The problem may be the due to >>restore path for the above .ldf and .mdf file is not set properly. >> overwrite the existing database may not be checked. >>Restore option may not be checked. >>Your database.bak file can be incomplete or corrupted. >>You dont't have authority to access the database.
|
|
|
|