Syntaxes for Restore

 restore filelistonly from disk = 'E:\RAVIDBA\FULL\AdventureWorks2012_full_backup_20210529_120800.bak'


select * from sys.sysaltfiles


restore database [AdventureWorks2012] 

from disk = 'E:\RAVIDBA\FULL\AdventureWorks2012_full_backup_20210529_120800.bak' 

with replace , recovery ;


restore database [RAVIDBA] 

from disk ='E:\RAVIDBA\FULL\AdventureWorks2012_full_backup_20210529_120800.bak'

with

move 'AdventureWorks2012' 

to 'D:\MYSQLSERVER\MSSQL11.RAVISQLSERVERDBA\MSSQL\DATA\RAVIDBA.mdf', 

move 'AdventureWorks2012_log' 

to 'D:\MYSQLSERVER\MSSQL11.RAVISQLSERVERDBA\MSSQL\LogDB\RAVIDBA_log.ldf' , replace, recovery , stats = 5 ;

Comments

Popular posts from this blog

CREATE VIEW SQL: Modifying views in SQL Server

Transfer logins and passwords between instances of SQL Server

SQL SERVER –Different Ways to Find Recovery Model for Database