Odd problem I ran into today - we'll restore from backups, but I'd
like to know if there's another way around it.
Our problem is that a log file got so big it filled up the drive.
Couldn't even switch it to simple mode. So the thought was to detach
it, then attach it without the log file. However, it appears that we
had two log files in that database, so we get the following when
trying to use sp_attach_single_file_db:
File activation failure. The physical file name "E:\generic
\generic_log.ldf" may be incorrect.
The log was not rebuilt because there is more than one log file.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'Generic'. CREATE DATABASE is aborted.
Any thoughts? Thanks.Did you try sp_attach_single_file_db? According to BOL for 2005, this should allow attaching a db
having one data file but multiple log files. Actually, sp_attach* procedures are deprecated so use
CREATE DATABASE ... FOR ATTACH (or in this case FOR_ATTACH__REBUILD_LOG) instead. Also, see the
information on BOL for CREATE DATABASE and ATTACH_REBUILD_LOG.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"M Bourgon" <bourgon@.gmail.com> wrote in message
news:f5c0e2d4-3530-461d-a2e0-9238074f7c0f@.21g2000hsj.googlegroups.com...
> Odd problem I ran into today - we'll restore from backups, but I'd
> like to know if there's another way around it.
> Our problem is that a log file got so big it filled up the drive.
> Couldn't even switch it to simple mode. So the thought was to detach
> it, then attach it without the log file. However, it appears that we
> had two log files in that database, so we get the following when
> trying to use sp_attach_single_file_db:
> File activation failure. The physical file name "E:\generic
> \generic_log.ldf" may be incorrect.
> The log was not rebuilt because there is more than one log file.
> Msg 1813, Level 16, State 2, Line 1
> Could not open new database 'Generic'. CREATE DATABASE is aborted.
>
> Any thoughts? Thanks.
没有评论:
发表评论