Seeking help on SQL Server Monitoring

Hi Experts,
This question is related to monitoring of sql server.
1. I want to send an email alert with all open transactions on SQL Server in HTML report whenever there is sustained 50-60% CPU usage for more than 3 minutes. How to achieve this using TSQL or stored procedure so that I can schedule as a job and keep polling
on regular basis.
2. Similar as above, I wanted to get notified whenever there is sustained 70-80% memory usage on the server for more than 3 minutes.
   The reason for this, even though I have set the max server memory setting for sql server, there could some component eating up memory which can cause external memory pressure.
   In such situations, DBA team should get an email alert notification even before users calls in and open a ticket.
I have anyone can provide sample code that will be great help. Based on that I can extend the functionality of monitoring like collecting trace etc...
Thanks in advance.

I have been using SQL Monitor from www.red-gate.com  for many years to get such alerts.
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • SQL Server monitoring error event log 4001

    hello Experts ,
    We have SCOM 2012 R2 environment ,I have installed SQL SERVER MPs 6.5.0.1 and installed SCOM agent on some of SQL Server. Some of the SQL Server are monitoring working properly not all SQL Server but getting error  for some of SQL Server in event log
    Event :4001
    Management Group: SCOMMgtGroup. Script: Main Module: CPUUsagePercentDataSource.ps1 : 
    Computer Name = 'MHSSCOM01.memnet.org' WMI = 'ComputerManagement11' Service Name = 'MSSQLSERVER' SQL Instance Name = 'MSSQLSERVER'
    Exception calling "Fill" with "1" argument(s): "The user does not have permission to perform this action."Error occured during CPU Usage for SQL Instances data source executing.
    Computer:MHSSCOM01 
    Reason: Exception calling "Fill" with "1" argument(s): "The user does not have permission to perform this action."
    also not getting Database information within the SQL Server instances for these SQL Server within "Instances Summary "
    for resolution ,I have created a Run as account (windows)for SQL monitoring then associated it with Run as profile with SQL Server default account,Discovery account and Monitoring account and distribute it securely to each SQL Server health service object
    .The run as account have  added to local admin group on each SQL server.
    How to resolved the event log error and how to get database information for all instances of sql server.
    Thanks
    RICHA

    Hi,
    It seems like that the action account that run the script does not have enough permissions on the monitored SQL server, I would like to suggest you follow the below link to check your runas account configuration:
    http://blogs.technet.com/b/kevinholman/archive/2010/09/08/configuring-run-as-accounts-and-profiles-in-r2-a-sql-management-pack-example.aspx
    And make sure the action account also have SQL admin account to the SQL server.
    Here is also a link that may be helpful for you:
    http://blogs.technet.com/b/momteam/archive/2014/05/12/kb-event-4001-in-the-operations-manager-log-during-sql-server-2012-monitoring.aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • Cannot find a report for SQL Server monitoring

    We installed a SCOM 2012 environment recently and imported the SQL Server Management packs successfully. SQL Servers are being monitored. 
    However, in the reporting section, i cannot find a group for SQL Server Reporting. All other show up ( Active Directory, Appication Monitoring, Web monitoring, etc) Just none for the SQL Reporting.
    Please help

    Hi,
    I assume that you miss some SQL management packs, would you please re-download the management pack here and import it:
    https://www.microsoft.com/en-hk/download/details.aspx?id=10631
    After successful importing, you should see it under reporting workspace:
    If you still cannot see it, please check operation manager event logs for more information to help to troubleshoot this issue.
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Help! SQL server database log file increasing enormously

    I have 5 SSIS jobs running in sql server job agent and some of them are pulling transactional data into our database over the interval of 4 hours frequently. The problem is log file of our database is growing rapidly which means in a day, it eats up 160GB of
    disk space. Since our requirement dont need In-point recovery, so I set the recovery model to SIMPLE, eventhough I set it to SIMPLE, the log
    data consumes more than 160GB in a day. Because of disk full, the scheduled jobs getting failed often.Temporarily I am doing DETACH approach
    to cleanup the log.
    FYI: All the SSIS packages in the job is using Transaction on
    some tasks. for eg. Sequence Cointainer
    I want a permanent solution to keep log file in a particular memory limit and as I said earlier I dont want my log data for future In-Point recovery, so no need to take log backup at all.
    And one more problem is that in our database,the transactional table has 10 million records in it and some master tables have over 1000 records on them but our mdf file
    size is about 50 GB now.I dont believe that this 10 million records should make it to 50GB memory consumption.Whats the problem here?
    Help me on these issues. Thanks in advance.

    And one more problem is that in our database,the transactional table has 10 million records in it and some master tables have over 1000 records on them but our mdf file
    size is about 50 GB now.I dont believe that this 10 million records should make it to 50GB memory consumption.Whats the problem here?
    Help me on these issues.
    For SSIS part of question it would be better if you ask in SSIS forum although noting is going to change about logging behavior. You can increase some space on log file and also should batch your transactions as already suggested
    Regarding memory question about SQL Server, once it utilizes memory is not going to release unless there is windows OS faces memory pressure and SQLOS asks SQL Server to trim down its memory consumption. So again if you have set max server memory to some
    where near 50 SQL Server will utilize that much memory eventually. So what you are seeing is totally normal. Remember its costtly task for SQL Server to release and take memory so it avoids it by caching as much as possible plus it caches more so as to avoid
    physical reads which are costly
    When log file is getting full what does below transaction return
    select log_reuse_wait_desc from sys.databases where name='db_name'
    Can you manually introduce chekpoint in ETL query. Try this it might help you
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Help installing Sql server 2014

    Sir i am currently using Visual studio 2013 (with built in Local DB v11), sir i need to use SQL Server Agent (for timed jobs) and cannot find that option in Local DB. Do i need to install SQL Server management studio 2014 for this purpose? If yes, i DON'T know
    which version should i install ? will it affect my currently available Local DB ? i was thinking about installing this:
    Express with Advanced Services (SQLEXPRADV_Architecture_Language.exe)
    Please help and reply, thank you so much.. !

    i need to use SQL Server Agent
    Hello,
    The feature SQL Server Agent is only available in Web/BI/Standard/Enterprise Edition, not in Express nor LocalDB, see
    Features Supported by the Editions of SQL Server 2014
    You could use Windows Scheduler + SqlCmd tool to run scheduled Jobs.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • I need help installing SQL Server 2012 Express

    I am very much an amateur. I got a new machine. The old one had Server 2008 R2 but the recommendation was that I need to move to 2012 Express.
    When I moved to the new machine, the mover (LapLink) screwed up the version of 2008 R2. IOW, I now have to go forward and install 2012..
    I downloaded all the 64 bit files (5 of them). When I start SQLEXPR_x64_ENU.exe, the process starts and then I'm given the choice of a new install or upgrade. I chose the new install. The process started and I got the following message ...
    "Failed to retrieve data for this request.."
    There are no hints anyplace as to what this means.
    When I click "OK", a new status window pops up and proclaims that something is wrong. Then all activity stops.
    I don't know what to do. I can't use either version and I really can't tell you much more to help me.
    Eric Johnson

    I'm not certain how to send the log material so I'll just cut 'n paste the file named "Summary_Eric-PC_20140921_134001_GlobalRules" If this isn't the right way, please forgive me and suggest what is right. Anyway, here goes ...
    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2146233088
      Exit facility code:            19
      Exit error code:               5376
      Exit message:                  Failed to retrieve data for this request.
      Start time:                    2014-09-21 13:40:09
      End time:                      2014-09-21 13:40:29
      Requested action:              RunRules
      Exception help link:           http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.2100.60&EvtType=0x48BB60BC%400xBB814387&EvtType=0x48BB60BC%400xBB814387
    Machine Properties:
      Machine name:                  ERIC-PC
      Machine processor count:       8
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No
    Package properties:
      Description:                   Microsoft SQL Server 2012
      ProductName:                   SQL Server 2012
      Type:                          RTM
      Version:                       11
      SPLevel:                       0
      Installation location:         c:\851594228c4871a4e88415938631\x64\setup\
      Installation edition:          Express
    User Input Settings:
      ACTION:                        RunRules
      CONFIGURATIONFILE:             
      ENU:                           true
      FEATURES:                      
      HELP:                          false
      INDICATEPROGRESS:              false
      INSTANCENAME:                  <empty>
      PID:                           *****
      QUIET:                         false
      QUIETSIMPLE:                   false
      RULES:                         GlobalRules
      UIMODE:                        AutoAdvance
      X86:                           false
      Configuration file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20140921_134001\ConfigurationFile.ini
    Rules with failures:
    Global rules:
    There are no scenario-specific rules.
    Rules report file:               The rule result report file is not available.
    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented
    Exception type: Microsoft.SqlServer.Management.Sdk.Sfc.EnumeratorException
        Message:
            Failed to retrieve data for this request.
        Data:
          HelpLink.ProdName = Microsoft SQL Server
          HelpLink.BaseHelpUrl = http://go.microsoft.com/fwlink
          HelpLink.LinkId = 20476
          HelpLink.EvtType = 0x48BB60BC@0xBB814387
          DisableWatson = true
        Stack:
            at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.ProcessDTbl(DataTable dt, Int32 level)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.ProcessDTbl(DataTable dt, Int32 level)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.CollectSqlDiscoveryData(String machineName)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.CollectDiscoveryData(String machineName)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.LoadData(IEnumerable`1 machineNames, String discoveryDocRootPath, String clusterDiscoveryDocRootPath)
            at Microsoft.SqlServer.Configuration.SetupExtension.RunDiscoveryAction.ExecuteAction(String actionId)
            at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
            at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(TextWriter statusStream, ISequencedAction actionToRun, ServiceContainer context)
        Inner exception type: Microsoft.SqlServer.Configuration.Sco.ScoException
            Message:
                    Attempted to perform an unauthorized operation.
            HResult : 0x84bb0001
                    FacilityCode : 1211 (4bb)
                    ErrorCode : 1 (0001)
            Data:
              WatsonData = HKEY_LOCAL_MACHINE@SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\Setup
            Stack:
                    at Microsoft.SqlServer.Configuration.Sco.InternalRegistryKey.OpenSubKey(String subkey, RegistryAccess requestedAccess)
                    at Microsoft.SqlServer.Configuration.Sco.SqlRegistryKey.OpenSubKey(String subkey, RegistryAccess requestedAccess)
                    at Microsoft.SqlServer.Discovery.DiscoveryUtils.GetLocalMachineSubKey(ServiceContainer ctx, String machineName, RegistryView regView, String regPath, RegistryAccess registryAccess)
                    at Microsoft.SqlServer.Discovery.DiscoveryEnumObject.GetInstanceMapObject(String machineName, RegistryView registryView, String instanceId, String instanceName, String
    instanceType, String instanceSuffix, UpgradedInstanceStateEnum instanceState)
                    at Microsoft.SqlServer.Discovery.DiscoveryEnumObject.GetInstanceMapCollectionInHive(String machineName, RegistryView regView, List`1 subKeys)
                    at Microsoft.SqlServer.Discovery.DiscoveryEnumObject.GetInstanceMapCollection()
                    at Microsoft.SqlServer.Discovery.Instance.GetData(EnumResult erParent)
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData()
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData(Request req, Object ci)
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object connectionInfo, Request request)
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)
            Inner exception type: System.UnauthorizedAccessException
                Message:
                            Attempted to perform an unauthorized operation.
                Stack:
                            at Microsoft.SqlServer.Configuration.Sco.InternalRegistryKey.OpenSubKey(String subkey, RegistryAccess requestedAccess)

  • Standalone SQL Server monitoring with Solution Manager

    Hi,
    We have a Solman 3.1 instance monitoring all of our SAP and non-SAP Infrastructure.  We have several SQL Server systems we would like to monitor.
    Currently we have installed saposcol and sapccms agents on the servers and are getting the OS alerts and additionally have also configured Process and Log file monitoring.  We would now like to get SQL Server specific alerts like Log full alerts and other db specific alert situations.  Since this is a standalone db, how can we configure this db to report these type of alerts?
    thanks,
    binoy.

    Binoy,
    If I remember correctly I had this setup @ Sharp for oracle. You can use the same step to monitor the SQL DB liek transaction logs, backup etc's. If you can run the report RSDBMON0 this will build the <DB monitoring Tree> on the solman. So you can setup the autoreaction for the respective monitoring segment which you wanted.
    Let me know if any questions.
    Ashwin

  • Help!  SQL Server to Oracle 10.1.0.2

    Hello! I need your help.
    I need to migrate SQL Server 2000 to Oracle 10g on HP-UX.
    I read the SQL Developer documentation, but it only seems to be available for Windows, MacOS, and Linux.
    Is there one available for Unix?
    Thank you in advance,
    si

    As user502130 indicates, you don't have to run sqldev on the database server itself; any Linux/Windows/Mac client will do.
    Nevertheless, if you can install a JDK on Unix, you can install the platform independent sqldev.
    Have fun,
    K.

  • Connect Oracle Database with help of sql server storedprocedure

    Hii,
              Is there Any way to connect Oracle Database Using sql server storedprocedure.I want access oracle database and take some data and insert into my sql server database.so is there any way to connect in one
    stored procedure to connect oracle database and take some data and insert in to my sql server database.
    Nikunj Nandaniya

    Hello,
    I am getting below error when i kust Clic k on Test Connection in SSMS:
    TITLE: Microsoft SQL Server Management Studio
    The test connection to the linked server failed.
    ADDITIONAL INFORMATION:
    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
    Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server "test".
    OLE DB provider "OraOLEDB.Oracle" for linked server "test" returned message "ORA-12154: TNS:could not resolve the connect identifier specified". (Microsoft SQL Server, Error: 7303)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.4000&EvtSrc=MSSQLServer&EvtID=7303&LinkId=20476
    BUTTONS:
    OK
    Can you please guide is there any other setting i need to do after install Oracle Client ?
    Best Regards,
    Tushar Malvi

  • SQL Server monitoring with 12c Grid control

    Dear Gurus
    I want to add my sql server databases in 12c Grid control. for this i have deployed the sql server plugin in 12c grid control but i am unable to add the sql server databases/ servers in 12c grid control.
    Could you please help me in deploying the sql server servers in 12c grid control.
    Thanks & Regards,
    Satish Kumar Sadhu

    Dear Jan,
    Already I have added the plugin but while adding the target i am getting below error. Can u please give some idea on this
    Test Connection failed: [_WinAuthDLLToLoadDynamicProp;em_error=DLL file 'D:\12c_agent\plugins\oracle.em.smss.agent.plugin_12.1.0.2.0\scripts\emx\microsoft_sqlserver_database..\..\..\..\dependencies\oracle.em.smss\jdbcdriver\sqljdbc_auth.dll' is found missing or not was never copied manually. Please copy amd64 version of sqljdbc_auth.dll at the above location and re-try, MSSQL_NumClusterNodes;Can't resolve a non-optional query descriptor property [dllFile] (dllFile), WbemRemote_Determination_DynamicProperty;Can't resolve a non-optional query descriptor property [dllFile] (dllFile), MSSQLInstance_TestMetric_DynamicProperty;Can't resolve a non-optional query descriptor property [dllFile] (dllFile), OSType_TargetHost_DynamicProperty;Can't resolve a non-optional query descriptor property [STDINWBEM_HOST] (ms_sqlserver_host), MSSQL_NumClusterNodes;Can't resolve a non-optional query descriptor property [dllFile] (dllFile)]

  • Need Help on SQL Server 2008r2 Transnational replication error (21854)‏

    Could not add new article to publication 'productiondb' because of active schema change activities or a snapshot is being generated.
    Changed database context to 'productiondb'. (Microsoft SQL Server, Error: 21854)

    When this error occurs it usually means there's some underlying schema changes taking place when you're trying to add a new article
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Help on SQL server

    Can someone help me get started on building a process that will retrieve a recordset
    from a SQL Server 2000 database, loop thru it comparing it to another database
    and if a coresponding entry is found update it or if not insert it.
    I think I have the process defined but I don't know (to dumb mabey) how to use
    the database controls.

    You need to define a SQLConnection Pool and a datasource.
    As in
    <JDBCConnectionPool DriverName="weblogic.jdbc.mssqlserver4.Driver"
    InitialCapacity="5" MaxCapacity="10" Name="mySQLPool"
    Properties="user=username;password=password;server=mydatabase@myserver:1433"
    Targets="wlserver" URL="jdbc:weblogic:mssqlserver4"/>
    and
    <JDBCDataSource JNDIName="myDatasource" Name="myDatasource"
    PoolName="mySQLPool" Targets="wlserver"/>
    Substitute in correct info for mydatabase, myserver, and targets. if you
    don't know how to do this, post a follow up.
    From here you just get a connection from the connection pool. I create a
    base abstract class which I extend in all my dao classes,
    public static Connection getCon() throws NamingException, SQLException
    return ((DataSource) new
    InitialContext().lookup("pdsDatasource")).getConnection();
    Then, any class that extends your base abstract class needs this:
    Connection con=null;
    CallableStatement cs=null;
    ResultSet rs=null;
    try
    con=getCon();
    cs=con.prepareCall("{call NAME_OF_STORED_PROC_OR_SQL_QUERY(?,?)}");
    cs.setString(1, "somevalue");
    cs.setString(2, "someotherValue");
    rs=cs.executeQuery();
    This gives you a resultSet. If you are proficient in .NET and SQL, don't
    confuse a resultSet with a RecordSet.
    They are totally different. A resultSet is merely a pointer. Typcilly you
    iterate through and build a collection of
    model objects or apply some other technique to return the data to the
    business layer.
    In many cases, data replication can be done linking SQL Servers together,
    using linkserver and writing stored procs
    that run under jobs. You may consider doing this instead of having a java
    app in WebLogic do it.
    HTH

  • Help with SQL Server 2005 http Endpoint

    I am trying to use mx:webservice to directly connect to a SQL
    Server 2005 HTTP Endpoint. Is this possible. Is there going to be a
    problem with crossdomain issues? If the Endpoint is actively
    listening on port 80 then IIS cannot. So I cannot place
    crossdomain.xml in webserver, how will I overcome this crossdomain
    problem? Am I making this more complicated than it is? If anyone
    has an example it would be appreciated. All I want is a flex2 app
    talking directly to sql server. Seems possible.

    Kent, I see that many others have reported that error (doing
    a google search), but I see no ready answers. I saw something that
    reminded me of a connection string value that I've seen answer some
    problems. May be worth a shot for you: try adding this string to
    the connection string (in "advanced options") for your datasource:
    AuthenticationMethod=Type2
    If it doesn't solve it, remove it. But keep it handy in case
    it ever may help with some other problem.
    Here's one other possible answer for you:
    http://www.webmasterkb.com/Uwe/Forum.aspx/coldfusion-server/3206/SQL-Server-2000-Windows-A uth
    Sorry I can't be more clear for you.

  • Need help installing sql server 2012 on windows server 2012 core

    Hi Guys 
    I am having trouble installing sql server 2012 on windows server 2012 core. I am doing this on VM and my VM is not connected to internet. 
    This setup is part of preparing lab for sql serve exam 70-462. I would really appreciate your help.
    I am including the links to the log files that were generated after installation. There are following 2 files
    Component Update and
    Detail_Global_Rules
    Thanks

    Hi
    iworkonline,
    Regarding to your original question, you can work around it according to Prashanth’s post or unclick the “Include SQL Server Product Updates" checkbox when installing SQL Server on your VM.
    Regarding to your second question, I make a test using TechNet Virtual Lab and everything works as expected . Below are my steps.
    1. Choose Web client after laughing the Lab.
    2. Choose SQLONE machine and “OPEN CHARMS” as follows, then search SQL Server Management Studio, use it to connect to the default instance (which has been installed in the lab).
    From your description, you get error message “Device not ready”. Could you please post more details? Are you installing SQL Server 2012 on the TechNet Virtual Lab?
    Thanks,
    Lydia Zhang
    If you have any feedback on our support, please click
    here.
    Lydia Zhang
    TechNet Community Support

  • Pls help me(sql server problem)

    Im using sql server 2000
    i had 2 database servers
    'srv1', 'srv2'
    in srv1 had 'db1' database
    first create a user called 'db1usr1' with read and write previlages only(not dbowner)
    then take backup of 'db1' as 'db1bakup'
    then u hav to restore the 'db1bakup' in srv2 as 'db2'
    then u have 2 login in the 'srv2' machine as 'db1usr1'
    here is the problem : it is(db1usr1) not logged in srv2 machine through query analyser

    You're asking about a sql server problem on an Oracle forum?
    Don't you think a sql server forum would be a more appropriate place for your question?

Maybe you are looking for