Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Remove cloning of ldf files Expand / Collapse
Author
Message
Posted Friday, March 8, 2013 6:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, December 4, 2014 2:14 AM
Points: 4, Visits: 86
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.

Post #1428557
Posted Friday, March 8, 2013 6:48 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:45 AM
Points: 5,221, Visits: 5,120
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
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

Post #1428559
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse