Recovering from a server crash

  • I am not sure I have this right so I was hoping someone here would straigten me out.

    I had a client's server crash. We recovered his MSSQL7 directory but, of course, cannot access the databases in the Data folder through a new install of MS SQL.

    So, from the new install of MS SQL, I want to attach the data from the recovered folder. Can I do this:

    Open Enterprise Manager

    Open the Query Analyser

    Type the following:

    
    
    sp_attach_db
    @dbname = 'Recovered_Data'
    @filename1='e:\mssql\data\Sale_And_Marketing.mdf'
    @filename2='e:\mssql\data\Sale_And_Marketing.ldf'

    And expect SQL to restore the data? Or am I out to lunch here.

    Thanks!

    Reality pales in the light of common perception.


    Reality pales in the light of common perception.

  • Assuming the two files you recovered are fine, that should work.

    Note, you are missing comma's after line 2 and 3.

    Hope this helps.

    David

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Right the data should be fine, however user logins may be another issue. If you rebuild the logins you can use sp_change_login with autofix (see BOL) to sync them. That would be the only issue with the DB itself.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Thanks - it worked like a charm.

    This was a GoldMine database so I had to tweek it from Borland, but that was a breeze compared to jockeying the SQL around

    Appreciate all of the help!

    Reality pales in the light of common perception.


    Reality pales in the light of common perception.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply