I administer a server with 300 small databases. It appears to be some type of file corruption and now all the databases are suspect.
I am getting the following errors:
Cannot associate files with differnet databases.
Also: Log file does not match the primary file. It may be from a different database or the log may have been rebuilt previously.
Device activation error...
Now I read several online articles and determined the only way I can recover these databases, is using "sp_attach_single_file_db"
Now, with 300 databases, that would take several hours. That is the last thing I want to do.
Can someone please help. I dunno what to do. The backups I have are outdated.What events have occured to get you to this stage? Form the errors you =describe then it sounbds as though the pathnames for one db have become =scrambled with another. I can think of no waythis could occur other than =manually updating system tables incorrectly.
Anyway, if you can describe how you got to this point - as much detail =as possible then someone may well be able to help. Beig able to rescue =the data vis sp-attach is somewhat dodgy as the databases have not been =detached via sp_detach_db. To try it i would copy ALL files (data and =logs) somewhere safe, then generate as script to try the attaches. =(backup master first in case you mess it up)
Alternatively open a call with PSS to get someone helping.
Mike John
"Richard M." <anonymous@.discussions.microsoft.com> wrote in message =news:4E2AD297-67F2-40FC-AE04-2B601E5E5BFD@.microsoft.com...
> I administer a server with 300 small databases. It appears to be some =type of file corruption and now all the databases are suspect. > > I am getting the following errors:
> > Cannot associate files with differnet databases. > > Also: Log file does not match the primary file. It may be from a =different database or the log may have been rebuilt previously.
> > Device activation error...
> > > Now I read several online articles and determined the only way I can =recover these databases, is using "sp_attach_single_file_db"
> > Now, with 300 databases, that would take several hours. That is the =last thing I want to do. > > Can someone please help. I dunno what to do. The backups I have are =outdated.|||Hi ,
THank you for your reply. You are right! The "sp_attach_single_file_db " did work, but with 300 DBs it would take for ever. However, as luck may have it the hard drive on the SQL server containing the OS completely crashed! It went dead. So, the cause seems to be a combination of file curruption due to hardware failure. So, what I did was create a new server and migrated the data and log files just before the server completely died. On the new server, when I installed SQL and attempted to recover by installing the exact version and replacing the existing ystem databases witht he original so the server can see all the databases, the server completely all the databases were suspect. Hence, this means that allt eh files I transferred were corrupted some how. Now, I have two options:
A: Manually use "sp_attach_single_file_db " on all databases to recover it since it seems to work or
B: Bring the old server back online... and attempt to rectify a hand full of suspect databases.
I choose B, however the OS drive was completely dead. Luckily the drivers containing the data files and the otehr drive containg the log files were OK. The server was then rebuilt, with a new OS drive. Win2K server ws installed and surely it saw the other two drives with the data and log files. I then installed SQL server and the updates. As luck may have it, all the databses were ther with an exception of a dozen datasbes still suspect. S, I then applied "sp_attach_single_file_db : to repair those dozen databases and performed an immediate backup for all the databases. Right now, everything seems to be working but I just don't trust those drives. What do you think?
Regards,
Richard|||I would scrsap the old drives and rebuild something like:
Raid 1 System drives.
Raid 0 + 1 for data
Raid 1 for logs (different set of drives to data)
regular log and data backups to differnet discs
NT backup of 'backup discs' to tape.
Sleep at night as you need several discs to go pop at the same time to =get a real problem!
Good luck.
Mike John
"Richard M." <richard@.richardtheman.com> wrote in message =news:297A2516-6BC0-4B23-9F13-ADA4515EF88D@.microsoft.com...
> Hi ,
> > THank you for your reply. You are right! The "sp_attach_single_file_db =" did work, but with 300 DBs it would take for ever. However, as luck =may have it the hard drive on the SQL server containing the OS =completely crashed! It went dead. So, the cause seems to be a =combination of file curruption due to hardware failure. So, what I did =was create a new server and migrated the data and log files just before =the server completely died. On the new server, when I installed SQL and =attempted to recover by installing the exact version and replacing the =existing ystem databases witht he original so the server can see all the =databases, the server completely all the databases were suspect. Hence, =this means that allt eh files I transferred were corrupted some how. =Now, I have two options: > > A: Manually use "sp_attach_single_file_db " on all databases to =recover it since it seems to work or
> > B: Bring the old server back online... and attempt to rectify a hand =full of suspect databases.
> > > I choose B, however the OS drive was completely dead. Luckily the =drivers containing the data files and the otehr drive containg the log =files were OK. The server was then rebuilt, with a new OS drive. Win2K =server ws installed and surely it saw the other two drives with the data =and log files. I then installed SQL server and the updates. As luck may =have it, all the databses were ther with an exception of a dozen =datasbes still suspect. S, I then applied "sp_attach_single_file_db : to =repair those dozen databases and performed an immediate backup for all =the databases. Right now, everything seems to be working but I just =don't trust those drives. What do you think?
> > Regards,
> > Richard > > > > >
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment