Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
SQL Server Newbies
»
The log for database 'DBNAME' is not...
The log for database 'DBNAME' is not available.
Rate Topic
Display Mode
Topic Options
Author
Message
dtraian
dtraian
Posted Thursday, September 27, 2012 3:05 AM
Forum Newbie
Group: General Forum Members
Last Login: Friday, April 19, 2013 5:12 AM
Points: 3,
Visits: 25
Hello,
I have a database problem since yesterday.
--------------------------------------------------------------------------------------------------------------------------------------------------
The error is:
-----------------------------------------------------
Message
The 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.
Message
Error: 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.
Post #1365109
anthony.green
anthony.green
Posted Thursday, September 27, 2012 3:09 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
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?
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1365111
dtraian
dtraian
Posted Thursday, September 27, 2012 6:58 AM
Forum Newbie
Group: General Forum Members
Last Login: Friday, April 19, 2013 5:12 AM
Points: 3,
Visits: 25
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
Post #1365211
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.