Logs for sql server agent restart

Hi,
  Can I get log on the sql server agent  restart history of week. I mean the sql server agent has been restarted several times in last week I want to know the date and time when the sql server agent restarted in that week. Is it possible to get
the info?
Thanks in advance,
Pavan
Pavan

In addition to Uri's post, here is some more information that might help you:
SQLAGENT.OUT, the log file for SQL Agent. SQL Server Agent can maintain up to 10 Error Logs files. The currently used SQL Server Agent Error Log will be named SQLAGENT.OUT
where is the SQLAGENT.OUT file?
C:\Program Files\Microsoft SQL Server\MSSQL11.SQL2012\MSSQL\Log\
What will be when a new file create?
The old file should get a name like SQLAGENT.X and the new file get the name SQLAGENT.OUT (X is numbers 1-9)
This can help you to get more information on sql agent properties (like the location of the log file, the user that start the service and more):
EXEC msdb..sp_get_sqlagent_properties
[Personal Site] [Blog] [Facebook]

Similar Messages

  • Database Mail Fails For SQL Server Agent Jobs / Maintenace plans - Why ?

    Database Mail Fails For SQL Server Agent Jobs / Maintenace plans - Why ?
    This has been a very common question I have seen relatedt to Database mail and I thought will post here so if you run into this issue, it could be due to one of the following and also have mentioned below how to get around them. Bottom line is datbase mail works fine with SQL Agent jobs and maintenace plans in SP1 on all platforms.
    1. If you see this on 64 bit platform and on RTM build, this is a bug that is addressed in SP1.
    2. If you see the below error message, it is known issue and this is because of design that requires SQL Agent to restart, if SQL Agent was started before enabling databasemail and setting a new profile. We are evaluating to change this design of not requiring to restart agent for our future release.
    Re: 264] An attempt was made to send an email when no email session has been established
    This problem will go away after restarting SQL Server Agent in this case. Thanks,
    Gops Dwarak, MSFT

    This may be related to the fact that DBMail, by default, shuts itself down after 10 minutes of inactivty.  If the mail service isn't running, you won't be able to queue up any mail messages.
    There may be a built-in mechanism for addressing this problem, but I found that I can detect this situation and start the mail listener before sending db mail.  I use the following in stored procs that need to send email.
    You could increase the inactivity period for db mail shutdown from 600 seconds to some larger value.  It might not make sense to do so, since shutting it down releases its resources back to teh system; if your SQL server only sneds mail infrequently, it might be better to start the mail listener on demand.  Someone with more experience than I might want to add their two cents' worth.  :-)
    /* Check the mail engine. Start the service if is is stopped         */
    /* -- the DB Mail engine shuts down after 10 minutes (of inactivity) */
    /* -- this setting can be changed, but we probably don't need to.    */
    DECLARE @rc INT
    IF NOT EXISTS (SELECT * FROM msdb.sys.service_queues
                   WHERE name = N'ExternalMailQueue' AND is_receive_enabled = 1)
        EXEC @rc = msdb.dbo.sysmail_start_sp
        -- TODO: add handling and logging for any engine start issues

  • What would be the reason for sql server agent [MSSQLSERVER] service terminated unexpectedly?

    What would be the reason for sql server agent [MSSQLSERVER] service terminated unexpectedly?
    only below details found in error log
    07:26:44.170 spid60      
    FILESTREAM: effective level = 3, configured level = 3, file system access share name = 'MSSQLSERVER'.
    07:26:45.720 spid51      
    Configuration option 'Agent XPs' changed from 0 to 1. Run the RECONFIGURE statement to install.
    07:26:45.730 spid51      
    FILESTREAM: effective level = 3, configured level = 3, file system access share name = 'MSSQLSERVER'.
    07:28:57.840 spid64      
    Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install.
    07:28:57.840 spid64      
    FILESTREAM: effective level = 3, configured level = 3, file system access share name = 'MSSQLSERVER'.
    and below error on agent log
    2014-01-01 07:26:28 - ? [131] SQLSERVERAGENT service stopping due to a stop request from a user, process, or the OS...
    2014-01-01 07:26:43 - + [188] Scheduler engine timed out (after 15 seconds) waiting for 1 jobs(s) to stop
    2014-01-01 07:26:44 - + [098] SQLServerAgent terminated (forcefully)
    Rahul

    What would be the reason for sql server agent [MSSQLSERVER] service terminated unexpectedly?
    only below details found in error log
    07:26:44.170 spid60      
    FILESTREAM: effective level = 3, configured level = 3, file system access share name = 'MSSQLSERVER'.
    07:26:45.720 spid51      
    Configuration option 'Agent XPs' changed from 0 to 1. Run the RECONFIGURE statement to install.
    07:26:45.730 spid51      
    FILESTREAM: effective level = 3, configured level = 3, file system access share name = 'MSSQLSERVER'.
    07:28:57.840 spid64      
    Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install.
    07:28:57.840 spid64      
    FILESTREAM: effective level = 3, configured level = 3, file system access share name = 'MSSQLSERVER'.
    and below error on agent log
    2014-01-01 07:26:28 - ? [131] SQLSERVERAGENT service stopping due to a stop request from a user, process, or the OS...
    2014-01-01 07:26:43 - + [188] Scheduler engine timed out (after 15 seconds) waiting for 1 jobs(s) to stop
    2014-01-01 07:26:44 - + [098] SQLServerAgent terminated (forcefully)
    Rahul
    Can you post the output of below query
    select @@version.
    If you are using SQl server express edition ,SQL server agent feature is not available.It seems from errorlog that you can start it but actually you cannot.But first confirm what is version and edition of your SQL server
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Service Account for SQL Server Agent on SQL Server 2008 R2

    This SQL Server instance is SQL Server 2008 R2 (10.50.4000).  We had Active Domain Service accounts created to run the service accounts for SQL Server and SQL Server Agent.
    It has become company policy to alter the service accounts that run SQL Server and SQL Server Agent.  Currently, both were running under the Local System Accounts.  We have altered the SQL Server but we are having issues with the SQL Server Agent. 
    I am told by another DBA that
    "The agent is requiring elevated rights.  It will startup if it has local admin rights, but not with domain accounts without admin rights."
    So I was wondering if anyone has come across this issue and how did they resolve it.
    lcerni

    "The agent is requiring elevated rights.  It will startup if it has local admin rights, but not with domain accounts without admin rights."
    This is completely not true. It is indeed possible to run agent as a domain account without giving it local admin. Chances are you'll need to update the local acls by adding the account to the local security groups. Please see this article for more information:
    http://technet.microsoft.com/en-us/library/ms143504(v=sql.105).aspx
    Edit: In addition, it'll need rights to SQL server for that account to connect and do its work. It will need to be given sysadmin:
    http://technet.microsoft.com/en-us/library/ms191543.aspx
    Sean Gallardy | Blog |
    Twitter

  • Using the SQL Server Agent for the first time

    I have set up several jobs to run automatically throughout the day. Each job just does one thing: executes an SSIS package.
    The packages themselves run perfect when I test them in Visual Studio 2005, but when the SQL Server Agent tries to run the job I am getting failed jobs.
    Is there any tutorials or walkthroughs that can teach my about using the SQL Server Agent? If I wanted extensive help troubleshooting my SQL Server Agent problems which part of the message boards would I post that too?
    Thanks for the info!

    Anyone?
    I really need some resources for SQL Server Agent 2005.
    Refer these links,
    http://technet.microsoft.com/en-us/library/ms141701(v=sql.90).aspx
    http://stackoverflow.com/questions/10489392/permissions-issue-running-ssis-package-from-sql-job
    Regards, RSingh

  • Permissions needed for sql server job to execute stored procedure on linked server?

    Hi all
    I have a job step which attempts to call a stored procedure on a linked server.
    This step is failing with a permission denied error. How can I debug or resolve this?
    The job owner is sysadmin on both servers so should have execute permission to the database/proc I'm calling, right?
    The error is:
    The EXECUTE permission was denied on the object 'myProc', database 'myDatabase', schema 'dbo'. [SQLSTATE 42000] (Error 229).  The step failed.
    My code is:
    EXEC [LinkedServer].myDatabase.dbo.myProc
    Also tried:
    SELECT * FROM OPENQUERY([LinkedServer], 'SET FMTONLY OFF EXEC myDatabase.dbo.myProc')
    With the same result.
    Any help appreciated.

    The job owner may be sysadmin on the remote server. The service account for SQL Server Agent may not. And it is the latter that counts, since the it the service accounts that logs in and impersonates the job owner. But the impersonation inside SQL Server
    does not count much in Windows, and it is through Windows connection is made to the other site.
    One way to resolve this is to set up a login mapping for the job owner. The login mapping must be for an SQL login on the remote server.
    You can verify the theory, but running this query from the job:
       SELECT * FROM OPENQUERY([LinkedServer], 'SELECT SYSTEM_USER')
    By the way, putting SET FMTONLY OFF in OPENQUERY is a terrible idea. This has the effect that the procedure is executed twice. (Unless both servers are SQL 2012 or higher in which case FMTONLY has no effect at all.)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Replication stopp after change changing SQL Server Agent User

    Hi,
    I tryed to change the user for SQL Server Agent on my Distributor. We use pushed transaction replications. But after i changed the user, all replications stopped:
    ERROR: (from SQL Monitor)
    The job failed.  The Job was invoked by Start Sequence 0.  The last step to run was step 3 (Detect nonlogged agent shutdown.).
    The new user is a domainusert too, and had administrative rights on the server. I changed the user to start SQL Server Agent on other servers without error.
    Can anybody tell me, how to change the user on a distributor, without stopping all replications?
    Thanks
    Kind regards,
    Andreas

    Hi Andreas,
    You are likely running into a permissions issue.
    Verify the Log Reader Agent process account is db_owner in the distribution database and that the account used to connect to the Publisher is db_owner in the publication database.
    Verify the Distribution Agent process account is db_owner in the distribution and subscription databases, is a member of the PAL, and has read permissions on the snapshot share.
    This is covered in
    Replication Agent Security Model.
    Brandon Williams (blog |
    linkedin)

  • If I resize job history log to see more entries listed under job history, will cause sql server agent to restart or any downtime?

    Here is I am going to do:
    Using SQL Server Management Studio
    To resize the job history log based on raw size
    In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
    Right-click SQL Server Agent, and then click Properties.
    Select the History page, and then confirm that Limit size of job history logis checked.
    In the Maximum job history log size box, enter the maximum number of rows the job history log should allow.
    In the Maximum job history rows per job box, enter the maximum number of job history rows to allow for a job.

    this change does not require SQL agent restart
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • SQL Server Agent Log showing errors [298] SQLServer Error: 10061, A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL

    Hi All,
    I have started receiving this error in the logs for the last 10 days and the Schedules Jobs for the database have stopped running. My MS CRM application is working fine.
    Can anyone guide me what could be the problem.
    Date                      17/4/2014 2:04:20 PM
    Log                         SQL Server Agent (Current - 17/4/2014 2:01:00 PM)
    Message
    [298] SQLServer Error: 10061,
    A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct
    and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [SQLSTATE 08001]
    Date                      17/4/2014 2:11:55 PM
    Log                         SQL Server Agent (Current - 17/4/2014 2:01:00 PM)
    Message
    [298] SQLServer Error: 10061,
    A network-related or instance-specific error
    has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information
    see SQL Server Books Online. [SQLSTATE 08001]
    Date                      7/4/2014 11:00:31 AM
    Log                         SQL Server Agent (Current - 17/4/2014 2:01:00 PM)
    Message
    [298] SQLServer Error: 10061,
    A network-related or instance-specific error
    has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information
    see SQL Server Books Online. [SQLSTATE 08001]

    Check this link
    http://social.msdn.microsoft.com/Forums/en-US/906da9b5-2482-468c-a424-ae099da2d96b/sql-server-agent-service-account-error?forum=sqlsetupandupgrade
    Regards, RSingh

  • Error logging when running SSIS on SQL Server Agent

    I have SSIS package running on SQL Server Agent Job.
    When I'm running it, I get error and I'm urget to see History Logs.
    When look Error logs in SQL Server Object Explorer, I don't find errors on this day.
    Where should I look for error messages related to SSIS. Any thing to be configured on Management Studio or Data Tool?
    Kenny_I

    Hi Kenny_I,
    As Russ posted, you need to expand the toggle to see the detailed information when viewing the Job history. Please see the screenshot below:
    Besides, you can also edit the Job step, and switch to the Advanced tab to specify a job output file to log the detailed package execution failure information. The screenshot is for your reference:
    Regards,
    Mike Yin
    If you have any feedback on our support, please click here<o:p></o:p>
    Mike Yin
    TechNet Community Support

  • Cannot restart SQL Server Agent - SQL Server 2008 Express

    Hi
    I don't know if this affected it but we had a auto notification to change our work passwords the other day, I then couldn't get my local SQL express to logon using domain login.
    I then went into SQL Server Config Mgr. and both SQL Server Express and SQL Server Agent were stopped. I tried to restart but no luck, so went into properties of SQL Server Express and remapped my domain name (domain\name) and new password and it started,
    but agent will not start.I also checked log paths in registry match my log paths in system and went to:
    C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL
    Where a few of the folders I didn't have permission but it asked me to confirm I want permission when I dbl clicked on them.
    When I try to start agent I get error:
    the request failed or the service did not respond in a timely fashion
    Whatever that means I don't really know.
    Here is contents of SQL Agent file from log:
    2014-06-11 10:05:56 - ? [100] Microsoft SQLServerAgent version 10.0.1600.22 (x86 unicode retail build) : Process ID 2756
    2014-06-11 10:05:56 - ? [101] SQL Server DC102084\SQLEXPRESS version 10.00.1600 (0 connection limit)
    2014-06-11 10:05:56 - ? [102] SQL Server ODBC driver version 10.00.1600
    2014-06-11 10:05:56 - ? [103] NetLib being used by driver is DBNETLIB.DLL; Local host server is XXXXXXXX\SQLEXPRESS
    2014-06-11 10:05:56 - ? [310] 2 processor(s) and 1931 MB RAM detected
    2014-06-11 10:05:56 - ? [339] Local computer is XXXXXXXX running Windows NT 6.1 (7601) Service Pack 1
    2014-06-11 10:05:56 - ! [000] This installation of SQL Server Agent is disabled.  The edition of SQL Server that installed this service does not support SQL Server Agent.
    2014-06-11 10:05:56 - ? [098] SQLServerAgent terminated (normally)
    And some details from Error log:
    2014-06-11 09:55:49.11 spid51      Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install.
    2014-06-11 09:55:49.11 spid51      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'SQLEXPRESS'.
    2014-06-11 09:57:49.15 spid51      Configuration option 'Agent XPs' changed from 0 to 1. Run the RECONFIGURE statement to install.
    2014-06-11 09:57:49.15 spid51      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'SQLEXPRESS'.
    2014-06-11 09:57:49.19 spid51      Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install.
    2014-06-11 09:57:49.19 spid51      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'SQLEXPRESS'.
    2014-06-11 10:05:56.09 spid51      Configuration option 'Agent XPs' changed from 0 to 1. Run the RECONFIGURE statement to install.
    2014-06-11 10:05:56.09 spid51      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'SQLEXPRESS'.
    2014-06-11 10:05:56.23 spid51      Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install.
    2014-06-11 10:05:56.23 spid51      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'SQLEXPRESS'.
    Any suggestions would be warmly welcomed
    Many thanks
    Andrew

    SQL Server Express and SQL Server Agent were stopped
    Hello Andrew,
    With SQL Server 2008 Express the "SQL Server Agent" is installed as well, but it's not a supported Feature of the Express Edition, therefore you can't start / use the Agent.
    See
    Features Supported by the Editions of SQL Server 2008 => "Management Tools" => SQL Server Agent
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Resisting the creation of new log files when SQL SERVER is restarted

    Hi,
    I know that when SQL server is restarted new log files are created. But is it possible to resist creating new log fils and insert log data in the existing log files that are used before restarting the sql server

    Hello,
    I guess Raghvendra answered your question. And as per your previous post its not clear what you want to ask an you did not revert. Again if your issue is solved appreciate if you can please mark the answer and vote the posts helpful.
     Can I continue to log in the same file.?
    What does this line mean exactly ? Yes SQL Server will continue to use same transaction log file(LDF file) for writing information as it was using before shutdown. If you are talking about errorlog file a new errorlog file would be created which you can
    read using
    sp_readerrorlog
    Even if you stopped SQL Server service mistakenly its not that server is gone. Yes when you stopped the server all inflight transactions are rolled back. And when SQL Server would come online it would undergo crash recovery and would bring all the databases
    online by reading transaction log file and performing redo and undo of information. All committed transaction would be rolled forward and uncommitted would be rolled back.
    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

  • Reporting Services 2012 for SharePoint and SQL Server Agent "Subscriptions and Alerts"

    After installing Reporting Services for SharePoint (Denali) in my test farm, I'm trying to configure the "SQL Server Agent" access for Reporting Services.  From Central Admin I'm going to the Reporting Service applicaiton configuration screen and selecting
    "Provision Subscriptions and Alerts".  I've tried both options on this screen.  I've manually executed the "download sql script" in SQL Server, as well as entering a user with SQL sys admin rights on the SQL server into the login fields on the screen. 
    The role and permissions have been created for the application pool service account, but Reporting Services is still trying to connect with the annonymous login because I'm getting the following alert each time I open the "Provision Subscriptions and Alerts"
    screen:
    Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'
    The "status" on the screen still shows "SQL Server Agent State cannot be determined".  Has anyone else seen this? 
    Thanks!!

    Thanks for your reply!
    1) Looks like the new Reporting Services does not run as a Windows Service so it's not listed in the "Configure Service Accounts" pulldown.  As a result, I don't see how to set the service account.  It's only assigned to an application pool. 
    I installed it into an existing application pool and that application pool "is" in the list and has a domain service account already assigned.
    2) Which users need to be in here in order to configure the "Provision Subscriptions and Alerts" screen?  I already have the farm admin account which is the account I use when running Central Admin.
    3) As mentioned in #1, I've installed Reporting Services into an existing application pool with other service apps.
    4) This link is for Reporting Services 2008 R2 which is very different install process.  But I did follow the SQL Server Reporting Services 2012 RC0 installation instructions and the Reporting Services is functioning correctly with no errors. 
    I'm just not able to configure the sceduling the alerting with interfaces with the SQL Server Agent.
    Thanks!

  • Unable to view SQL Server Agent while logged in as user

    Hello Everyone,
    I have granted SQLAgentUserRole permission to one of the user and using enterprise edition of SSMS. still user is not able to view SQL Server Agent. Any help will be greatly appriciated.

    There is no Enterprise Edition of SSMS. There is SSMS Basic and SSMS Complete. Prior to 2012 sp1, only SSMS Basic were available with Express Edition - but as of 2012 sp1 Expredd also offers SSMS Complete. SSMS Complete is selected bu default when you install
    SSMS (unless you are prior to 2012 sp1 and are using Express, of course).
    However, even SSMS Basic *should* show Agent assuming you have permissions for that. This is hearsay, but from trusted sources. Here is what to do:
    Check what is installed for the machine from where you are running SSMS. You can do that using SQL Server Installation Center - see this blog post: http://sqlblog.com/blogs/tibor_karaszi/archive/2011/02/10/what-does-this-express-edition-look-like-anyhow.aspx
     (towards the end).
    On that machine try both this problematic account as well as an account which is sysadmin. Does the sysadmin account see Agent? If so, you know permissions aren't granted properly. If not, then you know the tool is the problme.
    Also try the problematic account from a machine where you know you see Agent normally. Again, this will help you assess whether the problem is the tool (SSMS) or permissions for the account.
    Tibor Karaszi, SQL Server MVP |
    web | blog

  • SQL Server Agent Jobs error for Slowly changing dimension

    Hi,
    I have implemented Slowly changing dimension in 5 of my packages for lookup insert/update.
    All the packages are running good in SSDT. And when i deployed the project to SSISDB and run the packages all are running successfully. But when i created a job out of that and run the packages, then 3 packages ran successfully and 2 packages failed. 
    When i opened All Execution Report. I found the following error:
    Message
    Message Source Name
    Subcomponent Name
    Process Provider:Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description:
    "Login timeout expired". An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "A network-related or instance-specific error has occurred while establishing
    a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.". An OLE DB record is available. 
    Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Named Pipes Provider: Could not open a connection to SQL Server [53]. ".
    Process Provider
    Slowly Changing Dimension [212]
    Then i opened Provider package in SSDT and changed the source reading record limit from 4,00,000 to 15,000 in source query and deployed again and run, then the job succeeded. more than 15,000 failed.
    And in the 2nd experiment, I removed slowly changing dimension task and implemented normal lookup for insert/update, and set the source reading limit again to 4,00,000 and deployed again and run, then the job succeeded.
    Now i am not able to figure out, what exactly is the problem with Slowly changing dimension task for more than 15,00 records in SQL Server  Agent Job run?
    Can anybody pls help me out.
    Thanks
    Bikram

    Hi Vikash,
    As i have mentioned in the above post, below 2 scenarios: 
    "Then i opened Provider package in SSDT and changed the source reading record limit from 4,00,000 to 15,000 in source
    query and deployed again and run, then the job succeeded. more than 15,000 failed.
    And in the 2nd experiment, I removed slowly changing dimension task and implemented normal lookup for insert/update, and set the source reading limit again to 4,00,000 and deployed again and run, then the job succeeded."
    That means i am able to connect to sql server.
    But if i change the 1st scenario and read 4,00,000 records, the job fails and shows the above mentioned error.
    Similarly in the 2nd scenario, if i implement SCD look up,  the job fails and shows the above mentioned error.
    And i am consistently reproducing this.
    Thanks
    Bikram

Maybe you are looking for