November 7, 2013 at 4:49 am
I know that I should provide the error but I really can't do that now.
This works:
RESTORE DATABASE MyDW
FROM DISK = 'D:\Backup\Complete\MyDW\MyDW_backup_2013_11_06_120630_5254371.bak'
WITH REPLACE,
RECOVERY,
MOVE 'MyDW' TO 'D:\MSSQL\Data\MyDW1.mdf',
MOVE 'MyDW_Fortune' TO 'D:\MSSQL\Data\MyDW1_FortuneObjects1.NDF'--,
--MOVE 'MyDW_log' TO 'I\MSSQL\log\MyDW.ldf'
I want to restore the Log File but the following does not work:
RESTORE DATABASE MyDW
FROM DISK = 'D:\Backup\Complete\MyDW\MyDW_backup_2013_11_06_120630_5254371.bak'
WITH REPLACE,
RECOVERY,
MOVE 'MyDW' TO 'D:\MSSQL\Data\MyDW1.mdf',
MOVE 'MyDW_Fortune' TO 'D:\MSSQL\Data\MyDW1_FortuneObjects1.NDF',
MOVE 'MyDW_log' TO 'I\MSSQL\log\MyDW.ldf'
Any ideas as to what is wrong with my syntax?
Thank you.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 7, 2013 at 5:06 am
Edit: log file, not log backups.
Without the error, guessing. Does the drive and path exist?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 7, 2013 at 5:08 am
Did you miss colon (:) before your drive letter I it should be
'I:\MSSQL\log\MyDW.ldf'
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
November 7, 2013 at 5:25 am
Bhuvnesh (11/7/2013)
Did you miss colon (:) before your drive letter I it should be'I:\MSSQL\log\MyDW.ldf'
Dah.:blush:
Thank you.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 7, 2013 at 6:20 am
To avoid typos when replacing DBs from backups with the same logcal file names, I tend to generate the MOVEs with the following:
-- To generate MOVEs from dest DB
SELECT ',MOVE ''' + name + ''' TO ''' + physical_name + ''''
FROM sys.master_files
WHERE DB_NAME(database_id) = 'MyDW'
ORDER BY [type], data_space_id
November 7, 2013 at 6:33 am
Cool script.
Thanks everyone.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
November 7, 2013 at 6:38 am
Welsh Corgi (11/7/2013)
Cool script.Thanks everyone.
Did you find the issue ?
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
November 7, 2013 at 7:43 am
Bhuvnesh (11/7/2013)
Welsh Corgi (11/7/2013)
Cool script.Thanks everyone.
Did you find the issue ?
Case closed.
Thank you.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply