Showing posts with label restarting. Show all posts
Showing posts with label restarting. Show all posts

Wednesday, March 21, 2012

MSSQLService (MSDE) Not Re-Configured correctly

Hi all,

I have a question regarding restarting MS SQL Service under a different user, in other words, re-starting MSSQLService as a "Log on as" user instead of "Local System" account. By default MSSQLService starts as a local system account.

Now my problem is, that I install MSDE 2000 for my application. And I install it as a seperate instance with name "MyInstance". So after Install my service is called MSSQL$MyInstance.

so my process basically creates an NT user on the machine with administartors rights, stops the service, change the service configuration to my NT user account credentials and then starts it using scm. The whole process works fine on my machine running Win XP Pro v.2002 SP1. But it fails to work on Win XP Pro v2002 SP2.

on SP2 machine, service gets reconfigured because I can see the Log on as account being changed from Local System to MyNTUser. But when I try to start it every time error is "Log on failure". But when I go to service properties and change the Password to my NT users password service starts properly.

So i'm not sure what exactly is going on, because if reconfiguration process works for my machine, typically it should work on SP2 machine as well, as the notes on ChangeServiceConfig winapi method(requires Advapi32.dll) suggests that it will work for XP, NT and win 2002.

Does anyone has any idea why is that.

Code Snippets:

Create User:


DirectoryEntry AD = new DirectoryEntry("WinNT://" + machineName + ", computer");
DirectoryEntry newUser;
try {
newUser = AD.Children.Find(userName, "user");
DeleteNTUserAccount(userName);
newUser = AD.Children.Add(userName, "user");
}

catch (Exception) {
newUser = AD.Children.Add(userName, "user");
}
newUser.Invoke("Put", new object[] {"Description", userDescription});
newUser.Invoke("SetPassword", new object[] {userPWD});
newUser.CommitChanges();
DirectoryEntry group;
group = AD.Children.Find("Administrators", "group");
if (group != null)
group.Invoke("Add", new object[] {newUser.Path.ToString()});
group.Close();
newUser.Close();
AD.Close();


Code to Stop Service:


ServiceController sc;
TimeSpan timeout = new TimeSpan(0, 0, 60);
OperatingSystem os;
os = Environment.OSVersion;
if (os.Platform != PlatformID.Win32NT) {
txtInstallInfo.Text += "\r\n\tApplication is built only for NT, 2000, XP or Later";
this.Refresh();
retVal = false;
}
os = null;
sc = new ServiceController(serviceName);
if (sc.Status == ServiceControllerStatus.Running) {
if (sc.CanStop) {
txtInstallInfo.Text += "\r\n\tRestarting the " + serviceName + " service";
this.Refresh();
sc.Stop();
try {
sc.WaitForStatus(ServiceControllerStatus.Stopped, timeout);
txtInstallInfo.Text += "\r\n\t" + serviceName + " service stopped successfully";
this.Refresh();
}

catch(TimeoutException) {
txtInstallInfo.Text += "\r\n\t" + serviceName + " service did not respond to the stop command in a timely fashion. Please Restart Installer at later time.";
this.Refresh();
retVal = false;
}
}
else {
txtInstallInfo.Text += "\r\n\t" + serviceName + " service cannot be stopped. Please Wait make sure no application is running.";
this.Refresh();
retVal = false;
}
}
else {
txtInstallInfo.Text += "\r\n\t" + serviceName + " service was not running.";
this.Refresh();
}
sc.Close();
sc = null;


Code to Re-Configure Service:


string UserName = "MyNTUser";
string UserPwd = "abc123";

int HandleToScm = OpenSCManager( null, null, ServiceControlAccessRights.AllAccess );

int HandleToSvc = OpenService( HandleToScm, ServiceName, ServiceSpecificAccessType.ChangeConfig );

if ( ChangeServiceConfig(
HandleToSvc,
ServiceControlType.OwnProcess,
ServiceStartType.AutoStart,
ServiceNoChange,
null,
null,
IntPtr.Zero,
null,
@.".\" + UserName,
UserPwd,
ServiceName ) ) {
CloseServiceHandle( HandleToSvc );
CloseServiceHandle( HandleToScm );
}


Code to Start Service:

scm -Action 1 -Service MSSQL$MyInstance -Silent 1 -SvcAccount .\MYNTUserAccount -SvcPwd MYNTAccountPassword

I've never seen this post before, yet it is dated May 2005. Bumping message...sql

Monday, March 19, 2012

MSSQLSERVER service terminated unexpectedly

I have a couple of sites that are running MS SQL 2000 Service pack 4 that are
stopping (apperantly randomly) and restarting itself. This is causing great
havoc on some of my applications that are attached to this database. The
server is dedicated for this purpose only and is hosting only on database.
reviewing the error logs have not resulted in any explanation as to why SQL
is dying. Google & MS knowledgebase has also resulted in no
explanation/solution. Any assistance would be greatly appreciated.This probably does not apply, but we had a similar problem and it had to do
with the following article:
KB article 822360
MS had us put in a couple of hot fixes and it seems to have taken care of
the problem.
"Martin Paterson" wrote:
> I have a couple of sites that are running MS SQL 2000 Service pack 4 that are
> stopping (apperantly randomly) and restarting itself. This is causing great
> havoc on some of my applications that are attached to this database. The
> server is dedicated for this purpose only and is hosting only on database.
> reviewing the error logs have not resulted in any explanation as to why SQL
> is dying. Google & MS knowledgebase has also resulted in no
> explanation/solution. Any assistance would be greatly appreciated.|||I looked at KB822360 and it appears to be for active directory issues. The
SQL server that is having this problem does not sit on a domain. thanks in
advance for your assistance.
"CLM" wrote:
> This probably does not apply, but we had a similar problem and it had to do
> with the following article:
> KB article 822360
> MS had us put in a couple of hot fixes and it seems to have taken care of
> the problem.
> "Martin Paterson" wrote:
> > I have a couple of sites that are running MS SQL 2000 Service pack 4 that are
> > stopping (apperantly randomly) and restarting itself. This is causing great
> > havoc on some of my applications that are attached to this database. The
> > server is dedicated for this purpose only and is hosting only on database.
> > reviewing the error logs have not resulted in any explanation as to why SQL
> > is dying. Google & MS knowledgebase has also resulted in no
> > explanation/solution. Any assistance would be greatly appreciated.|||What does the sql errorlog say?
Martin Paterson wrote:
> I looked at KB822360 and it appears to be for active directory issues. The
> SQL server that is having this problem does not sit on a domain. thanks in
> advance for your assistance.
> "CLM" wrote:
> > This probably does not apply, but we had a similar problem and it had to do
> > with the following article:
> > KB article 822360
> > MS had us put in a couple of hot fixes and it seems to have taken care of
> > the problem.
> >
> > "Martin Paterson" wrote:
> >
> > > I have a couple of sites that are running MS SQL 2000 Service pack 4 that are
> > > stopping (apperantly randomly) and restarting itself. This is causing great
> > > havoc on some of my applications that are attached to this database. The
> > > server is dedicated for this purpose only and is hosting only on database.
> > > reviewing the error logs have not resulted in any explanation as to why SQL
> > > is dying. Google & MS knowledgebase has also resulted in no
> > > explanation/solution. Any assistance would be greatly appreciated.|||there are no errors that I can see...but here is an example of what is
displayed:
2006-06-19 07:01:01.44 server Microsoft SQL Server 2000 - 8.00.2039
(Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)
2006-06-19 07:01:01.44 server Copyright (C) 1988-2002 Microsoft
Corporation.
2006-06-19 07:01:01.44 server All rights reserved.
2006-06-19 07:01:01.44 server Server Process ID is 2032.
2006-06-19 07:01:01.44 server Logging SQL Server messages in file
'F:\Program Files\Microsoft SQL Server\MSSQL\log\ERRORLOG'.
2006-06-19 07:01:01.46 server SQL Server is starting at priority class
'normal'(4 CPUs detected).
2006-06-19 07:01:01.57 server SQL Server configured for thread mode
processing.
2006-06-19 07:01:01.60 server Using dynamic lock allocation. [2500] Lock
Blocks, [5000] Lock Owner Blocks.
2006-06-19 07:01:02.08 server Attempting to initialize Distributed
Transaction Coordinator.
2006-06-19 07:01:05.10 spid3 Starting up database 'master'.
2006-06-19 07:01:05.24 spid3 0 transactions rolled back in database
'master' (1).
2006-06-19 07:01:05.24 spid3 Recovery is checkpointing database 'master'
(1)
2006-06-19 07:01:05.36 server Using 'SSNETLIB.DLL' version '8.0.2039'.
2006-06-19 07:01:05.36 spid5 Starting up database 'model'.
2006-06-19 07:01:05.38 spid3 Server name is 'SECDB'.
2006-06-19 07:01:05.40 spid8 Starting up database 'msdb'.
2006-06-19 07:01:05.40 spid9 Starting up database 'pubs'.
2006-06-19 07:01:05.40 spid10 Starting up database 'Northwind'.
2006-06-19 07:01:05.40 spid11 Starting up database 'SSW'.
2006-06-19 07:01:05.60 server SQL server listening on www.xxx.yyy.zzz:
1433.
2006-06-19 07:01:05.60 server SQL server listening on 127.0.0.1: 1433.
2006-06-19 07:01:05.61 spid5 Clearing tempdb database.
2006-06-19 07:01:05.85 spid8 134 transactions rolled forward in database
'msdb' (4).
2006-06-19 07:01:05.91 spid8 0 transactions rolled back in database
'msdb' (4).
2006-06-19 07:01:05.93 spid8 Recovery is checkpointing database 'msdb' (4)
2006-06-19 07:01:06.27 server SQL server listening on TCP, Shared Memory,
Named Pipes.
2006-06-19 07:01:06.27 server SQL Server is ready for client connections
2006-06-19 07:01:07.19 spid5 Starting up database 'tempdb'.
2006-06-19 07:01:08.35 spid11 314 transactions rolled forward in database
'SiteSecure' (7).
2006-06-19 07:01:08.43 spid11 0 transactions rolled back in database
'SiteSecure' (7).
2006-06-19 07:01:08.43 spid11 Recovery is checkpointing database 'SSW' (7)
2006-06-19 07:01:09.44 spid53 Using 'odsole70.dll' version '2000.80.2039'
to execute extended stored procedure 'sp_OACreate'.
"SQLPoet" wrote:
> What does the sql errorlog say?
>
> Martin Paterson wrote:
> > I looked at KB822360 and it appears to be for active directory issues. The
> > SQL server that is having this problem does not sit on a domain. thanks in
> > advance for your assistance.
> >
> > "CLM" wrote:
> >
> > > This probably does not apply, but we had a similar problem and it had to do
> > > with the following article:
> > > KB article 822360
> > > MS had us put in a couple of hot fixes and it seems to have taken care of
> > > the problem.
> > >
> > > "Martin Paterson" wrote:
> > >
> > > > I have a couple of sites that are running MS SQL 2000 Service pack 4 that are
> > > > stopping (apperantly randomly) and restarting itself. This is causing great
> > > > havoc on some of my applications that are attached to this database. The
> > > > server is dedicated for this purpose only and is hosting only on database.
> > > > reviewing the error logs have not resulted in any explanation as to why SQL
> > > > is dying. Google & MS knowledgebase has also resulted in no
> > > > explanation/solution. Any assistance would be greatly appreciated.
>|||Martin Paterson wrote:
> there are no errors that I can see...but here is an example of what is
> displayed:
> 2006-06-19 07:01:01.44 server Microsoft SQL Server 2000 - 8.00.2039
> (Intel X86)
> May 3 2005 23:18:38
> Copyright (c) 1988-2003 Microsoft Corporation
> Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)
> 2006-06-19 07:01:01.44 server Copyright (C) 1988-2002 Microsoft
> Corporation.
That's the current log that was generated when SQL restarted. What does
the archived error log contain? Last 15-20 lines should be sufficient.|||I have looked through all the error logs (errorlogs.1 -> .6) and they are all
the same. The only thing is that the modified date and time are the same as
the eventlog time stating that MSSQLSERVER has died and that it has done this
xx number of times before. I have yet been able to determine what is causing
it. No error messages in the errorlog or eventlog. I have looked to see if
there is additional parameters that need to be set to show more in the
errorlog on failure but I have not been able to find anything
"Tracy McKibben" wrote:
> Martin Paterson wrote:
> > there are no errors that I can see...but here is an example of what is
> > displayed:
> > 2006-06-19 07:01:01.44 server Microsoft SQL Server 2000 - 8.00.2039
> > (Intel X86)
> > May 3 2005 23:18:38
> > Copyright (c) 1988-2003 Microsoft Corporation
> > Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)
> >
> > 2006-06-19 07:01:01.44 server Copyright (C) 1988-2002 Microsoft
> > Corporation.
> That's the current log that was generated when SQL restarted. What does
> the archived error log contain? Last 15-20 lines should be sufficient.
>|||For the person that first posted their original problem in this threa
regarding ODSOLE70.dll 2000.80.2039 , did you ever come up with
solution? We are experiencing the exact same dynamic link librar
showing up in our logs when our error occurs. I am having little luc
finding any other solutions fto get around it. I wondered if perhap
you might be using the same software? or would like to confirm that yo
aren't so I can rule that as the problem. Please advise?
Our problem occurs the minute we try to generate a schedule usin
software called Schedulesoft and then starts the generation and neve
ends (hangs) requiring us to cancel it. Then in the log I find the sam
reference to ODSOLE70.dll 2000.80 2039 Does anyone have any ideas o
where I might look. We are also on fix pack 4 using SQL Server 200
--
shanleatherma
----
shanleatherman's Profile: http://unixadmintalk.com/59
View this thread: http://unixadmintalk.com/showthread.php?t=18590

