SQL Server security best practice

Security! This is the word comes in mind of every concerned person when it come...

Change the Collation Settings in MS SQL Server

This post will show you how to change the collation settings in MS SQL Server for specific database...

Resolve collation conflict

In this post I will show you how you can resolve collation conflict error...

Book: SQL Server 2008 High Availability

In this book I have tried to cover every single piece of information that might requires for installing and configuring SQL Server HA option like Clustering, Replication, Log Shipping and Database Mirroring...

Why to recompile Stored Procedure

Generally, we create views and stored procedures (proc here after) ...

7/22/2009

Surat User Group DNN Portal upgraded

Great News!!!!

Surat User Group's website which was running on older version of DotNetNuke is just upgraded to newer version!!!

Surat User Group is runing on DotNetNuke CMS v 5.0 since it has been launched officially, and I thought to upgrade it with the new release of DotNetNuke. Since this is the first time I am upgrading DNN Portal I was googling a good reference material for Upgrade Procedure, and I landed on a Mitchel Sellers Blog entry Upgrading from DotNetNuke 4.3.5 (and other 4.x versions) Although this is meant for old version it worked for the upgrade I did.

7/08/2009

Register for SQL Server 2008 R2 CTP

Microsoft is planing to release R2 CTP for SQL Server 2008, get your self register so as you will get notified as it becomes available :)

7/02/2009

TechEd on the road, Surat - Great show

Microsoft has organized TechED India 2009 at Hyderabad in the month of May during 13th to 15th. This was a biggest community event for IT professionals and Developers from all over country, and was big success and User Group leads of various cities have been asked to organized similar events in their cities, Surat was among those 10 cities.

Surat had its first TechEd event on 28th June 2009, and was organized by Surat User Group (IT Pro community) in association with DotNetChaps (Developer community). The event was organized at Umra Police Station auditorium and 150+ participants were registered for the event. You can see the event photographs



We had 80+ attendees inspite of heavy rain in the morning, we've got a mix of students, developers, IT Pro and lecturers from various institutes. We had 5 speakers who delivered power packed sessions on new technlogies, I spoke on ROW/Page compression in SQL Server 2008 and Virtualization 360 , Mrityunjaya Kumar spoke on Silverlight 3.0 and Windows 7 for Developers, Dhaval Faria spoke on What's new in .Net framework 4.0: VS 2010 and Aviraj Ajgekar spoke on Windows Server 2009 RC2.

It was really nice experience for me, all the technical sessions has got 4 out 5 rating and participants suggested to have more events in the future.

Let me say my thanks to our sponsors Microsoft, SQLPASS, UG Support Services, SolidQ Mentors, Sharma Infoway and XCellence-IT for their support, I would also like to thank Bhavin Gajjar | DotNetChaps lead for his support in organizing this event.

6/02/2009

TechEd - TechEd on the Road, Surat - 28th June 2009


Microsoft has organized Tech-ED India 2009 at Hyderabad in the month of May during 13th to 15th. This was a biggest community event for IT professionals and Developers from all over country, this event was big success.
To continue spreading knowledge and educate IT community, Microsoft in association with SQLPASS, Culminis and Ineta has asked User Group Leaders of various cities to organize mini version of Tech-ED “Tech.Ed on the Road” . TechEd on the Road will be held in 9 cities of India during the Month of June and Surat is one of those cities where TechEd on the Road to be organized on 28th June by Surat SQL Server User Group and DotNetChap. It is a great opportunity for Developers, IT professionals, Students to know about trend of IT and upcoming technologies from Microsoft.

We SQL Server User Group and DotNetChap feel immense pleasure to bring you the Mini TechEd - TechEd on the Raod, Surat event for IT Professionals, students and End User has lots to get back from this event in terms of Technical know how! There are mainly two tracks for this event Developer and IT Pro track.

This event is open to all and is free; the only thing required is to get your self registered for the Mini TechEd - TechEd on the Road as we have limited seats available.

To know about the Agenda and Speakers, click here

--- Hemantgiri S. Goswami | Surat SQL Server User Group Lead

5/05/2009

Integration Services (SSIS) in SQL Server Cluster

Often the question being asked is "How can I install SSIS in SQL Cluster" or "How to run DTS/SSIS package in cluster when SSIS is not running"

You can very much run DTS/SSIS package in SQL Server Cluster even when SSIS is not runing. So, what all you need to run DTS/SSIS package on SQL Server Cluster!! All you require is dtexec.exe or dtexecui.exe to execute the DTS/SSIS package. Apart from this, you may use SQL Agent to schedule a job to run DTS Package.

The fact is SQL Server Integration Service(SSIS) is not cluster aware service, hence it won't support fail-over. Although, if you still want to Install/Configure SQL Server Integration Service on SQL Server Cluster here are the reference
Install SQL Server Integration Services(SSIS) on SQL Server Cluster or Configure SSIS for SQL Server Cluster

How to Secure SQL Server - SQL Server Security Criteria

Security! This is the word comes in mind of every concerned person when it comes to store, access and share the data and database or database server. At times when applications are run in the geographically restricted area, there were less chance of its exploitation and with spread of internet and the availability of application over the internet, security of data, databases and database servers has become vital.

Why SQL Server Security has been so much important!!
Well, for every organization or institute or company or government has there data that is vital to them, and not to be accessed by the authorized person or entity only. And that is vital to set some security standards for such a critical data so that you can prevent your data as much as you can with proper security mechanism and set of standards within organization and in your scope for MS SQL Server Security.

I have pen down some pointers/criteria that requires serious consideration when it comes to secure MS SQL Server.

1. Guest User Account: It is always good practice to disable guest user account; this will keep our server robust from skilled user that can make use of guest user account to gain access over the server.

Skilled user always looked into a guest user account to establish a NULL session with which, he/she can compromise server.

2. Public Account: Do not grant permission to Public role, as every single user is a member of this role; hence if you grant any permission to this role it will be available to every user and that will breach security standards.

3. System Administrator Account: We would need to rename and disable System Administrator account as best security practice; to do so we need to create integrated account that has SA permissions then create users and assign them appropriate permission based on the fact who need to access what data!! One of the best practice is also to rename or disable the SA account, it is advisable that we follow this best practice. However, make sure you have one account having equivalent permissions as of SA, also advisable to remove "Built-in\Administrator" group.

4. Application Roles: While answering threads at Microsoft/Non-Microsoft Forums for SQL Server most of the time what I’ve found is developers/users/dba(s) just avoid creating and/or maintaining schemas/application roles. Actually it does lots of helps to us in terms of rework (granting and/or revoking permissions) and easy manageability of sql users. Above all if guest user is not mapped to application role of database, guest user cannot access to database object; we can audit application role’s activity also.

5. Strong Password Mechanism: This is the most vulnerable thing; if our password mechanism is not that strong, one can easily get into our box and steal our data or can do whatever he/she wants to do with; sometimes we may found users with NULL/TRIVIAL passwords. Again, this is much more critical if application is accessed over Internet we are openly inviting thieves!!!

6. Access port: By default SQL Server 2000 listens to TCP port 1433 and UDP port listens to 1434 which is known to everybody; we would need to change it to another port then default and firewall rule should be created accordingly for exceptions. SQL Server 2005 listens to dynamic port*

* Whenever SQL Server 2005 names instance starts it get port automatically, but as always you may change it to static. Refer below http://blogs.msdn.com/sqlserverfaq/archive/2008/06/02/how-to-change-the-dynamic-port-of-the-sql-server-named-instance-to-an-static-port-in-a-sql-server-2005-cluster.aspx

7. NTFS file system: NTFS file system is introduced in early 1993 with launch of Windows NT 3.5, this is the file system that has some good feature that were not available in FAT 16 and FAT 32 file system. File and Folder level security is the key benefit of this file system which also benefited us to keep our SQL Server files secure by assigning appropriate permissions.

8. Updating Server: Microsoft keep releasing service packs (SP) and hot fix time-to-time to keep software more secure, robust and bug free. It is recommended that we should update our box with latest SP(s) and hot-fix on regular basis.

9. Audit: We should enable audit for login failures and warning errors and need to be monitored on daily basis so that if any error, login failure or suspected login attempt will be notified and we could take necessary action based on the fact available in Log, this way we can foresee any probable vulnerability or can avoid it to be happened.

10. Integrated Logins: Using this feature one can assure him/herself that sql box is more secure; integrated/windows authentication* uses domain account to access server, database and database objects. Here, whenever user tries to access sql box his/her account is validated by domain controller first and then permit or denying to access the system without requiring separate login id and password; after this it will check with SQL Server for kind of permission this user(s) has.

The other benefit is one can use encrypted password, various handshake methods like PKI, Kerberos, EAP, SSL Certificates, NAP, LDP and IPSec policy; this will ensure our highly critical data are being sent securely over the network.

* http://msdn.microsoft.com/en-us/library/aa905171(SQL.80).aspx

http://msdn.microsoft.com/en-us/library/aa905172(SQL.80).aspx

http://msdn.microsoft.com/en-us/library/aa905190(SQL.80).aspx

11. Instances: We can create different Instances to isolate development/production environment from each other; and / or isolating users from accessing database which are not meant for them. This can be done by application roles/fixed DB / fixed server roles but using instances we can hide name of the databases from the users this way they don’t even come to know which databases are there on server and who is accessing which database.

12. Service account: Always use least privileged user account to start the server and agent service on the server. Domain account with the local admin privilege is enough to start the services; domain user account for services is required if we would have to work on some special services which requires network access also like replication, log shipping, mirroring, cluster, remote procedure calls, backing up-restoration on or from network and remote data access.

13. Network Library: Don’t installed and allowed network library except those are required.

14. Isolated from IIS: Though we can have both SQL Server and IIS on single machine; it is advisable to keep them on separate machine. The idea is; even if IIS server is compromise our database(s) are secure, the other benefit is if more memory and processer resource is eaten by IIS server SQL box will not suffer.

15. Stored Procedure: We should have to make a practice to wrap DML statements in SP(s) to avoid SQL injection.

16. Monitoring SQL Server and Windows Event Viewer: We shall keep out eye on SQL Error Log and Windows Event Viewer for any suspicious activity on daily basis so that we can take corrective action(s) as soon as it is identified.

17. Encrypting data: We should use WITH ENCRYPTION option to keep our code safe; and for data we could use symmetric encrypted columns in SQL Server 2005 or third party tools like activecrypt for data encryption in SQL Server 2000.

18. Linked server: Prevent access to linked server from those users who don’t need to access by assigning proper privileges.

19. System Stored Procedure(s): System stored procedures (SP) like xp_cmdshell, xp_regread, xp_regwrite needs to be restricted to access. Using this SP(s) one can easily read, modifies or deletes registry information or can manipulate system information.

20. Anti Virus: We should install Antivirus on SQL Box and exclude sql server database files; this way we can be assure from Virus/Trojan/Malware/Spam attacks on our servers that could harm our database files.

Conclusion:
As the time passes Securing data has become the most vital part, and we must agree and honor it. Because this is the information that contains our financial, social, business and historical data; and as a DBA it is our prime responsibility to make sure that this has been taken care and secure enough. These are the key points that I’ve collected so far, if anybody would like to draw my attention to some point that I might have missed out can write back there comments here.

Update: Edited point 3, added a line saying "SA" account should be renamed or disabled according to best practice. 
Updated on 2nd March 2010
photo credit: david_shankbone via photopin cc

4/27/2009

Patching MS SQL Server Cluster

Ofent I found a question in a forums that "How to patch SQL Cluster" or "Patching SQL Server Cluster"

To answer this, there is nothing so special requirement but offcourse there is one thing one should consider and that is "Always patch active/primary node first". One should run SP setup on the primary node and it will get applied on the both node, we do not need to start/stop any services this is managed by SQL Server itself.

Refer section 3.2.5 Installing SQL Server 2005 SP2 on a Failover Cluster Instance

4/20/2009

Get Discount of 25% to first 25 people for Surat SQL Server User group - TechEd India 2009

Dear Surat SQL Server User Group members,

