Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql server newbie, needs help, sqlagent won't stay running

Status
Not open for further replies.

bfordz

Technical User
Nov 18, 2008
91
US
We have an Avaya phone system with Call Accounting software running on a Windows 7 embedded PC.
TapitNova collects the calls and uses SQL Server to managed the database and create the reports from.

Here's my issue; Last month my UPS batteries failed so my whole system shut down.
Since then my TapitNova hasn't created any Call reports, I've narrowed it down to the SQL Server Agent won't stay running.(?)

If I try and start the SQL Server Agent(TAPITNOVADB), I get the following popup message:
The SQL Server Agent (TAPITNOVADB) service on Local Computer started and then stopped.
Some services stop automatically if they are not in use by other services or programs.

If I look in the Windows Logs > Application I see this:
ERROR SQLAGENT$TAPITNOVADB 103 Service Control
SQLServerAgent could not be started (reason: Error creating a new session)
EventID: 103

If I "stop" the SQL Server (TAPITNOVADB) first, then start SQL Server Agent (TAPITNOVADB), they both startup without any popup error; but a quick refresh of the Services window shows the SQL Server Agent "not running". So, it stops immediately after starting.

I'm thinking maybe the sudden shutdown from loss of power has corrupted something?

Could someone give me some insight where to go or what to do next?
 
You have to try pretty hard to corrupt SQL Server.... even with a power outage.

I suggest you take a look at the "log on" tab in the services property.

If I was a betting man, I would say that you are using an active directory account for the service and that the AD account no longer exists or it's password was changed (possibly a really long time ago).

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
We don't use AD but the "Log on"; Network Service, I don't know what that password should be.
 
Try "local system". See if that works.



-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
I looked at the SQL Services; this is what I found
sql_server_1_ucnaol.jpg

it appears all the SQL services started by TapitNova are using "Network Service" as a Log ON, also I don't know what password is being used!

If I change the SQL Server Agent to Local Service, wouldn't I need to change the other two?
Where is the password coming from? Does it have to match somewhere else?

Thanks
 
I just spoke with someone at Tapit support and the Sql Server Agent doesn't need to be running full time or they're software doesn't require it.
So, that's not my direct issue.

I'm going to pull the box and test the HDD for possible flaws or damage due to the power outage before I go any further.
 
Judging from
(reason: Error creating a new session)

I would check on the msdb database on the instance. It may be corrupt or offline. If the msdb database is offline, any attempt to log in to that database will result in a login failure. If the login is failing for a different reason, the SQL Server ERRORLOG should show the reason for it.
 
OK, this is where I get lost with the sql server stuff;
Where do I go to check the msdb database on the instance? How would I know it's 'offline'?

In the event viewer I did find a "logon" line that had errors for the MSSQL $TAPITNOVADB.
Log Name: Application
Source: MSSQL$TAPITNOVADB
Date: 8/27/2015 4:02:13 PM
Event ID: 18456
Task Category: Logon
Level: Information
Keywords: Classic,Audit Failure
User: N/A
Computer: TAPITNOVA
Description:
Login failed for user 'tapit_dba'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]

My next problem I don't see nor can I find a user 'tapit_dba'.
 
The user Tapit_DBA would be a user defined in SQL Server. Use SQL Server Management Studio to have a look in SQL Server to see if the MSDB database is online. Also, look at the Tapit_DBA login to see what his default database is (you should perhaps reset it to msdb).

Also have a look at the Services applet to see what user the SQL Agent service is trying to run as.
 
Sorry, I'm not familiar with SQL Server;
I've included some screen shots of my SQL Server Management Studio.

sql_tapit_dba_1_rsg1sj.jpg


I looked at the Tapit_DBA login and all the others for comparison and they are all set to 'master'; if I'm looking in the right spot.

Also, SQL Agent service is trying to run as / Logon as Network Service.

sql_services_uw54zy.jpg


 
 http://files.engineering.com/getfile.aspx?folder=bc57afd6-cc78-4808-b559-0c4b7766e57a&file=sql_tapit_dba_1.jpg
In the Login Properties window, click on User Mappings. Scroll down to MSDB. What permissions does that user have for MSDB?

-SQLBill


The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
the only thing is "public", under Database role membership for: msdb
 
try this....change the default database to MSDB, then grant it db_datareader. See if that helps.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
SQLBill,
I tried as you suggested and that hasn't helped.
 
Okay, let's get back to the main issue....SQL Server Agent not running.

Right click on SQL Server Agent. Select Properties. Is "Auto restart SQL Server Agent if it stops unexpectedly" checked or unchecked?
If it is unchecked, try checking it. Also, that screen will give you the path to the agent error log...check out the logs to see if you can tell why it is shutting down.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top