Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
amirs
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-06-04 : 01:24:51
|
| hihow to Restore database in sql server2005 use backup file. i have restore the databse in another machine of same name of database. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-06-04 : 02:51:27
|
You are correct.That is a proper procedure. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-06-04 : 19:27:35
|
| With move option. |
 |
|
|
amirs
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-06-04 : 23:44:18
|
| sodeepplease send how move option is used |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-06-04 : 23:50:51
|
| Like this:RESTORE DATABASE YourDB FROM DISK = 'pathofbackupfile'WITH MOVE 'datafile' TO valid locationMOVE 'logfile' TO valid location |
 |
|
|
amirs
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-06-05 : 00:05:37
|
| i have use this syntax of move optionRESTORE DATABASE databasename FROM DISK = 'path of backfile' WITH MOVE 'db' TO 'F:\Program Files\MSSQL.1\MSSQL\Data\db.mdf', MOVE 'db_log' TO 'F:\Program Files\MSSQL.1\MSSQL\Data\db_log.ldf'but their are following errorMsg 3102, Level 16, State 1, Line 1RESTORE cannot process database 'db' because 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 DATABASE is terminating abnormally. |
 |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-06-07 : 00:37:21
|
| You have to disconnect users from the db, and don't run restore command under that db. |
 |
|
|
|
|
|