Re: Backup Question



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" <sfarkas@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.



.



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: stsadm.exe
    ... Yes, Stsadm will create the site for you on restore, and it will maintain all permissions. ... Stsadm only backups up data that is stored in the database, so any changes you make to the IIS server's file system you'll have to back up via some other method. ... only backup. ... For example, your production environment is IIS/WSS on one server, SQL Server on another. ...
    (microsoft.public.sharepoint.windowsservices)
  • RE: SQL server restore
    ... there is possiblly a database ... As for the SQL Server 2000 work on the Server A, ... restore the backups on it. ... restore from the backup). ...
    (microsoft.public.sqlserver.server)
  • Re: Restore database
    ... Initialize the backup device with INIT. ... My database is very small. ... Microsoft SQL Server Management Studio Express ... Restore failed for Server 'HOMEDEV\SQLEXPRESS'. ...
    (microsoft.public.sqlserver.setup)
  • RE: Backups have Shadow Copy Problems
    ... with volume Shadow Copy error 800423f4. ... You back up data from a volume that contains a Microsoft SQL Server ... The recovery model of the SQL Server database is configured to use an ... It just ensures backup will continue without reporting the error. ...
    (microsoft.public.windows.server.sbs)