Monday, June 8, 2009

Error registering COM+ dll using Regsvcs.exe

“Could not load file or assembly System.IO.FileNotFoundException”

This error happens due to various reasons. The first solution that you will find for this issue is, “Copy all the dependency files to the destination server and register the dll”. This seems to be an easy fix, hence we miss this solution by oversight. Do not go by an understanding that target machine has the similar environment as our development machine and there is not need to copy the dependencies. Dependencies need not be the framework dll, it can also be any specific dll created for this process. In such case copy the latest of that dlls to the bin folder of the solution and build the code. Copy the latest build and the dependency dlls to the target machine and register the dll.

There may be other reasons for which you may receive this error. Information about the same are available in the following link.

http://blogs.msdn.com/dougste/archive/2006/09/05/741329.aspx

Additional information on COM+ registration
http://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/343e7086-8b24-4314-ad5a-4115dfaadce0

Monday, April 13, 2009

WMI - Failed to connect

WMI (Windows Management instrumentation) service had been an issue recently in most of the installation like SQL Server 2005, SQL BPA etc. There are many solutions provided on the net, having tried almost all, only the following worked at last - Rebuilding WMI

Comprehensive rebuild methodImportant note:
If you've installed a Service Pack, you need to insert your Windows XP CD with Service Pack integration (called as the Slipstreamed Windows XP CD). If you don't have one, you may point to the %Windir%\ServicePackFiles\i386 folder for a recent version of the system files required during WMI repair. Or you may create a slipstreamed Windows XP CD and insert it when prompted.
Click Start, Run and type the following command, and press ENTER:

rundll32.exe setupapi,InstallHinfSection WBEM 132
%windir%\inf\wbemoc.inf

Insert your Windows XP CD into the drive when prompted. Repair process should take few minutes to complete. Then restart Windows for the changes to take effect.
Note: Do not copy wmiprvse.exe while rebuilding. Remove this file from the %Windir%\ServicePackFiles\i386 folder, if exists, then start rebuilding. This file will cause CPU spike.

Tuesday, January 20, 2009

First level of Performance Tuning in SQL Server

A Simple way to performance tune your query:
a) Check if the WHERE clause is using INDEX or FULL TABLE scan using query plan
b) Ensure the columns used in WHERE clause is in the order of the index creation (if applicable)
c) Include the WHERE condition that would limit the number of records to be searched and then the JOIN condition

Recently I have created a query which took nearly 4 minutes to get executed. I did the following changes, which made my query get executed in 2 minutes.
(I have changed the table names for this sample)
Initial Query:
SELECT FROM Employee empINNER JOIN Address adr ON emp.EmpID = adr.EmpIDLEFT OUTER JOIN Phone ph ON emp.EmpID = ph.EmpIDLEFT OUTER JOIN FamilyMembers fly ON emp.EmpID = fly.EmpIDLEFT OUTER JOIN BankDet bk ON emp.EmpID = bk.EmpID
I commented all the JOINs and uncommented each JOINs and verified the execution time. Only for Phone it took more time. Hence I moved the JOIN condition for Phone at the end of the JOINs. This limited the records to be processed for the Phone table and reduced the timing.

Tuned Query:
SELECT FROM Employee empINNER JOIN Address adr ON emp.EmpID = adr.EmpIDLEFT OUTER JOIN FamilyMembers fly ON emp.EmpID = fly.EmpIDLEFT OUTER JOIN BankDet bk ON emp.EmpID = bk.EmpIDLEFT OUTER JOIN Phone ph ON emp.EmpID = ph.EmpID

Sunday, January 18, 2009

Covey's impressive answers (An extract from The Economic Times)



How can you be effective in time when negativism is so pervasive ? This is a perfect time to create long-term competitive advantage . It’s in times like these that people can adapt and make sacrifices . This is really an opportunity for creative businesses to gain long-term competitive advantage. Even if we find that we are not in control of anything, one always has the power of choice to do what one can do.

Every management expert says that tough times should be used to build competitive advantage. But is it easy to think about building competitive advantage when all you are thinking of is survival?

It’s tough because everything around people is negative. When the external factors over which one has no control in a way start to become negative it starts to affect our creative juices. You have to be creative in these times and take advantage of this ‘valley’ and turn it into a ‘peak’ , a new initiative can make a difference and the key to that is to move away from the industrial age model because the industrial age model is top down and command-and-control.

And tough times help unleash the creative force in people’s own professional lives and that feeds upon itself and the creative juices get going again. It’s not easy but it’s within reach. And it’s the perfect time to do so.

This profits vs principles war is seeing the wrong winner in some cases. Do you think there needs to be a rethink on the ‘hows’ of the business?
I think that’s part of it. People have to look up to themselves to begin with - an inside out approach. They must also learn how to involve other people all the way; to involve the entire organisation to look at these issues; to develop systems and structures which reward the right things.

What’s the new model of openness that you are advocating these days? It involves being clear and transparent. In taking the reality of what is happening with the people and then asking them: What do you think we can do in this situation? You will find that it will work on the basic underlying forces that produce trust and openness. We have had misaligned systems that rewarded people for wrong things and this has been happening all around the world.

This is the perfect time to unleash people’s creative energies and come up with new creative ideas and companies can do this with suppliers and their customers because everybody is feeding on the paranoia and the fear.

It’s like a cancer that feeds upon itself and people get victimised by all these forces. So they criticise, they complain, they compare, they become cynical, they compete. This is the perfect time to take advantage of this and turn it around. And you have to be creative on how to do that and that will be the main challenge.

Why have you focused on habits to bring about change? Because people co-relate habits of thought and habits of actions which are completely misaligned with these new realities. And it’s like trying to play tennis with a golf club. The habits, not only of people, but also the structures of the system (Covey calls them habits of organisations) of the organisation are misaligned. The result is that people get negative and pessimistic and discouraged and disparaged and that feeds on itself.

How does one prioritise one’s life when there are so many demands on one’s time because of one’s role as a father, husband, employee, boss?
You have to get everybody in the culture on the same page about what is really important. The thing that is important now is taking advantage of this difficult time by unleashing the creative energy but what’s happening now is that fear is sprayed everywhere. And people have no control over this situation. What is important is the need for a balanced life, in which you learn to say no to things that are urgent even though not important.

Most people spend half their lives doing things that are urgent even though not important and they know it. They don’t have the courage to say no to things that are not important. My Seven Habits book deals with personal and interpersonal, The Eight Habit deals with the organisational. And unless people wake up and change the structures and systems, the entire culture , it won’t happen.

Do you believe in fate? I believe in faith. One of the things that I have admired about India is the spiritualism of the people. That’s a great advantage and because of that spirituality, if one can learn to change the systems we have and learn to synergise with each other, then India can again become a dominant force in the world.

If we look at the progress India has made in the past decade, it’s tremendous. I admire that. You have such tremendous traits, only if you can get out the vindictiveness, defensiveness and the negative energy out of the way.

Full article: http://economictimes.indiatimes.com/Features/Corporate_Dossier/Be_effective_in_tough_times_and_win_back_trust_Stephen_Covey/articleshow/msid-3986583,curpg-1.cms

Friday, June 27, 2008

Further into IIS issues

Recently we faced an issue with the webapplications hosted on IIS. Something interesting to solve.
The webapplications were working perfectly fine but only in the LAN environment. When logged in from VPN they didnt work. Access denied messages were displayed. All the settings on IIS were perfectly fine with Anonymous user login, security settings for folders, etc. After a brief analysis the reasons for the issue was found out.
This issue occurs where there is a non-sync between the IUSR password in IIS and the IUSR password at the system level.

To fix this we can either change the password to make it same at system level and in IIS setting or simply restart the IIS Admin service which will recreate the IUSR account.

To sychronise the system level password and password in the IIS setting follow the steps given below:

The password can be change in the IIS settings by changing the entries in the adsutil.vbs

To know if the password entries are available in the adsutil.vbs use the following command:
cscript adsutil.vbs find anonymoususerpass
This will return a listing of all the nodes where the anonymoususerpass appears in the metabase. Ideally you should see this in only the W3SVC node (it may also appear in the MSFTPSVC node if you are running FTP). If you see any locations “under” W3SVC (i.e. W3SVC/1/root) then we should delete these entries.

To delete an entry use the following syntax:
cscript adsutil.vbs delete W3SVC/1/root/anonymoususerpass

Once we have made sure that we only have the password set at a single location, we need to “sync” the password with the one in the SAM database. The easiest way to do this is to simply open Computer Management if you are on a member server or Active Directory Users and Computers on a domain server and do a change password on the IUSR account. Then back at our command prompt, we simply set the password to match the one we just set by using the following command:

cscript adsutil.vbs set W3SVC/anonymoususerpass "passwordgoeshere"

The passwords should now be in sync and the site should now be accessible.

Wednesday, April 23, 2008

SQL Query Optimisation - Other than common ones

In addition to the common optimization tips for SQL Server query, the following are some of the useful tips.

- To view the row count from a table use, "SELECT rows FROM sysindexes WHERE id = OBJECT_ID('table_name') AND indid < 2" query instead of count(*) or use sp_spaceused which will also provide the row count.
- Avoid having clause in group by and use where if necessary
- Avoid distinct clause and use it only when it is really mandatory
- Include SET NOCOUNT ON for stored procedures as it will reduce the transfer of rowcount data travelling from database to application
- In case you need to get only first n rows in a query use top or SET ROWCOUNT statement.
- Avoid using optimizer hints in any database. This may make the query faster initially but will really affect the performance as the data grows in the table.
- Try to use inner tables instead of creating temporary table whereever possible.
- Use a EXIST, NOT EXISTS or LEFT OUTER JOIN instead of a IN or NOT IN in where clause.