High availability is a system design approach and associated service implementation that ensures a prearranged level of operational performance will be met during a contractual measurement period.
And it could include multiple database and application server connected in a clustered environment with redundant hardware. One of the method to make ASP.NET application available even if one server goes down it so make your application connect to secondary db server in the even of failure to connect to first server.
This post is to show this concept. (I am not very proud of my programming skills and I prepared this demo app in 15 mins, to please bare with me)
This simple app connects to one DB and if it fails (or gets timeout) it connects to second db. I am using SQL Authentication and this table is same on both Servers.
I’ve used VMWare now and then for my virtual machines. And I think, it is the best virtualization software out there in market (but not anymore, I like Virtual BOX more than VMWare). When I was trying out VMWare Workstation on my new machine, I found that I was not able to use USB sticks on any Virtual machines.
When I checked services, I found that “VMware USB Arbitration Service” was stopped. I tried to start that service manually and got greeted with following message,
Error 31: A device attached to the system is not functioning.
It one of the most common issue you will face when you will move/copy your database from one server to another server. You will have all finely setup SQL Server Logins and their related database users but when you copy or move your database those Server Logins will not get transferred automatically. Result is what we call Orphan Users, these database users are there in database but there is no login associated with it. In other words they are just useless and will create various issues related to authorization if an application or users are using it.
There are many cases when you may need to manually map SQL Server Logins with database users. For example it is possible that you have different logins created in SQL Server and you wanted to use these new logins with existing users Or you might even have same logins but since they are on different machines it is very likely that they will have different SIDs (Security Identifiers) Or simply some users has left an organization and you want to assign new user existing login (which I think is more easy by use of ROLES rather than directly assigning a user) Or wanted to have different user name then server login.
For all of these condition there is a system stored proc called “sp_change_users_login“ which can be used to manually assign logins to database users. I have created a simple demo to display the concept and process of mapping existing users to new logins.
If you have been looking for job in Database related field then you might be already familiar with this age old question (which I was asked in almost all interviews) is “What is difference between DELETE and TRUNCATE ?” And usually if you read on internet you will see that people answer it with just one line that,
When you use DELETE to delete records, information is stored in transaction log and hence it can be rolled back. And when you use TRUNCATE, no information is stored in log and so you can’t it rollback.
But technically it is wrong. I mean it is true that when you use TRUNCATE it doesn’t gets logged into transaction log, but it simply wrong to say that truncate will not let you rollback your operation. Code below can explain this operation,
This quick post is about changing default port in Apache. Say if you wanted to work with IIS and Apache both. Now, both web server uses port 80 and so you can’t have both of them at the same time. So one has to sacrifice it’s favorite port . In my case it was Apache not because I am MSFT technology user but just because I am working with Apache just as sort of self improvement project and most of the time I will
want have to work with IIS. So I need to change default port of Apache listen to some other number then 80, which is very simple process.
All you need to do is to locate “httpd.conf” file and look for section where it mentions about listening port. Something similar below,
I’ve been using Windows Servers provided by MSFT for free from past few years (not by downloading from Torrent sites by via DreamSpark program) ranging from 2003r2 to the latest one 2008r2. And almost all of them have one feature that really annoys me and that is “Shutdown Event Tracker”. I simply don’t understand that who would like to fill up why they want to restart. At first (when I was in school) I thought that may be sys admins do really enter details but when I begun working I found that it is rather annoying to them as well !! It is just beyond me that why would someone really want to use this feature !!
So this quick post is about how to disable this feature in Windows Server 2008 r2. But I think it applies same to other older versions (2008, 2003 r2) as well.
All you need is to run “gpedit.msc” using RUN. It will open up group policy editor window.
Last week I was working on something where I was required to write a delete query against few records in table. Now a days I am kind of habituated to use alias for tables whenever I write any query (mostly because of tool
I am we are using for SQL development, which don’t have intellisence if alias is not being used for table name !!) and in other case it was join between two tables was required to delete records. So as with other query, I wrote my simple delete query with alias … and found that when you use alias delete statement is a bit different !!! Below is how I reproduced same issue in my laptop. (Note: Query is using a test table I created using good ol’ AdventureWorks sample database)
-- Delete from table using Alias Delete from TableFoo TF where City='Renton' go
But parsing this query gave me following error
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ‘TF’.