Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Problem reattaching a db

Author  Topic 

ICFire
Starting Member

7 Posts

Posted - 2005-01-26 : 07:16:09
Trying to reattach a db that doesn't have any log file associated with it. When using Ent. Mgr. it seems to expect one to be there, and says it'll create it but then I get the following error.

MS SQL 2000 sp3a

quote:

Error 1813: Could not open new database 'STS_1'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'D:\Program Files\Microsoft SQL Server\MSSQL\data\STS_1_log.LDF' may be incorrect.



I found this in the MS KB article relating to it.

http://support.microsoft.com/default.aspx?scid=kb;en-us;271223

Which has this for a workaround.

quote:
Use sp_attach_db rather than sp_attach_single_file_db to attach a database with multiple log files. You cannot attach a database that has been created with multiple log files without also attaching all the log files.


Now for the part where I'm confused...how do I run this from the command line? I was using the Enterprise Mgr to try to reattach the db. I also tried opening a DOS window, going to where the db is and running the workaround command but it's an unknown commmand so I need to put something into my path I'm assuming but some guidance would be very helpful.

This is my current path:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Microsoft SQL Server\80\Tools\Binn

chadmat
The Chadinator

1974 Posts

Posted - 2005-01-26 : 13:11:48
Use Query analyzer, and try sp_Attach_Single_File_db.

-Chad

http://www.clrsoft.com

Software built for the Common Language Runtime.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2005-01-26 : 16:24:42
But as it says if the original database had multiple log files you can't attach it.
You could maybe attach in emergeny mode but you wouldn't be able to recover.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

chadmat
The Chadinator

1974 Posts

Posted - 2005-01-26 : 18:30:32
Oh, now I get it. It HAD multiple log files.

-Chad

http://www.clrsoft.com

Software built for the Common Language Runtime.
Go to Top of Page

ICFire
Starting Member

7 Posts

Posted - 2005-01-27 : 12:32:40
Fortunately for me I had used Ent Mgr to do to scheduled backups of this db a few days prior to this occurring...while wringing our hands we restored from the backup and was able to reattach it no problem. Lot easier than even Veritas.

Go to Top of Page
   

- Advertisement -