//Backup Databse
backup database subhash to disk='f:\subhash1234.bak'
//Restore DataBase
Retrive the Logical file name of the database from backup.
RESTORE FILELISTONLY
FROM DISK = 'f:\subhash1234.bak' after this query run You find out .MDF AND .Ldf file.
MDF = Primary Data File.
LDF = Log File.
RESTORE DATABASE YourDB
FROM DISK = 'f:\subhash1234.bak'
WITH MOVE 'YourMDFLogicalName' TO 'F:\DataYourMDFFile.mdf',
MOVE 'YourLDFLogicalName' TO 'F:\DataYourLDFFile.ldf'
Example-----
RESTORE DATABASE Deepak1
FROM DISK = 'f:\subhash1234.bak'
WITH MOVE 'subhash' TO 'F:\subhash.mdf',
MOVE 'subhash_log' TO 'F:\subhash_log.LDF'
Tuesday, October 19, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment