probel with restore database - sql server
-
hi i try to backup and restore database using sql-server 2008 and got error. to backup i done this:
BACKUP DATABASE MyDB TO DISK='d:\MyDB.BAK'
(and its work fine) to restore i done this:
USE MASTER RESTORE DATABASE MyDB FROM DISK='d:\MyDB.BAK
and got this error:
Msg 3159, Level 16, State 1, Line 7
The tail of the log for the database "MyDB " has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
Msg 3013, Level 16, State 1, Line 7
RESTORE DATABASE is terminating abnormally.Where I'm wrong ? what is missing ? thank's in advance
-
hi i try to backup and restore database using sql-server 2008 and got error. to backup i done this:
BACKUP DATABASE MyDB TO DISK='d:\MyDB.BAK'
(and its work fine) to restore i done this:
USE MASTER RESTORE DATABASE MyDB FROM DISK='d:\MyDB.BAK
and got this error:
Msg 3159, Level 16, State 1, Line 7
The tail of the log for the database "MyDB " has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
Msg 3013, Level 16, State 1, Line 7
RESTORE DATABASE is terminating abnormally.Where I'm wrong ? what is missing ? thank's in advance
-
-
Perhaps this would help
RESTORE DATABASE MyDB FROM DISK='d:\MyDB.BAK' WITH REPLACE
-
Perhaps this would help
RESTORE DATABASE MyDB FROM DISK='d:\MyDB.BAK' WITH REPLACE
-
thank's for the help, but i got this error:
Msg 3101, Level 16, State 1, Line 7
Exclusive access could not be obtained because the database is in use.
Msg 3013, Level 16, State 1, Line 7
RESTORE DATABASE is terminating abnormally.
You can't do a restore on a database that is in use. So you will first have to kill all clients accessing the database, either by stopping them or forcefully disconnecting them from the database. Check the activity using the 'Activity Monitor'.
-
thank's for the help, but i got this error:
Msg 3101, Level 16, State 1, Line 7
Exclusive access could not be obtained because the database is in use.
Msg 3013, Level 16, State 1, Line 7
RESTORE DATABASE is terminating abnormally.
Well your error message suggest the problem. Close all applications using the database you want to restore. Close all SSMS windows using the database you want to restore. And when you are running restore query use master database. Try to read the error messages in all cases. That will help you understand any problem.