Re: How to restore a database onto different server with mdf and ldf file only

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Simon Lenn (simonlenn_at_yahoo.com)
Date: 08/22/04


Date: 21 Aug 2004 21:40:06 -0700


"Hari Prasad" <hari_prasad_k@hotmail.com> wrote in message news:<e2tvre6hEHA.3664@TK2MSFTNGP11.phx.gbl>...
> Hi,
>
> You could try attaching the database into another SQL server.
>
> 1. Copy the MDF and LDF to the new sql server
> 2. Execute the below command:-
>
> sp_attach_db 'dbname','drive:\path\dbname.MDF','drive:\path\dbname.LDF'
>
> 3. After this you may need to syncronize the user inside the database with
> syslogins in new server.
>
> See procedure sp_change_users_login in books online.
>
> Thanks
> Hari
> MCDBA

Hari

Many Thanks. It was a cool tip I did not even do Sp_change_users I was
able to recover my database that was really cool.

Many thanks for your help. I can't thank you enough so much of effort
was in this database and I did not have a good backup of the database
I have taken a backup now!!

Many Thanks again for your help. I can sleep for the weekend.

Simon



Relevant Pages

  • 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)
  • Re: Start SQLServerAgent job Synchronously
    ... Wayne Snyder, MCDBA, SQL Server MVP ... > call and the caller resumes processing as soon as the call is made. ... > I have a set of SQLServerAgent jobs, each of which runs a BACKUP DATABASE ...
    (microsoft.public.sqlserver.server)
  • Re: Start SQLServerAgent job Synchronously
    ... Wayne Snyder, MCDBA, SQL Server MVP ... > call and the caller resumes processing as soon as the call is made. ... > I have a set of SQLServerAgent jobs, each of which runs a BACKUP DATABASE ...
    (microsoft.public.sqlserver.programming)
  • Re: "Best Practices" way to distribute MSDE
    ... > Restore a users's selected backup. ... for dayly house-keeping I do usually provide scripted job for database ... that file copy operation (not SQL Server backup!) can be performed.. ... my personala advice is to perform dayly house-keeping actions ...
    (microsoft.public.sqlserver.msde)
  • Re: NT Backup Causes Server to Hang
    ... Thanks for using the SBS newsgroup. ... 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)