Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009

    Unanswered: could not restore db

    I have installed SQL 2005 in windows server 2003.

    Actually, i have a database name QAI on this machine. It stopped working as the drive containing this db became full.

    when i tried to start this db, i got the following error:

    'qai' cannot be opened due to inaccessible files or insufficient memory or disk space.

    My friend told me to detach the databas and then move some datafiles to the new location.when i detach the databse, i got the following error,

    Error while closing database 'qai'. Check for previous additional errors and retry the operation.

    However, the databas was disappered. Now after moving files when i agian try to attach, then the following error comes,

    e:\data\qai_data.mdf is not a primary database file

    How can i restore my database?

  2. #2
    Join Date
    Jun 2004
    Long Island
    First thing I would check to see if your DB was using the full recovery model (by default) and to see if drive the transaction log filled up your drive. if so,

    backup log QAI with no_log

    do a "select name from sysfiles" in that db to get the logfilename

    dbcc shrinkfile(LogFileName, NewSizeinMB)

    If you need the db to be in full recovery (more than recovery from last full backup), you'll need to put jobs in place to backup the transaction log at regular intervals.

  3. #3
    Join Date
    Jan 2003
    Provided Answers: 17
    first, you need a backup of the database. Either from tape, or disk, wherever you make your backups. You can restore this database and use the MOVE option to move individual files around. Most backup packages (veritas, Legato, etc.) will give you the option of moving files in their restore GUIs, as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts