SQL Server Performance

Recovering Database Problem....Urgent!!!

Discussion in 'General DBA Questions' started by azua14, Dec 16, 2002.

  1. azua14 New Member

    Hi:
    Mi problem is that the DBA leaves the enterprise and nobody knew the password so, they decided to re-install the sql-server.. and how they can't do a backup of the databases they just copy the *.MDF and *.LDF files in a Cd.. the question is .. how i can recover this databases?.. i try to import them using import data, but doesn' work.

    Pd:
    I speak spansih, so if you don't understand something.. please sorry

    Atte.
    César Azúa
  2. cdeaton New Member

    You can attach the two files with the following SQL:

    EXEC sp_attach_db @dbname = N'DBName',
    @filename1 = N'e:sqldataDatafile.mdf',
    @filename2 = N'e:sqldataLogfile.ldf'

    You will need to create the database first, then reattacht the files to it.

    Charlie
    Realcomp II
    Detroit
  3. azua14 New Member

    Thanks..It works fine.


    Atte.
    César Azúa
  4. satya Moderator

    Keep in mind after attching on target server execute DBCC checks and other maintenance tasks which would ensure better performance and fix for the attached db.

    HTH

    Satya SKJ

Share This Page