Classic ASP MSSQL Moved to IIS8. Query Timeout expires - sql

We have two servers - One Windows 2012 server as a web server and one Windows 2012 server as a SQL server (Web Edition)- using the private IP address between them. We have production sites running on this platform fine using reasonably small databases etc.
Today we moved another website over to this setup. The site was running on a Windows 2003 server with a SQL 2008 Server (Web Edition) with no real issues, just the server was getting old and cranky.
I'm no MSSQL DBA but can handle most simple things fine. Here's what we did.
Took a full backup of the database on the source server - it is using Simple recovery.
Copied the DB to the 2012 server and restored it, created a user and assigned permissions to the tables and SPs etc.
Set up the site - which is a classic asp site on IIS8 and used the following connection string, which we've been using on the other sites on the new server:
objDBConn.Open "Provider=SQLOLEDB.1;Password=XXXX;Persist Security Info=True;User ID=XXXX;Initial Catalog=XXXX;Data Source=10.183.5.120;Network Library=DBMSSOCN"
The site started up fine and connected to the database, but some pages were running very slow and eventually timing out:
Microsoft OLE DB Provider for SQL Server error '80040e31'
Query timeout expired
It seemed to be more on one particular table than others. It's a large database - 3GB data excluding any log. But there was no issue with this on the old server.
We switch the A record and people started hitting the site. The site gets a couple of thousand visitors a day.
Over the course of the next couple of hours, any pages using the connection were getting less responsive until nothing and timing out.
Increasing the connection query timeout helped sometimes - but it had to be set to some crazy amount of time.
It ended with me calling Rackspace and rebooting the SQL server. On reboot the site appears to be functioning OK now. But I am concerned that we don't know what caused it.
Has anyone come across this type of issue in a similar situation?
Haven't got the cash for some crazy $400 / hour Rackspace SQL DBA for sure.

Related

SQL Server 2012 , lost access to database

I have experienced a weird issue a few hours ago and i cannot seem to figure out what has caused this problem.
I have SQL server 2012 installed on a windows server 2012 virtual machine.
I have windows services, Windows applications and web sites accessing a database on this server.
all applications lost access to the database for +/- 10 minutes and it suddenly just came back up again.
during that ten minutes i managed to log onto the SQL server remotely and open management studio and access all the databases but the applications still could not connect.
The database did not go into single user mode, the CPU and memory was normal, i could ping the server from my desktop.
I looked at the event log and SQL logs but couldn't find anything related to why the database could not be accessed.
I am baffled I've been trying to figure this out for the last 2 hours and i not getting anywhere.
I would appreciate any assistance
Thanks
run the dbcc checkdb command. This will check the database and tables for any corruption/errors.

SQL Server 2014 Standard 2014 no access and bad preformance

My company looks after a server which is running SQL Server 2014 Standard Edition. The main application database on the server is replicated out to about 20 subscribers. The server has only been in operation for about a week and at the time of setting it up we moved the existing database and replication across from the old server. At that time we also changed the recovery model from Simple to Full.
The performance of the server hasn't been particularly good so far, even though it has 24 logical processors and 32 GB of RAM. However it seems to be SQL Server that has been performing badly due to locks etc. according to the event logs.
This morning we couldn't access any tables in Management Studio and after a period of time we decided to try restarting the service. The service did not seem to stop properly and we were forced to restart the server. After restarting the server everything seemed fine until we tried to expand out the 'Databases' tab in Management Studio. It just says 'expanding...' in the UI and after several minutes brings up a timeout error message. After clicking ok on this message we can browse all the system databases as normal but the main application database is not shown.
One of the problems that has come to light is that the log file has grown extremely large (over 1 TB).
This is a major problem now as you can imagine, since we cannot connect to the database to shrink the log file and no applications can connect to the database Connecting to the database using 'sqlcmd' doesn't work either. We can't 'open' the database.
Look forward to hearing if anyone has come across this before and knows of a solution.

SQL Server does not exist or access denied (intermittently)

I use a Microsoft Access 2010 front end with linked tables on an SQL Server 2012 installation. Local network.
When Access Starts, a VBA script runs which connects to the SQL server and performs some checks.
I recently upgraded from SQL Server 2008 to 2012, that's when the connection between client and Server started to fail intermittently.
When the connection between my client and the server fails, I see a generic message "SQL Server does not exist or access denied". This is covered in a Microsoft support article http://support.microsoft.com/kb/328306. The potential causes detailed in that article do not match the trouble I am encountering.
This connection issue is intermittent. The trouble arises about 3 times a week and lasts for about 30 minutes at a time. Between these 30 minute failures, the the system works perfectly.
My Current VBA Connection String: (have tried several, trouble persists with all of them):
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
conn.Open "Provider=SQLOLEDB;Server=Server3.companydomain.local;Database=My_Database;Trusted_Connection=Yes"
I hope that I can find something in the SQL Server Logs (which I do have access to) but I do not know which Log file to investigate.
I do not have a direct answer to your question, but I believe you could start by exploring the IP and ports on which the SQL server is listening to...Is is possible that the machine using DHCP to assign IP for the DB server as well? In this case I guess it could happen when the IPs are refreshed.
We had a similar issue where multiple IPs were getting assigned on the same machine (having multiple NIC connected) which created such intermittent disruptions.
Well it's been 7 months. Here is the solution for this problem (in my case):
My secondary DNS Server was an external Server. It could not look up my database (192.168.x.x) because this is an internal address.
When My application called the Primary DNS Server to look up the SQL Server address, it worked fine. When my primary DNS was busy, and the application failed over to secondary DNS- the request would time out. There are many reasons someone may see this error. That is the reason I was seeing it.
It's a little strange, but I've found I get this error when I don't have proper "CLOSE DB CONNECTION" type code on my site. And then when too many users hit the site, I start getting this error.
Solution: Do a hard Close of DB connections, after every db call. Yes, most DB Connectors have cleanup routines, but it's not enough under heavy load.
Also, implement a high DB connection limit in the web.config

ASP.NET MVC 4 Website not allowing URL to query the database on the production Server

This is the one the weirdest problem I have encountered with ASP.NET MVC 4 Website. The Website works perfectly on the development server, and when I originally deployed it to the production server it gave no problems. I made a few changes with the store procedure that it uses, and upgraded the Website on the production server, however this is where my problems begin. It works fine on the development server (VS 2012 for Web), but when I run it on the production server (Windows Server 2008 R2 (SE) with SQL Server 2008 Standard Edition) it refuses to allow me to query the database using the URL with a name value pair. eq. http://myexample.com/Home.aspx/Document?code=46 Why does this happen? I am clueless. By the way I checked the security for the logins in MS SQL Server, plus it was working before I upgraded the Website. All I want it to do is fetch a pdf document from the database and download it to the client workstation.
When you have check all angles, such as permission rights and the logic in the code and yet the problem still persist. Do a restart of the database server instance. That may just fix the problem.

Sql 2005 Express edition slow connections

I'm running SqlServer 2005 express edition on my laptop for development purposes. It seems that when I open a connection to the database, the setup time is REALLY slow. It can take up to 10 seconds to get a connection. I usually have multiple connections open at the same time (Profiler, Development environment, Query Analyser, etc.) I have a hunch that the slow times are related to the fact that I have multiple connections open.
Is there a governor in Express edition that throttles connection times when multiple connections are made to an instance?
Update:
My workstation is not on active directory, and SQL is running mixed mode security. I will try the login with sql authentication. I am not using user instances.
Update2:
I setup a trace to try and figure out what is going on. When the connection to the database is opened the follow command is executed:
master.dbo.sp_MShasdbaccess
This command takes 6 seconds to execute.
I figured it out. The problem was I had multiple databases with AutoClose set to true. I shut it off in all my databases and the problem went away.
see this article for more info.
Are you sure the connection is the bottleneck? Is it your conn.Open() line that is taking 10 seconds?
AFAIK there's no governer anymore in SQL Express.
Now, are you on a Windows Active Directory Domain? If so, there might be an issue with your DNS or something that means the connection to the domain controller to validate your logon to the server instance is taking the time. I suggest you experiment switching the server over to use SQL Security, give the SA account a password, and try logging in as SA and see if that makes a difference.