Skip to content

Commit 124c954

Browse files
author
AbhishekMallick01
committed
minor changes
1 parent d333344 commit 124c954

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

articles/backup/restore-sql-database-azure-vm.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,28 +197,28 @@ To restore the database files to the *original path on the source server*, remov
197197
198198
**Example**
199199

200-
```
200+
```
201201
USE [master]
202202
RESTORE DATABASE [<DBName>] FROM  DISK = N'<.bak file path>'
203-
```
203+
```
204204
205205
>[!Note]
206206
>You shouldn’t have the same database files on the target server (restore with replace).  Also you can [enable instant file initialization on the target server to reduce the file initialization time overhead]( /sql/relational-databases/databases/database-instant-file-initialization?view=sql-server-ver16).
207207
208208
To relocate the database files from the target restore server, you can frame a TSQL command using the `MOVE` clauses.
209209
210-
```
210+
```
211211
USE [master]
212212
RESTORE DATABASE [<DBName>] FROM  DISK = N'<.bak file path>'  MOVE N'<LogicalName1>' TO N'<TargetFilePath1OnDisk>',  MOVE N'<LogicalName2>' TO N'<TargetFilePath2OnDisk>' GO
213-
```
213+
```
214214
215215
**Example**
216216
217-
``` 
217+
``` 
218218
USE [master]
219219
RESTORE DATABASE [test] FROM  DISK = N'J:\dbBackupFiles\test.bak' WITH  FILE = 1,  MOVE N'test' TO N'F:\data\test.mdf',  MOVE N'test_log' TO N'G:\log\test_log.ldf',  NOUNLOAD,  STATS = 5
220220
GO
221-
```
221+
```
222222

223223
If there are more than two files for the database, you can add additional move clauses to the restore query. You can also use SSMS for database recovery using `.bak` files. Learn more on [restoring an SQL database backup using SSMS]( /sql/relational-databases/backup-restore/restore-a-database-backup-using-ssms?view=sql-server-ver16).
224224

0 commit comments

Comments
 (0)