Nope. The data files and log files work in pairs together.
First to delete the mdf, the database must have been offline
or the service was stopped. At that point, they would have
needed the log and data files from that point and time. I'd
guess they didn't pay much attention to anything about the
log...just restored an older mdf, copied that over and then
started the service. That's not really how you'd want to go
about it.
The best approach is to restore from a database backup.
If all they have is an mdf and ldf files, the best they can
hope for is to try to use sp_attach_db with a valid pair (or
set - you could have multiple files) of mdf, ldf files. Or
if they only have mdf files, they can try
sp_attach_single_file_db. But to use those, you really
should be explicitly detaching the files using sp_detach_db.
After you restore or attach...whichever...you'd want to run
a dbcc checkdb and dbcc checkcatalog on the database.
Sounds like they created a bit of a mess.
-Sue
On Thu, 24 Feb 2005 13:27:51 -0500, "Dave B"
[quoted text, click to view] <daveb@atgnet.com> wrote:
>I have a client who accidently deleted the MDF file for a SQL Server 2000
>database. They restored the file from tape but now the log file shows the
>database continuously restarting:
>
>2005-02-24 10:09:42.24 spid55 Starting up database 'downs_IR'.
>2005-02-24 10:10:17.24 spid55 Starting up database 'downs_IR'.
>2005-02-24 10:10:52.24 spid55 Starting up database 'downs_IR'.
>2005-02-24 10:43:39.16 spid53 Starting up database 'downs_IR'.
>
>First of all, is it valid to just restore a missing MDF file? Are there any
>steps she should have done after the restore. Thanks.
>
>
Unfortunately, Dave posted that it's one of his clients so
he probably doesn't have much control over that. And some
companies have some procedures - such as the managers having
full access to everything people under them have - and
working up the hierarchy that way. At one place a manager
stopped a bunch of services and deleted database files
"because they were big files taking up too much room" after
receiving a notice from the operations group about space on
the server starting to get a little cramped. The manager had
full access to the server due to the position hierarchy
implementation of security. SOX and security focus in
general seems to be changing some of that.
-Sue
On Thu, 24 Feb 2005 14:41:27 -0500, "Steve Thompson"
[quoted text, click to view] <stevethompson@nomail.please> wrote:
>"Sue Hoegemeier" <Sue_H@nomail.please> wrote in message
>news:rdas11pb82j43ajco6et6n8b5vsh08tbh9@4ax.com...
>> Sounds like they created a bit of a mess.
>
>Excellent point, forgot to recommend that the users should be locked out of
>the server on a file level!
>
>Steve
>
I have a client who accidently deleted the MDF file for a SQL Server 2000
database. They restored the file from tape but now the log file shows the
database continuously restarting:
2005-02-24 10:09:42.24 spid55 Starting up database 'downs_IR'.
2005-02-24 10:10:17.24 spid55 Starting up database 'downs_IR'.
2005-02-24 10:10:52.24 spid55 Starting up database 'downs_IR'.
2005-02-24 10:43:39.16 spid53 Starting up database 'downs_IR'.
First of all, is it valid to just restore a missing MDF file? Are there any
steps she should have done after the restore. Thanks.
[quoted text, click to view] "Dave B" <daveb@atgnet.com> wrote in message
news:e91rP6pGFHA.2360@TK2MSFTNGP12.phx.gbl...
> I have a client who accidently deleted the MDF file for a SQL Server 2000
> database. They restored the file from tape but now the log file shows the
> database continuously restarting:
>
> 2005-02-24 10:09:42.24 spid55 Starting up database 'downs_IR'.
> 2005-02-24 10:10:17.24 spid55 Starting up database 'downs_IR'.
> 2005-02-24 10:10:52.24 spid55 Starting up database 'downs_IR'.
> 2005-02-24 10:43:39.16 spid53 Starting up database 'downs_IR'.
>
> First of all, is it valid to just restore a missing MDF file?
Probably not the way you did this... Ideally, you'd want to restore the
database from the last good database backup, then apply the incremental
backups (if any).
[quoted text, click to view] > Are there any steps she should have done after the restore.
If you only have access to the mdf file, you could try dropping the above
database, then use sp_attach_single_file_db to reattach. Be sure to run DBCC
checks to check the health of the database.
Steve
[quoted text, click to view] "Sue Hoegemeier" <Sue_H@nomail.please> wrote in message
news:rdas11pb82j43ajco6et6n8b5vsh08tbh9@4ax.com...
> Sounds like they created a bit of a mess.
Excellent point, forgot to recommend that the users should be locked out of
the server on a file level!
Steve
[quoted text, click to view] "Sue Hoegemeier" <Sue_H@nomail.please> wrote in message
news:dbcs11hip8o0ovd68megbkcanhj7lht8d8@4ax.com...
> Unfortunately, Dave posted that it's one of his clients so
> he probably doesn't have much control over that. And some
> companies have some procedures - such as the managers having
> full access to everything people under them have - and
> working up the hierarchy that way. At one place a manager
> stopped a bunch of services and deleted database files
> "because they were big files taking up too much room" after
> receiving a notice from the operations group about space on
> the server starting to get a little cramped. The manager had
> full access to the server due to the position hierarchy
> implementation of security. SOX and security focus in
> general seems to be changing some of that.
Sue,
You've got some great war stories!!! And, that is the sad reality, now if we
could only keep managers from having administrative rights.... <right>.
Steve
Don't see what you're looking for? Try a search.