Friday, April 27, 2012

Load Runner important Functions: For Errors and Download Non HTML Content

There are some errors which comes usually when we tried to increase the load on server through load runner or even when no much load is on server.

Error: server has shutdown the connection prematurely

Solution: Just put the following function in init section in vugen

web_set_sockets_option("IGNORE_PREMATURE_SHUTDOWN", "1");

It will ignore the error only but transactions will be fine even after using this function

Beside this following are also some usefull function used when corresponding errors encountered :

In Init section

web_set_sockets_option("SSL_VERSION", "3"); web_set_sockets_option("MAX_CONNECTIONS_PER_HOST","1"); web_set_sockets_option("OVERLAPPED_SEND", "0");

Before submit statement

web_set_sockets_option ("CLOSE_KEEPALIVE_CONNECTIONS", "1");

Function to Set Download Non HTML Resources For Specific Request:


Before Request

web_set_option("DownloadNonHtmlResources", "Yes", LAST);


After Request


web_set_option("DownloadNonHtmlResources", "No", LAST);


Let us know if you required any other assistance for other types of errors in LoadRunner

All the Best !!!!!!!!!!!!!

Thursday, April 26, 2012

Script to rebuild all indexes in a database SQL Server

-Script to automatically reindex all tables in a database

USE DatabaseName --Enter the name of the database you want to reindex

DECLARE @TableName varchar(255)

DECLARE TableCursor CURSOR FOR SELECT table_name FROM information_schema.tables WHERE table_type = 'base table'
OPEN TableCursor

FETCH NEXT FROM TableCursor INTO @TableName WHILE @@FETCH_STATUS = 0 BEGIN DBCC DBREINDEX(@TableName,' ',90) FETCH NEXT FROM TableCursor INTO @TableName END

CLOSE TableCursor

DEALLOCATE TableCursor