Monday, June 18, 2012

SQL server page life counter

SQL server page life counter SELECT [object_name], [counter_name], [cntr_value] FROM sys.dm_os_performance_counters WHERE [object_name] LIKE '%Manager%' AND [counter_name] = 'Page life expectancy' The recommended value of the PLE counter is (update: minimum of) 300 seconds. I have seen on busy system this value to be as low as even 45 seconds and on unused system as high as 1250 seconds. Page Life Expectancy is number of seconds a page will stay in the buffer pool without references. In simple words, if your page stays longer in the buffer pool (area of the memory cache) your PLE is higher, leading to higher performance as every time request comes there are chances it may find its data in the cache itself instead of going to hard drive to read the data. Source : http://blog.sqlauthority.com/2010/12/13/sql-server-what-is-page-life-expectancy-ple-counter/

Monday, December 5, 2011

powershell script to scan all files in a folder (and subfolders) and get string containing

$dir = "d:\test"
$filename = "*.txt"
$temp=Get-ChildItem -Recurse $dir | Where-Object {$_.Name -like $filename} | Select-Object -Property Fullname, Name
"Starting File " | Out-File "c:\test.txt"
" "
foreach($tmp in $temp)
{
$tmp.Name.SubString(0,5) | Out-File "c:\test.txt" -append
get-content -path $tmp.FullName | Select-string "interface | ip address " | Out-File "c:\test.txt" -append
}

Tuesday, February 22, 2011

XMLSerializer Error? XmlSerializerPreCompiler to the rescue

Recently came over 2 roadblocks for my code and worked it around:
1. Created an XML file with same child nodes to multiple parent nodes and tried XSD on .NET framework 1.1 and it burp, so i XSD it on framework 2.0 and created C# class, guess what it works when deployed on Win2K machine with Framework1.1 only!
2. Another major issue I ended spending many hours at:
So I compiled this assembly and deployed on Win 2K machine, the code didnt worka nd logged this error File or assembly name abcdef.dll, or one of its dependencies, was not found.
Thanks to Chris Sells's XmlSerializerPrecompiler tool, i was able to figure that SysNode class was created as a 2 dimension array SysNode[][] by .NET XSD compiler, all i had to do was manually edit it to SysNode[] and it worked! Here's a link to The XmlSerializerPreCompiler tools

Wednesday, February 16, 2011

Mount Windows on Linux

usr@linuxmachine:~$ sudo mount -t smbfs //IP/ubuntu mnt -o username=username@domainname

Monday, February 7, 2011

Restoring SQL for mirroring

If the path of the mirror database differs from the path of the principal database (for instance, their drive letters differ), creating the mirror database requires that the restore operation include a MOVE clause.

Important note Important

If the path names of the principal and mirror databases differ, you cannot add a file. This is because on receiving the log for the add file operation, the mirror server instance attempts to place the new file in the location used by the principal database.

For example, the following command restores a backup of a principal database residing in C:\Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\Data\ to a different location, D:\Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\Data\, where the mirror database is to reside.

RESTORE DATABASE AdventureWorks2008R2    FROM DISK='C:\AdventureWorks2008R2.bak'    WITH NORECOVERY,        MOVE 'AdventureWorks2008R2_Data' TO           'D:\Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\Data\AdventureWorks2008R2_Data.mdf',        MOVE 'AdventureWorks2008R2_Log' TO          'D:\Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\Data\AdventureWorks2008R2_Log.ldf'; GO


The above path is for reference only, check the correct path on the mirror database and repeat the process for full backup and transactional backup.

Thursday, July 8, 2010

SharePoint 2010 vs 2007

Found this nice article @ http://jacksonc.wordpress.com/sharepoint-2010-vs-2007/


Microsoft Office SharePoint
Server 2007
SharePoint Server 2010
Office client required to view and edit documents uploaded to document libraries (Download and open)Office Web Application enables Word, PowerPoint, Excel and Visio documents, using Silverlight or HTML with JavaScript (Depending on Browser Support)
No Co-Authoring CapabilityCo-Authoring Capabilities available for Word, PowerPoint (with client software) and Excel (Available over the web)
Lot of post backsFewer post backs for default actions – more Ajax usage
No inherent support of Ajax or SilverlightFully supported
Static themes. You just pick a theme and its applied across the site, no previewYou can select a theme , customize it and preview before applying it on the site
No bookmarking, tagging or rating capabilityIts all there :)
Content Types scoped to site collectionsNew concept of having a Content Type hub which can be shared across web applications
Media files would have to be downloaded before playingProgress download feature available (not streaming)
BDC used to store info in SharePointBCS reads data real-time (with some caching for performance)
5 million item limit in document library10 million
Views are CAML drivenViews XSLT based
To query a list we had to use CAMLQueries via LINQ, JavaScript and Silverlight API’s
No restriction for installationAbility to prevent people from installing SharePoint (Managed at the AD level)
Shared Services scoped to FarmShared Services architecture changed to make it more flexible and ability to share across farm
Profile synch could be done by anyoneAdditional permission check for account to carry out profile synch
Basic web AnalyticsWeb analytics capability enhanced
Search results are staticClicking on a search result affects the search results for the other searches for the same keyword
To limit issues with rogue code that could bring down the server, CAS had to be defined /maintained for different applications. This was not easy to do and Admins used to say – no code allowedSandbox available that restricts the scope of code. Deployment is also easy, the code just needs to be uploaded by the site admin, no need for intervention from the SharePoint farm admin to run scripts on the server
People with contribute access could upload .aspx pages in a document library. It was possible to restrict, however it would restrict everyone from uploading .aspx pagesPeople with contribute access cannot load .aspx pages
Contributors could edit tool pane parametersNot editable by contributors
Explorer view on browserOpens up Windows explorer with web dav access
Simplistic Mobile Page OOTBAble to create richer mobile pages using OOTB features
Usage of outlook for offline accessSharePoint Workspace used for offline access – more capability eg. ability to synch up lists (even external content from BCS)
Not possible to have a common document ID that is associated with a document regardless of which document library it moves intoDocument ID can be defined and associated to the document regardless of where it is located(within the site collection)
To upload a document or page, one needs to go to that appropriate site/subsite and library and uploadContent organizer moves document to appropriate libraries based on metadata rules which can be defined
When a file with a same name is uploaded, it creates a new versionOption to have another version or append a unique ID to the document being uploaded
Fixed layout with defined web part zones where web parts can be placedMore “Fluid” UI; ability to place web parts without having web part zones
Retention policy allows only delete or invoke workflow by defaultMultiple other options – eg send to another library etc
EBS – to store docs out side SharePoint, possible but not easy to configureRBS - managed by SQL
Requires Server OS to install(32 or 64)Can be installed on Win 7 (64 bit) and Win 2008 (64 bit)
No field validationsField validations available
Workflows created in SPD or VS.Net – not possible to move a workflow developed in SPD to VS.NetWorkflows can be defined in Visio, Imported to SPD with rules added and then moved to VS.Net
Table based layoutsDiv Based layouts (better for accessability)

Saturday, November 3, 2007

Network in my Veins

Today I am CCNA certified, not to mention i already hold MCSD in .NET. This marks the beginning of me being an overly qualified nerd, after trying my hands on every possible technology in programming domain and writing all kind of software applications, where is the peace? I think this started a few yrs back when i wrote my first integration application. Handling data streams over the network was a good change over writing conventional database applications; so much so that i moved my focus to network traffic; stating with Citrix and how IPs are NATted across domains, how firewalls collide with router based access lists; to managing the data center with machines as old as IBM 330s to new HS21 Blade severs; i think am getting the much needed kick out of it.