As already said, if you are running SQL Server Express, then there is no SQL SA and you cannot replace the HDB service.
If you do not need to remove the "Siemens GMS HDB Service" and just want to remove the advanced privileges from its account, you can skip this chapter and go to the next.
This chapter assumes that SQL SA is running with sysadmin privileges.
If you do not want the maintenance stored procedures to be executed with these privileges, you need to continue with this chapter and follow the coming one as well.
Step 4.1: Configure the Windows service
In SQL Server Configuration Manager (SQL CM) or in Services confirm that the respective SQL SA is running and the "Start Mode" or "Startup type" is set to "Automatic".
Step 4.2: Stop the HDB service
Stop the HDB service. You might stop or even uninstall it later, after the successful tests.
Step 4.3: Configure the jobs
Start SQL Server Management Studio (SQL MS) and log in as a member of the sysadmin fixed server role.
- Create a SQL Server Agent job called "invLoopJob"
- Add one step (e.g. Step 1) to the job executing "EXEC invLoop;"
- Add a schedule that starts the job every 5 seconds
- Create another SQL Server Agent job called "monScanTimerJob"
- Add one step to the job executing "EXEC monScanTimer;"
- Add a schedule that starts the job every 30 seconds
Step 4.4: Configure the HDB in Manual administration model
In SMC edit the HDB and set the "Administration model" to "Manual".
Step 4.5: Configure the jobs to run as HDB service user
SQL SA is running with sysadmin privileges and if you do not want the above jobs to be executed under this account but under HDB service user account (e.g. HdbServiceUser) then only perform this step.
In SQL MS open the job "invLoopJob" previously created. Edit the existing step (e.g. Step 1) and open the page "Advanced". Go to "Run as user", select dbo which is mapped to the HDB service user account (e.g. HdbServiceUser) and click OK. Do the same for job "monScanTimerJob".