May 6, 2011 at 10:31 am
First some background. I keep log records in an admin database. The records are populated by way of xp_readerrorlog.
Now I'm trying to find a way to calculate server downtime by way of these records.
Upon instance startup, there are messages logged regarding the state of the server. Things like databases coming online and listening ports. I'm focusing on the following message; "This instance of SQL Server last reported using a process ID of 7563 at 11/3/2010 10:50:52 AM (local) 11/3/2010 2:50:52 PM (UTC). This is an informational message only; no user action is required." This message tells you the last process ID that the instance used and when that was reported, In this case '11/3/2010 10:50:52 AM'. Also with this is a datetime for the each record, '2010-11-03 10:50:58.470' for this message.
With this information I'm assuming I can say this instance was down for ~6 seconds by way of datediff on the two dates (last reported time and log record creation time). Is this a safe assumption? Without third party programs and pings and monitoring tools, is there a major flaw with this method?
thoughts are appreciated
May 7, 2011 at 3:47 am
SELECT create_date
FROM sys.databases
WHERE name='tempdb';
you can check with Tempdb because tempdb recreate when SQL Server service started and then create a sample table with datetime column only and schedule it on the Agent for Every second update a new system date with getdate(),then you can calculate with tempdb create time and last getdate() column updated date
Regards,
Syed Jahanzaib Bin Hassan
BSCS | MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA
My Blog
www.aureus-salah.com
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply