var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
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?
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.
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.