March 8, 2013 at 6:43 am
Hi Experts,
PLease help me in my task where i have to remove cloning of ldf files on SQL Server 2012.
I am a novice in such activities.
I have tried some of the below methods but all in vain.
CREATE DATABASE AConfig_Test1
ON (FILENAME=<path and mdf file name>)
FOR ATTACH_REBUILD_LOG
EXEC sp_attach_single_file_db @dbname='AConfig_Test1',
@physname='path\mdffilename.mdf'
GO
CREATE DATABASE AppConfig_Test1 ON
( FILENAME = 'path\filename.mdf)
FOR ATTACH
GO
All these threw the below error:
Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "<path>\AppConfig_Test1.LDF". Operating system error 5: "5(Access is denied.)".
File activation failure. The physical file name "<path>\\AppConfig_Log.LDF" may be incorrect.
The log cannot be rebuilt when the primary file is read-only.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'AppConfig_Test1'. CREATE DATABASE is aborted.
March 8, 2013 at 6:48 am
You need the original LDF, the DB was detached read_only so it will not allow you to create a new LDF for that DB, you need the one it was using when it was set to read only and detached.
Also error 5 is access denied ensure you have the right permissions assigned to your service accounts.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply