Author |
Topic |
amirs
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-06-27 : 02:07:32
|
hi i have restore database in sql2005 to use tranction log file.the database single or read only mode. i am use following command to restore LogRESTORE LOG databaseFROM DISK ='H:\LogFile\database_20080626200001.TRN'WITH NORECOVERYbut i have following error messageMsg 3102, Level 16, State 1, Line 1RESTORE cannot process database 'database' use it is in use by this session. It is recommended that the master database be used when performing this operation.Msg 3013, Level 16, State 1, Line 1RESTORE LOG is terminating abnormally. |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-06-27 : 02:23:09
|
Is the query window that you are using to run that restore connected to the database that you are trying to restore?If so, change your active database to master, as the error message says.--Gail Shaw |
|
|
amirs
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-06-27 : 02:40:14
|
thanks for replayso please tell me how can i do this |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-06-27 : 04:04:07
|
USE masterGORESTORE LOG databaseFROM DISK ='H:\LogFile\database_20080626200001.TRN'WITH NORECOVERYOr you can use the drop down box at the top of the query window (assuming you're using query analyser or management studio) to change your current database context.--Gail Shaw |
|
|
amirs
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-06-27 : 04:49:04
|
yes i use this but i have following errorMsg 3117, Level 16, State 1, Line 1The log or differential backup cannot be restored because no files are ready to rollforward.Msg 3013, Level 16, State 1, Line 1RESTORE LOG is terminating abnormally. |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-06-27 : 04:51:15
|
If your database is online, you cannot restore transaction log backups. It has to be wither in standby mode or nonrecovery.What are you trying to do?--Gail Shaw |
|
|
amirs
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-06-27 : 06:04:54
|
the database is single user. i am trying to norecovery |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-06-27 : 08:13:11
|
Did you break log chain? |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-06-27 : 12:14:12
|
If the database is currently in a read-write state and you want to get it into norecovery, run BACKUP LOG TO DISK = "File name here" WITH NORECOVERYHowever you will not be able to restore previous transaction log backups. The LSNs won't match. Maybe explain a little more what you have done up until now, what you are trying to do now and what you are trying to achieve--Gail Shaw |
|
|
|