MSSQLSERVER Service Shuts down

For the past few days, our SQL Server 2005 SP2 has been shutting down. The
Exchange and IIS services are still running. Restarting the service works,
but there are no events recorded in the event log. The SQL server is
hosting a single, small database that supports the navigation controls for a
developmental web-site and other than the security updates released last
week, no changes have been made to SQL Server itself.
Mike Ober.Hi
Is it open to internet ? What is an account that MSSQLSERVER run under?
"Michael D. Ober" <obermd.@..alum.mit.edu.nospam> wrote in message
news:uhVm38reHHA.4704@.TK2MSFTNGP06.phx.gbl...
> For the past few days, our SQL Server 2005 SP2 has been shutting down.
> The Exchange and IIS services are still running. Restarting the service
> works, but there are no events recorded in the event log. The SQL server
> is hosting a single, small database that supports the navigation controls
> for a developmental web-site and other than the security updates released
> last week, no changes have been made to SQL Server itself.
> Mike Ober.
>

MSSQLSERVER Service Shuts down

For the past few days, our SQL Server 2005 SP2 has been shutting down. The
Exchange and IIS services are still running. Restarting the service works,
but there are no events recorded in the event log. The SQL server is
hosting a single, small database that supports the navigation controls for a
developmental web-site and other than the security updates released last
week, no changes have been made to SQL Server itself.
Mike Ober.
Hi
Is it open to internet ? What is an account that MSSQLSERVER run under?
"Michael D. Ober" <obermd.@..alum.mit.edu.nospam> wrote in message
news:uhVm38reHHA.4704@.TK2MSFTNGP06.phx.gbl...
> For the past few days, our SQL Server 2005 SP2 has been shutting down.
> The Exchange and IIS services are still running. Restarting the service
> works, but there are no events recorded in the event log. The SQL server
> is hosting a single, small database that supports the navigation controls
> for a developmental web-site and other than the security updates released
> last week, no changes have been made to SQL Server itself.
> Mike Ober.
>

