Re: Backup Question



On Aug 30, 10:24 pm, "bass_player [SBS-MVP]" <bass_pla...@xxxxxxxx>
wrote:
The reason for this is that during the restore database process, SQL Server
saw files with the exact same filename ni the same location as that of the
database you are restoring. If you removed the MDF and LDF files from that
locaton after you detached the database, then, yo won't be having this
problem. Since you already have a good working backup (as you mentioned),
you can use this to restore the same database and use the option in
Enterprise Manager to Force restore over existing database. If you're using
TSQL, you can use the WITH MOVE option to rename and move. After restoring,
delete the other set of MDF/LDF files as these are no longer being used by
SQL Server

"ExcelMan" <sfar...@xxxxxxxxx> wrote in message

news:1188530868.352324.43590@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



I was setting up the backup for a new database last evening and seem
to have created a small problem. Although I was able to create a
backup and restore it, in the process I seem to have left a couple of
other copies of the database files in a state where they cannot be
moved, deleted or copied.

I started by right clicking on the database and selecting Back Up. I
then did a Full Backup of the Database (not the Files and
Filegroups). I then detached the original database (probably a
mistake) and went to the Databases level, right-clicked and selected
Restore Database. I did not find the name of my database in the "To
Database:" list so I typed it in and proceeded to select the From
Database (which did have the name of my database and the correct
backup time) and restored the database.

The database seemed to work fine.

However when I checked the files I found not only my original
DatabaseName_Data.MDF and DatabaseName_Log.LDF files, but two new ones
DatabaseName.MDF and DatabaseName_1.LDF. These last two files are the
actual files being used by the restored database.

I would now like to do two things:

1) Move the original DatabaseName_Data.MDF and DatabaseName_Log.LDF
files to a new location, and
2) Rename the files that are actually being used from DatabaseName.MDF
and DatabaseName_1.LDF to DatabaseName_Data.MDF and
DatabaseName_Log.LDF as they were before.

However I can't seem to do anything with the original files because
they seem to still be attached to the server. How can I SAFELY
accomplish what I want without endangering my good database (with the
wrong file names)?

Thanks.- Hide quoted text -

- Show quoted text -

Thanks.

OK, so I detached the database and blew away the files I didn't want
to see. Then I renamed the files I had just detached and tried to
reattach and it would not accept the files. So I went back to the
previous names (DatabaseName.MDF and DatabaseName_1.LDF) and was able
to reattach.

So I have solved one problem -- elimination of extraneous files -- but
I still have file names that are not what I want. Is there now a way
to rename the data and log files to the original names
(DatabaseName_Data.MDF and DatabaseName_Log.LDF) and get everything
back the way it was?

Thanks again.

.



Relevant Pages

  • RE: How do I restore from mdf and ldf files?
    ... Tasks -> Backup Database ... Tasks -> Restore Database ... Windows 2003 Server with Latest Service Pack ... Pre-requisites for Sharepoint Backup and Restore: ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Restoring SQL Server Backups
    ... ORIGINAL BACKUP & RESTORE (MSDE Database) ... occurrenceof cachestore flush for the 'Object Plans' cachestore (part ...
    (microsoft.public.sqlserver.server)
  • Re: Restoring SQL Server Backups
    ... ORIGINAL BACKUP & RESTORE (MSDE Database) ... occurrenceof cachestore flush for the 'Object Plans' cachestore (part ...
    (microsoft.public.sqlserver.server)
  • Re: POINT IN TIME RESTORE
    ... This is what you should have done in order to do the restore as you wish: ... > 3- erase data ... > 5- restore database with norecovery ... The BACKUP DATABAE can of course be at an earlier point in time, ...
    (microsoft.public.sqlserver.server)
  • Re: Backend Exchange migrate to New Hardware (Server)
    ... Exchange mailbox stores and Exchange public folder stores. ... When you use Backup to restore Exchange databases, ... Storage Engine to restore Exchange database files and their ...
    (microsoft.public.exchange.setup)