Friday, January 31, 2014

Could not load type 'System.ServiceModel.Activation.HttpModule'

I have a test machine,  IIS installed,
My web application installed there, it was running well.
Later, I install the VS2010. try trace code.
I change the web site map path. Build application .
when try load page . Got Could not load type 'System.ServiceModel.Activation.HttpModule'
fix by : http://msdn.microsoft.com/en-us/library/hh169179(v=nav.71).aspx
cd\Windows\Microsoft.NET\Framework64\v4.0.30319
aspnet_regiis.exe -iru
iisreset

Friday, November 1, 2013

Optimising join on large table ( (inner join + group by)

optimize sql for inner join with huge data.
We have a table include more than 1M records,
we want get data that the 3 fields is duplicate or  only once's list
before we use "in" or "exists",
the sql when records is less, it is no problem, give us good return,
when records become huge, the sql could get return ,the main problem is inner jion,
So, the change is using CTE (common table expression),
the big improve is before even no return till timeout(more than 20 minutes)
now is only 30 senconds.
And another thing I learn from here is create index view
and deterministic and nondeteministic functions,
because the 1 column is caclute by user funtion, so I could not just create index for improve performance.
Any way, problem resovled.

SELECT Fl.*
 , ROW_NUMBER() OVER (ORDER BY Fl.Name ) as num
 FROM [dbo].[a] Fl
   
   
 where  exists 
 (
     select Fl1.r1
    from [dbo].[a]     
    where
    
    and Fl.r1= Fl1.r1
    and Fi.r2= Fi1.r2
    and Fi.r3= Fi1.r3
    group by
     Fl1.r1
      ,Fi1.r2
      ,Fi1.r3
    having count(*) <= 1
 )


;with R as
 (
 select Fl1.r1 as r1, Fl1.r2 as r2 ,Fl1.r3 as r3
    from [dbo].[a] Fl1                  
    group by
    r1
    ,r2
    ,r3
    having count(*) > 1
 )
 select t.*
 from R inner join   [a] as t
 on t.r1= R.r1
 and t.r2= R.r2
 and t.r3= R.r3

Refrence
http://dba.stackexchange.com/questions/28584/select-the-newest-data-inner-join-group-by-maybe

Friday, October 25, 2013

OWSTimer unhandled exception popup – System.Security.Cryptographic.CryptographicException

When I install the sharepoint 2010 on my machine,
There is a pop up unhandled exception throw every night.

 System.Security.Cryptographic.CryptographicException

http://blogs.technet.com/b/stefan_gossner/archive/2010/05/10/common-problem-with-sharepoint-2010-system-security-cryptography-cryptographicexception-keyset-does-not-exist.aspx

I search online ,find the blog. It is good to know.

If you see this error message from SharePoint 2010 you can relax, nothing bad is happening. When SharePoint 2010 and Visual Studio 2010 are both installed on the same machine you may see this error every 24 hours. This occurs when the OWSTimer service has a regular process recycle and in the shutdown of the old process an exception is raised. The exception doesn’t interfere with the normal process shutdown and recycle and is only ever seen if you have a JIT debugger installed on the machine. You should never see this error on a production SharePoint 2010 server, because you should not be installing Visual Studio 2010 on those servers. You can safely ignore these exceptions and close the window, or leave it there. You actually cannot debug the process, because it will already have been closed by the time you click the button and start your debugger.


To configure the server to no longer show a dialog when an unhandled exception occurs, use the registry editor to delete the following registry keys:
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger
On a 64-bit operating system also delete the following registry keys:
  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger

http://blogs.msdn.com/b/pandrew/archive/2010/05/25/benign-owstimer-unhandled-exception-popup-system-security-cryptographic-cryptographicexception.aspx