technology and zen of life

“A heisenbug (named after the Heisenberg Uncertainty Principle) is a computer bug that disappears or alters its characteristics when an attempt is made to study it.”

Get SQL Agent service starting

Today I was struggling with Microsoft’s SQL Server. I could not get the SQL Agent service starting. Maybe my experiences can help you.

Introduction

Sometimes the SQL Agent service will not start, and it is quite hard to get the cause of this when the Error log doesn’t show much. The hints below were gathered from various websites and online forums, and some of them were tested with a Microsoft SQL Server 2008 R2 stand-alone instance running on Windows 7.

General testing

To get some idea of what is wrong, do this in a command shell:

C:
cd C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn
SQLAGENT.EXE -c -v

Error when editing SQL Agent settings

When in the SQL Server Configuration Manager, you might get an error like “the process terminated unexpectedly” after changing the SQL Agent settings.

Check the Windows Event log, Security. If there is a Event ID 6281, maybe with a file called l3codeca.acm, then maybe you are using Remote Desktop (RDP) and you have audio forwarding enabled. Disable it.

ErrorLogFile location

A wrong ErrorLogFile location could also result in an error like “the process terminated unexpectedly” after changing the SQL Agent settings in the SQL Server Configuration Manager.

The ErrorLogFile registry key must point to an existing file location.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\SQLServerAgent]
"ErrorLogFile"="C:\\MyBigDataStore\\MSSQLSERVER\\MSSQL10_50.MSSQLSERVER\\MSSQL\\Log\\SQLAGENT.OUT"

Registry key permissions

The Windows user account that is being used to start the SQL Agent service must have full rights on the same registry key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\SQLServerAgent]

I experienced some problems even after setting the permissions right. Consider giving the “Users” group (all users) full permissions (read & write). If you don’t like that, you could at least try that to see whether it’s a registry key permission issue.

Windows Groups

When the user being used to start the SQL Agent service is not a member of the local Administrators group or not the LocalSystem account, then you need to be sure that the user is a member of the SQLServerSQLAgentUser$SERVERNAME$MSSQLSERVER group. Note that you need to set SERVERNAME to your specific server name.

Furthermore, this group might need to have permissions on various folders, and also needs a SQL login on the SQL database with sysadmin permissions.

SQL login

The user being used to start the SQL Agent service needs a matching SQL login on the SQL database with sysadmin permissions.

If you migrate the master database to another computer or a new domain, then the SIDs of the Windows accounts will probably be different, even although the usernames and group names are the same. You need to create new SQL logins and map them to proper SQL user permissions.

For example, when using a Windows user “sqlagent” to start the service, you need:

CREATE LOGIN [MYSERVER\sqlagent] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english]
GO
EXEC sp_grantlogin [MYSERVER\sqlagent]
EXEC sp_addsrvrolemember @loginame = [MYSERVER\sqlagent], @rolename =  'sysadmin'

Virtual Host or Alias

When in clustered mode, then the virtual host or alias name for the SQL Agent service needs to match the one of the SQL Server service. Check the properties in the SQL Server Configuration Manager.

Enable Agent XPs

This seems to be needed in some scenarios.

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Agent XPs', 1;
GO
RECONFIGURE
GO

Broker

Some broker functionality was mentioned on a forum. It was rumored that the broker should be enabled. You can check that with:

SELECT is_broker_enabled FROM sys.databases WHERE name='msdb'

But I’m not sure whether this is needed.

 

(Original article first published at my personal weblog.)

Calendaring: Exchange can publish to ICS, defaults to insecure

ICS (iCal) is a file format for calendars. Most calendaring software uses it. For example, you can import / export it to Google Calendar. If you have a Google Calendar, you can “publish” your calendar to an ICS file, so you can use it with other software like Mozilla Calendar or web services.

Microsoft Exchange 2010 can also publish calendars to ICS. Which is great, because Exchange and Outlook offer more advanced features for heavyweight calendar users. Like using rich text and images for your descriptions, and adding file attachments. Steve Goodman has written a fine manual on how to enable iCal Calendar Sharing with Exchange 2010 SP1 (recommended reading). Read the rest of this entry »

Using the presenter view in Microsoft PowerPoint.

I am sure that everyone has given presentations on a beamer / screen and will have to do so in the future. Most people I have seen presenting use the default slide show view in which the laptop/computer shows the same view as the projector / screen. This is quite unhandy when you want to refer to your slide notes or want to have an idea of the time you took till now or simply want to switch to a different slide by jumping a few in between without letting your audience being obvious of that fact.

ZA001058072 300x277 Using the presenter view in Microsoft PowerPoint.Here is where the presenter view functionality comes in use. It has to be one of the handiest tools while giving a presentation. The presenter view allows the user to take full advantage of the dual screens. While showing the full screen presentation on the screen the laptop/computer screen shows an organized collection of slide notes, navigation controls, drawing tools, timer, slide view shown on the projector and other powerful features.

 

 

 

 

 

Read the rest of this entry »

Useful Windows shortcuts

Here is a list of useful windows shortcuts:

Win key + E    -> Open the explorer window
Win key + R    -> Open the run command
Win key+ M    -> Minimise all windows use Shift Win key + M to undo minimise
Win key + L    ->  Lock computer
Win key + D    -> Show desktop
Win key + F    -> Open the find Dialouge
Win key +  U   -> Open the windows utility manager – you can use this to enable / disable on screen keyboard or narrator
F2    ->  Shortcut to rename
Cntrl + Esc -> same as using the win key, opens the start menu
Cntrl + shift + Esc -> opens the task manager
Cntrl + F4 -> This is used to close tabs in the main application where as alt + f4 closes the whole application
keep SHIFT pressed while inserting a USB or CD with auto boot to skip the auto boot functionality.

Hopefully this will speed up your work a bit or at least enable you to procrastinate a bit more xD

WindowsXP: Using the Command prompt to see and kill processes

If you are a WindowsXP user then you must be already familiar with the life-saving graphical tool called “Task Manager” on Windows. Whenever the PC starts hanging and the processes start eating up a lot of memory (Sadly most of the time its Firefox for me), we press the alt+ctr+del key to bring up the the “Task Manager” and try to kill the memory eating processes and the ones which are “not responding”. Well, you should also know that this can be done efficiently from the command prompt as well by using the task manager command prompt alternative and kill processes from command prompt.

As my project work requires writing and running codes, I generally have at least one Windows command prompt open. If this is the case with you then it is much faster to manage your windows processes from command prompt than to open up the Task Manager, just like we do on Linux using “ps” and “kill” command. Get to know the following commands and you can easily use the command prompt to see and kill processes.

1. Tasklist : This command is similar to “ps” command on Linux and is used to see the details of the programs and processes that are running in Windows. Tasklist can be applied to see how much memory and CPU time running processes are using, what DLL files they rely on, and other information. Thus it can be a very useful troubleshooting tool.trans WindowsXP: Using the Command prompt to see and kill processes

  • Processes info: When you enter tasklist on the command prompt, you can see the following informations by default. Image Name, PID, Session Name, Session#, Mem Usage
  • Processes detailed info: Additional info like, Status, User Name, CPU Time, Window Title can be displayed using tasklist /v
  • Services and Processes info: Use tasklist /svc to get a table relating Image Name, PID, and Services, very useful to know the relationship between a process and the services that are running on a system.
  • dlls and Processes info: Tasks and Use tasklist /m to find which DLLs are used by each process.
  • Filtering processes: Processes can be filtered using ImageName, PID, MemUsage, Status, Username and WindowTitle. For Example,
    • Use the following command to to find processes that are not responding.
      • tasklist /fi "status eq not responding"
    • Use the folliwing to list the processes eating up more than 10MB.
      • tasklist /fi "memusage gt 10000"
  • More Info: To get more info on advanced syntax of the command use tasklist /? or refer to Microsoft’s documentation.

(NOTE: Although Tasklist is a part of Windows XP Professional, it does not come with the Home edition. Those with the Home version of XP can download this file and can put it in the system path.)

2. Tskill : This command is used to end a process, using its name of its PID.

  • Kill with name: Use tskill processname to kill a process with name processname. For example:
    • tskill winword (closes all the Microsoft documents that you have open)
  • Kill with PID : Similarly use tskill processid to kill a process with PID processid. Tasklist can be used to find the PID of a process.
  • More Info: To get more info on advanced syntax of the command use tskill /? or refer to Microsoft’s documentation.

(NOTE: Tskill is a part of both Windows XP Professional and the Home edition.)

3. Taskkill : Similar to Tskill, this command is also used to end a process but it provides us more options in doing so. Apart from specifying the PID or the image name of the process to kill, we can also use ceratin filters to kill the matching processes as explained below.

  • Kill with name: Use taskill /IM imagename to kill a process with the given Image name. For example:
    • taskkill /im notepad.exe /f (forces notepad to be killed.)
  • Kill with PID : Use taskill /PID processid to kill a process with the given processid.
  • Filtering Taskkill: Processes to be killed can be filtered using ImageName, PID, MemUsage, CPUTime, Session, Status, Username, WindowTitle, Services or Modules (dll). For Example,
    • Use the following command to forcefully shut down all the processes that are not responding.
      • taskkill /f /fi "status eq not responding"
    • Use the folliwing to close down all programs using more than 10 MB..
      • taskkill /f /fi "memusage gt 10000"
  • More Info: To get more info on advanced syntax of the command use taskkill /? or refer to Microsoft’s documentation.

(NOTE: Taskkill is only a part of Windows XP Professional.)

So Enjoy using the task manager command line version!

Go on, show the power of your commands to the processes. Happy killing them. icon wink WindowsXP: Using the Command prompt to see and kill processes

(Extra Note (Added for my own safety) : I am not responsible if anything goes wrong, while trying out the commands given here.)

Subscribe FREE to MSDN Magazine & Dr. Dobb’s Journal! Only for developers in India!

stay in touch Subscribe FREE to MSDN Magazine & Dr. Dobb’s Journal! Only for developers in India!

MSDN brings you digital editions of two premium international magazines followed by developers worldwide, absolutely free. (Actual cost is $60 and $30 annually).

What more, we also get to win XBOX 360, or Portable Music players.

While MSDN magazine offers valuable content on Microsoft development technologies besides solutions to real world problems you face every day, Dr. Dobb’s Journal covers all essential tools, languages and platforms along with the latest technology updates.

Hurry! Grab the offer with both hands!

icon smile Subscribe FREE to MSDN Magazine & Dr. Dobb’s Journal! Only for developers in India!

-Fr0z3n

Student Rockstar

FYI: This one is a great to participate contest for college students of India. Have a look at the website to know the details.

Student Rockstar

Good Luck!

Microsoft contests Information

Thought of sharing information about ongoing contests.

1. Microsoft High Performance Computing Scholars program

Prizes: Student Awards of $1000 and Faculty Research Grants worth  $5,000, many more prizes can be avaialed just by registering.

Target Audience: All undergraduate, postgraduate, diploma and training students (along with supervising Faculty) of India.

Duration of contest: 15th May 2007 to 30th June 2007

2. Win 1 in 3 copies of Microsoft Expression Studio Commemorative Editions

Prizes: Microsoft Expression Studio Commemorative Editions

Target Audience: General

Duration of Contest: Running..till 6th of July 2007

3. Win with Windows

Prizes: Cafe coffee day vouchers.

Target Audience: General

Duration of Contest: July 2 to July 14, 2007

4. Project Shutter Photo Contest!

Microsoft has initiated a Photography Contest – the Project Shutter Photo Contest! This is aimed at enthusiasts with an eye for photogenic visuals across three themes that best represent the individual’s locality – Food, Culture and Architecture. There are tons of goodies up for grabs, including a T-Shirt every 30-minutes through the next 12 days.

Be sure to check out their gallery to find some of coolest pics.

shutter Microsoft contests Information

Good Luck!

Email Subscription

Disclaimer

The views expressed on this blog are personal. We do not claim to be a representative voice of the views of any organisation whatsoever. We are not responsible for the content present on the blogs to which we have linked.Views expressed are solely that of the author and does not reflect a collective opinion of contributors.