MSSQLSERVER Service Shuts down

For the past few days, our SQL Server 2005 SP2 has been shutting down. The
Exchange and IIS services are still running. Restarting the service works,
but there are no events recorded in the event log. The SQL server is
hosting a single, small database that supports the navigation controls for a
developmental web-site and other than the security updates released last
week, no changes have been made to SQL Server itself.
Mike Ober.Hi
Is it open to internet ? What is an account that MSSQLSERVER run under?
"Michael D. Ober" <obermd.@..alum.mit.edu.nospam> wrote in message
news:uhVm38reHHA.4704@.TK2MSFTNGP06.phx.gbl...
> For the past few days, our SQL Server 2005 SP2 has been shutting down.
> The Exchange and IIS services are still running. Restarting the service
> works, but there are no events recorded in the event log. The SQL server
> is hosting a single, small database that supports the navigation controls
> for a developmental web-site and other than the security updates released
> last week, no changes have been made to SQL Server itself.
> Mike Ober.
>

Friday, March 9, 2012

MSSQLOLAP Service stuck in a loop

Hi
I had installed the SP3a patch for Analysis Services.
Everything was working fine for a day and then now when I
try restarting the MSSQLOLAPService it gets into a loop
and automatically gets restarted again and again.
I am not very sure whether this is because of the SP3a
installation.
I have encountered the same on a few other desktops
running windows xp and a server running win 2000 advanced
server.
Any clue of where have I gone wrong?
Any sort of help would be appreciated!!
thanx in advance,
Lakshman.
On Mon, 12 Apr 2004 15:05:20 -0700, "Lakshman"
<babulaksh@.rediffmail.com> wrote:

