SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Remove cloning of ldf files


Remove cloning of ldf files

Author
Message
anupam.jha
anupam.jha
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 116
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>Wink
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.
anthony.green
anthony.green
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10041 Visits: 6303
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.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search