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 12»»

Attach DBs from a restored file on a disk Expand / Collapse
Author
Message
Posted Tuesday, July 29, 2014 6:49 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 10:33 PM
Points: 163, Visits: 443
I had SQL Server on a Server and the OS went bad and I had to reinstall the OS. In doing so, the wrong disk was used to install the OS and Formated the disk with the SQL Data. I did not install anything on there, so I was able to restore the SQL db's to another disk with recover software. Now I am trying to reattach the db's but I get an error msg "Attach databases failed for...." "Database ... cannot be upgraded because it is read-only or has read-only files. make the database or files writeable, and rerun recovery. ... Error: 3415"

How can I reattach these files?



Post #1597542
Posted Wednesday, July 30, 2014 1:09 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 11:23 PM
Points: 1,280, Visits: 1,761
Remove the Read-Only flag on the NTFS permissions for the MDF file (& LDF).
Post #1597598
Posted Wednesday, July 30, 2014 5:04 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 10:33 PM
Points: 163, Visits: 443
That's the first thing I tried, no cigar.


Post #1597646
Posted Wednesday, July 30, 2014 5:33 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:43 PM
Points: 40,411, Visits: 36,861
Make sure the files aren't read-only, make sure the folder isn't read-only (check parent folder too). Make sure that the SQL Server service account has full permissions on the files and folder.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1597660
Posted Wednesday, July 30, 2014 8:23 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 10:33 PM
Points: 163, Visits: 443
what is the sql server service acct (default)?


Post #1597754
Posted Wednesday, July 30, 2014 8:27 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:53 PM
Points: 6,630, Visits: 14,205
GrassHopper (7/30/2014)
what is the sql server service acct (default)?

Whatever you set it to!!
Open sql server configuration manager on the server and check the acct in use for the sql and its agent service


-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs"
Post #1597759
Posted Wednesday, July 30, 2014 10:09 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 10:33 PM
Points: 163, Visits: 443
that did not work. Running a recovery application on the file and it is recovering the db. It must be corrupt.


Post #1597838
Posted Wednesday, July 30, 2014 12:25 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:43 PM
Points: 40,411, Visits: 36,861
GrassHopper (7/30/2014)
that did not work. Running a recovery application on the file and it is recovering the db. It must be corrupt.


No. Corrupt databases do not give that error.
Did you ensure that the folder isn't read only anywhere? That the file isn't? That the permissions are correct?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1597896
Posted Wednesday, July 30, 2014 3:01 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 10:33 PM
Points: 163, Visits: 443
Yes, checked rights and read only checkbox on folder and on file. I even moved the sql files to the default location for sql data files.


Post #1597991
Posted Wednesday, July 30, 2014 3:02 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 10:33 PM
Points: 163, Visits: 443
2 db's were able to attach, the others did not and they are all in the same folder.


Post #1597993
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse