Link to home
Start Free TrialLog in
Avatar of VIVEKANANDHAN_PERIASAMY
VIVEKANANDHAN_PERIASAMY

asked on

Alert for SQLServer:Databases:Percent Log

I have received alert for Desc: SQLServer:Databases:  Percent Log Used:  DATABASENAME Value = 77.3333333333333;
but when i check in the perfmon it is showing the average value between 17 and 18 and max value between 39 and 46.
I dont know why i got this alerts?If i am getting this alert what should i check in DB?
Avatar of dbaSQL
dbaSQL
Flag of United States of America image

Go into SSMS, your server name \ SQL Server Agent \ Alerts.   Look for the alert with that description.
Avatar of lcohan
just little bit more details how to do that - under the SQL Agent->right click Alerts->select New alert and set it like below to suit your needs:

  User generated image
Sorry didn't read your question carefully....you should check your DB files uder DB properties and make sure you have regular bakups - FULL and T-logs otherwise your logs will just grow huge in time.

you can run query below to see space alocated/used in your DB:

use your_db
go

--check db files
SELECT name,size/128.0 as SizeInMB ,size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS AvailableSpaceInMB
FROM sys.database_files;
Avatar of VIVEKANANDHAN_PERIASAMY
VIVEKANANDHAN_PERIASAMY

ASKER

Thanks Experts!

I tried belowDBCC command to find out the log space,

dbcc sqlperf(logspace)

But I have doubt in this,
My log file initial growth is 15101 and there is no autogrowth and alerts is configured for more than 60%
when the alert was received it was 77.33% but when checked the space it was just 0.54%.
How this could have decreased from 77.33% to 0.54%.
How the used space are decreasing from higher value to lower value?What is the happening internally?
ASKER CERTIFIED SOLUTION
Avatar of dbaSQL
dbaSQL
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks Understood,

I have some doubts in this, When we use recovery with 'stopat' or 'stopbefore'syntax , then from where did the old data's are fetched? is it not from ldf file where transaction logs acts as pointer to the data in the ldf file?
well, i'd need a better idea of what was actually occurring from the time of the alert, to the point that you checked it.  were you actually in the process of retoring the database to a point in time, using stopat?  If restoring from a full backup, SQL is recreating the db in entirety.  It includes the tran log records (or your ldf), and after the restore completes, all of the uncommitted transactions are rolled back.  

The backups themselves, of course, copy all commited data to the db, and all uncommitted log entries (ldf).  When it starts, it puts a marker on the tran log, but the activity (transactions) will continue while the backup is running.  At the point of completion, it just captures all transactions since the starting marker.  The uncommitted transactions aren't backed up, but they are copied in, and then rolled back.

surely you're aware of this already.  i guess i would need a better understanding of the actual activity, at time of the alert and after, in order to help.
thanks actually i got the answer from your previous post.
I will open a new question on this.

Appreciated your work!
glad to help!