Friday, March 8, 2013

Cross domain access via windows authentication for SQL server



“Ohh.. eh… Why I cannot connect to this SQL server with windows authentication hosted on other domain. I tried everything but that is not working. :( :( ”
Ever caught in a situation like this?
Once I was also caught up in a problem similar to this one. I needed to access SQL server hosted on other domain and we had only one server from which we could access that and the number of people using the server was very high 5-6. So, it was not possible to login into machine simultaneously.
We then find a solution to launch SQL server client at our local desktops under that other domain. That invocation under separate domain is a bit tricky and works on “RUNAS” command.

All one have to do is follow below mentioned steps:

1.       Open command prompt
2.       Type following command RUNAS /user:<Domain name>\<Username> /netonly ssms
e.g. RUNAS /user:otherdomain\myuser /netonly ssms
3.       Provide username and domain in above command as shown in example
4.       Press enter
5.       Enter password when asked as displayed in below screen.
6.       Now your SQL server management studio will launch. Provide the database name hosted on other domain in the server name.
7.       Select authentication as windows authentication. It will display your local domain, ignore that.
8.       Click on connect
9.       On first attempt you might get timeout error but on second attempt you will be able to connect directly.

Monday, March 4, 2013

Load testing: JMeter part 2

Using JMeter for a Simple Test:
Let’s see how to run JMeter now. We will conduct a simple test to set up a test plan and stress test a Web application. Before proceeding with the test we need to have a test plan first which will help the JMeter to perform the testing in steps. There are several elements in a test plan like thread groups, listeners, assertions, sample generating controllers, logic controllers etc. Well, these elements will be described later. One point to remember here is that a test plan must have at least one thread group having all other JMeter elements which is the starting point of a test plan. All of the other threads created by the JMeter to simulate simultaneous users will be controlled by this thread group. Let’s go through the steps now. 

Monday, January 21, 2013

Load testing- JMeter Part 1


Load testing focuses on simulating and often exceeding your expected production load, throwing many concurrent requests at your site for an extended period of time. The key to load testing is realism. You need to know your application and your audience well, so that you can balance your load across your application in a way that closely mimics your actual or expected production traffic.  

Tuesday, January 8, 2013

Transaction log full error on MS-SQL Server

Working on SQL Server, ever seen this error message:

The transaction log for database 'mydatabase' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases

When this error encountered you will not be able to do any updates to your database and will remain stuck. The point interesting here is that this troubleshooting information provided with this error message is of very less use.

Lets dig into this error to find the cause and solution for this problem.


Cause:
    This error suggest that the transaction log is full. We should understand this differently. The disk space on the drive where this database is hosted is full and SQL server is not able to write into transaction log. This normally happen when the transaction log file grew much larger.

There are many options to solve this problem.

1.      Quickest resolution for this is to clean-up some disk space by deleting few unnecessary files (if you are able to find anything). This is just a temporary solution and soon you might got hit with this error again if you have not configured any clean up task in SQL Server.
2.      The other way is to shirk the database by simply by right click menu. Remember always,
a.       You have to first take a backup of your transaction log for disaster recovery.
b.      You have to detach the database prior to shrinking else it will throw an error. This can also be done from right click menu 
3.      The third method is only recommended to use if you are not planning to recover your database (normal in development environments). The method is to set the database recovery model to simple. Can be done by following path in SQL Server.
           
            Right click on DB name from object explorer-> properties-> Options-> Recovery model->                    Choose “simple” from drop down. (See screenshot below)           



      Once the recovery model is set to simple you will be able to truncate existing transaction logs and  they will not grow in future.