﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 7,2000 / SQL Server Newbies  / The log for database 'DBNAME' is not available. / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 15:26:40 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: The log for database 'DBNAME' is not available.</title><link>http://www.sqlservercentral.com/Forums/Topic1365109-169-1.aspx</link><description>Yes, everything is in place.I do have backups.Another immediate solution to what is happening is to detach/attach database, but I'm currently looking for a definitive one.Any suggestions?Thank you very much</description><pubDate>Thu, 27 Sep 2012 06:58:02 GMT</pubDate><dc:creator>dtraian</dc:creator></item><item><title>RE: The log for database 'DBNAME' is not available.</title><link>http://www.sqlservercentral.com/Forums/Topic1365109-169-1.aspx</link><description>Have you checked the path which the DB thinks where the log is, is actually where the log is, or someone hasn't deleted the log?Do you have any backups for the DB?</description><pubDate>Thu, 27 Sep 2012 03:09:30 GMT</pubDate><dc:creator>anthony.green</dc:creator></item><item><title>The log for database 'DBNAME' is not available.</title><link>http://www.sqlservercentral.com/Forums/Topic1365109-169-1.aspx</link><description>Hello, I have a database problem since yesterday. --------------------------------------------------------------------------------------------------------------------------------------------------The error is:-----------------------------------------------------MessageThe log for database 'DBNAME' is not available. Check the event log for related error messages. Resolve any errors and restart the database.Cannot close event log because there are still event handle users active.MessageError: 9001, Severity: 21, State: 1.-----------------------------------------------------What I do:----------------------------------------------------- exec('ALTER DATABASE [' + @DBName + '] SET OFFLINE WITH ROLLBACK IMMEDIATE') print '*** Taken ' + @DBName + ' offline .' exec('ALTER DATABASE [' + @DBName + '] SET ONLINE ') print '*** Brought ' + @DBName + ' online .'  declare @logName varchar(100) select @logname=name from master.dbo.sysaltfiles  where groupid=0 and dbid=(select dbid from master.dbo.sysdatabases where name=@DBName) exec ('USE [' + @DBName + '] DBCC checkdb with ALL_ERRORMSGS ,EXTENDED_LOGICAL_CHECKS,NO_INFOMSGS ') print '*** Checked ' + @DBName-----------------------------------------------------We have in this moment:-----------------------------------------------------2300 databases on the specific SQL Instance. The version is SQL SERVER 2008 R2 SP2.-----------------------------------------------------Please HELP!!! I' don't know what to do.Thank you very much.</description><pubDate>Thu, 27 Sep 2012 03:05:46 GMT</pubDate><dc:creator>dtraian</dc:creator></item></channel></rss>