>Hi
>I had installed the SP3a patch for Analysis Services.
>Everything was working fine for a day and then now when I
>try restarting the MSSQLOLAPService it gets into a loop
>and automatically gets restarted again and again.
>I am not very sure whether this is because of the SP3a
>installation.
I remember this happening to me and I wish I could be sure but I seem
to remember that it had something to do with the service pack.
Possibly a mismatch between the machine that had AS and another
machine that was hitting it...

>I have encountered the same on a few other desktops
>running windows xp and a server running win 2000 advanced
>server.
>Any clue of where have I gone wrong?
>Any sort of help would be appreciated!!
>thanx in advance,
>Lakshman.

MSSQLOLAP Service stuck in a loop

Hi
I had installed the SP3a patch for Analysis Services.
Everything was working fine for a day and then now when I
try restarting the MSSQLOLAPService it gets into a loop
and automatically gets restarted again and again.
I am not very sure whether this is because of the SP3a
installation.
I have encountered the same on a few other desktops
running Windows XP and a server running win 2000 advanced
server.
Any clue of where have I gone wrong?
Any sort of help would be appreciated!!
thanx in advance,
Lakshman.On Mon, 12 Apr 2004 15:05:20 -0700, "Lakshman"
<babulaksh@.rediffmail.com> wrote:

>Hi
>I had installed the SP3a patch for Analysis Services.
>Everything was working fine for a day and then now when I
>try restarting the MSSQLOLAPService it gets into a loop
>and automatically gets restarted again and again.
>I am not very sure whether this is because of the SP3a
>installation.
I remember this happening to me and I wish I could be sure but I seem
to remember that it had something to do with the service pack.
Possibly a mismatch between the machine that had AS and another
machine that was hitting it...

>I have encountered the same on a few other desktops
>running Windows XP and a server running win 2000 advanced
>server.
>Any clue of where have I gone wrong?
>Any sort of help would be appreciated!!
>thanx in advance,
>Lakshman.