Culminis, INETA APAC and PASS, have worked along with Microsoft to secure a unique discount for our user group members. TechEd is happening in after a period of 3 years. http://www.microsoft.com/india/teched2009/. With Steve Balmer, CEO of Microsoft is giving the Keynote, and illustrious speakers presenting.

Tech.Ed-India 2009 is all about getting yourself ready for the next wave of technology innovations and trends. In today's economic scenario, more than ever before, it has become pertinent that we stay ahead of the curve so as to establish ourselves as the future trend- setters. Tech.Ed-India 2009 - with its offering of sub-events - offers you this opportunity to interact with some of the leading lights in the business and technology space globally, talk to Microsoft product development teams directly, and get in-depth hands-on-trainings and certifications in some of the most coveted and anticipated technologies of our time.

Special Discount for Surat SQL Server User Group Members

If you are attending TechEd, as a member of "Surat SQL Server User Group" you can get a 25% discount. This discount is available to the first 25 people to respond via an email to inteched2009@surat-user-group.org the first 25 people to respond will receive instructions on how to avail the discount.
You are requested to Share your User name and email id which you use to sign in to Surat User Group Website while submitting your request.

Hey, if you are not the registered member of Surat User Group, do not worry. Get your self registered here and grab the opportunity!!!!

4/08/2009

Download SQL Server 2008 SP1

Microsoft has released SP1 for SQL Server 2008 http://support.microsoft.com/kb/968382

List of the bugs that are fixed in SQL Server 2008 Service Pack 1

3/30/2009

2009 PASS SUMMIT UNITE


Its a time to get register for the great event, yes I am talking about the the SQLPASS Summit 2009 event to be happen during Nov 2~5 at Seattle; there are lots of saying about this event and there are more then single good reason to join the event explore the reasons "Why to attend SQLPASS SUMMIT?"

Get the full details of 2009 PASS Summit UNITE and get registered

Get early bid rate, do register for your seat at 2009 SQL PASS Summit UNITE

TechNet Webcast: SQL Server 2008 Capabilities for Meeting PCI Compliance Needs

There will be a web cast on SQL Server 2008 Capabilities for Meeting PCI Compliance Needs at 1 PM Pacific Time, get register

http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032404173&EventCategory=4&culture=en-US&CountryCode=US

3/27/2009

Download SQL Server 2005 SP3

SQL Server 2005 SP3 has been released, download SQL Server 2005 SP3 here

SQL Server 2005 SP3 can be applied on below SQL Server editions:
* SQL Server 2005 Enterprise
* SQL Server 2005 Enterprise Evaluation
* SQL Server 2005 Developer
* SQL Server 2005 Standard
* SQL Server 2005 Workgroup

3/19/2009

Change the Collation setting in MS SQL Server

How to Change the Collation Settings for specific database or how to change the Collation Settings for specific column?

This question can be found multiple times on the ms sql server forums, so I've decided to pen down it on the,Simple!! Once can use Alter Database command to change the collation settings for the specific database, below is the command you've to execute:



ALTER DATABASE testDB
COLLATE French_CI_AI ;
GO
 
 
photo credit: dorena-wm via photopin cc

How to know version of MS SQL Server

"How to check which version of SQL Server I am on" this is a commonly asked question in SQL Server community; I have created a script which can be run in MS SQL Server 2000 and MS SQL Server 2005 you may download script from here
read complete FAQ on it here

3/09/2009

Community launched | Surat SQL Server User Group | DotNetChaps

Hi,

We have formed a Technical Community User Group. The aim of this User Group is to share/exchange what all we have in terms of the knowledge.

We have two separate forums for MS SQL and for Dot Net technology to avoid confusion. You may post all your queries pertaining to MS SQL at http://www.surat-user-group.org and if you are having a query in .Net (be it asp .net, c# or vb .net) please post it to http://tech.groups.yahoo.com/group/DotNetChaps/

http://www.surat-user-group.org is having an association with SQLPASS (http://www.sqlpass.org) and is an official SQLPASS Chapter.

http://tech.groups.yahoo.com/group/DotNetChaps/ is having an association with iNETA.