How can one remove idle connections that are just sitting/sleeping.
Most of the time the developers are hitting the database through some
front end app like VB, the front end app may perform a insert, update,
select, or delete after they log out you can still see their spid
in sleep mode.
Hi.. I have application which is connected to my SQL 2000 database. Normally our users use Terminal service to the SQL 2000 and application (same box) remotely and connect to the database. But some time the connection break and I have idle login stuck there.
For example, if I use sp_who, I can see many logins still login to DB even they are out. And sometimes I see duplicate logins too even there is only one person using that login to logon to DB. Is there a way to find out what is the idle timeout of the user login session??
Is that under SQL server properties -->remote server connections-->Query time-out--> >> sec ?
Is there a way to limit only 1 session can be allow for each login ??
I am using MS JDBC driver 2005 1.2 and in-house written connection pooling that was working fine for a number of years. This combination worked OK with SQLserver 2000. But recently we switched to SQLServer 2005 (x64) on WIN Server 2003 Standard x64 eddition. Everything seems work OK during business hours, however, after business hours when there are lesser users and connection stays idle for sometime, I am getting the following error:
com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.setAutoCommit(Unknown Source)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
Any help would be appreciated
thanks in advance
Should these two stats added together give me the time (ms) since SQL Server has been restarted? Maybe I don't understand but @@cpu_busy is the amount of time sql server has accessed the cpu and @@idle is the amount of time sql server has no cpu activity. When I add these two figures together, I don't get the total amount of time (ms) SQL Server has been running. What am I not doing? Any help is appreciated.
If a user not doing in the database for more than 30 minutes i want
to disconnect his connection.
Kindly help me
Hello everybody,I have a ASP.NET (3.5) Web site which uses an data connection to my Sql Server 2005 Express. When I browse in my data-driven pages of my website, I am satisfied with the performance. But when I try my website after a long break, e.g. in the morning, the data-driven pages take a long time to come up, about 10 seconds. After this gap, when surfing on the other pages, there is no problem. It is only the first page. So it seems that my SQL Server goes "to sleep" after a certain time of idle.First I read a post about this problem which came up with the user instances of Sql Server. So I got rid of my user instance and set up my database "normally". But still I have that performance gap.I am using Linq To SQL and a couple of ListViews. I am totally confused how to manage this problem.Any suggestions?Thanks in advance,Hannes
We got this message on our production server event viewer for source MSDTC.
"String message: Session idle timeout over,tearing down the session"..
Even though it is marked as informational, just wanted to know what it is?..
We have a situation where people just login run complex queries and then just don't shut off their query analyzer of apps.
Some of these chew up a lot of CPU cycles and unless we kill the query the CPU cycles are not released.
I see some of them are idle for over 1-2 hours or more, their last_batch would be at least 2 hours old.
The question is, "Is there a setting in the sql server whereby we can automatically disconnect idle threads?"
Is it possible to stop the server from going to sleep when it is idle to improve responsiveness to new connections?
Is there any parameters/procedures one can use to remove idle client connections (sql65sp5a)from the server or odbc side?
The only parameter that looks like a remote possibility is
remote conn timeout, but this appears to work server to server?
I have been seeing this issue for several weeks now. The distribution agent will become idle even though there is activity occurring within the replicated database. If I manually start the distribution agent, it will begin retrieving the transactions. I thought that this might be due to inactivity but I have modified the inactivity threshold and I am not receiving an actual inactive agent warning. There are no warnings -- it simply sits there and does not resume sending transactions.
Any thoughts? This is a transactional replication with a distribution agent that is run at the subscriber.
I have been looking at the new DMV's prefixed with dm_exec_....and found a limitation with them.
Books online says sysprocesses is replaced with sys.dm_exec_connections, sys.dm_exec_requests and sys.dm_exec_sessions. The problem I came accross is identifying any sessions connected to a specific database which were idle. This is the sort of thing you need to know if you tried to restore a database and it says the database is in use.
I wonder if this is a bug or by design?
Does SQLServer go to sleep when it's been idle? How can I connect without an error?
I have SQLExpress on a server. Server Name is SqlExpress. I have 2 DBs on that server... Tuna & Guppy. I'm connecting to the DBs from a remote PC which runs my App... an exe created with Visual Studio 2008, Visual Basic.
If I run my App at say 9:30PM, after the server has been idle for several hours, I get a "Can't open connection to Guppy" error, which is my error message when the connection attempt fails. If I quit & relaunch the app, it connects fine, and will continue connecting fine unless you leave the server idle for serveral hours again.
If I'm developing a 2nd app all evening... which connects to a 2nd DB...Tuna, that activity seems to keep the SqlServer awake and then launching the 1st app at 9:30PM connects to Guppy just fine.
I tried adding a "Connection Timeout=30" to my connection string but that did not help.
My connection code is as follows (note the server's name is SQLExpress):
Dim strConnG As String = "Data Source=SQLEXPRESSSQLEXPRESS;Initial Catalog=Guppy;Integrated Security=True;Connection Timeout=30"
Using ConnG As New SqlConnection(strConnG)
'open Guppy connection
Catch ex As Exception
MsgBox("Can't open connection to guppy")
'Code that does stuff
Can anyone tell me how to fix this so I can connect without error, even if the server has been idle?
I've noticed that after the database have been idle for some time, it takes up to 10 seconds to get it started when something needs to access it. In the event viewer it says that the database <name> have been started.
Obviously, there is some idle timeout setting.
I saw an option in the database properties that is called "Auto Close" which is set to true. I assume this is what i'm looking for. Can someone confirm that? (it could take some time to test myself...)
But what i'm actually wondering is:
1. Is it possible to adjust how long it would wait before timing out?
2. What advantages does closing the database bring? Does it free up (a noticeable amount of) ressources? Or is it only that it's unlocking the files, so that it's possible to copy the database source files?
Just upgraded to SQL Express 2005 from MSDE for Firehouse. Upgrade went great and the db is accessable and running fine. Except when not used for a while. Then I need to restart the db to allow connections of any kind. If I don't I get an error that the db is not accessable and I can't connect. Everything runs fine after until it goes to "sleep" on me again. We upgraded to make use of the 4GB limit as we were at 1.9GB and MSDE was getting a little unhappy.
Any suggestions? Is this a "feature" and if so, is there a script I can run to kick it into working mode again?
I want to implement "Auto disconnection" (or kill) of user session that exceed a specified idle duration in SQL Server 2005.
I know how do that in oracle by creating a profile and set the IDLE_TIME paramter and asign that profile to all users. But in SQL Server i don't know how to do it.
Can anyone help me.
I have this strange problem... After every time my application leaves sql-server idle (doesn't send anything, doesn't retrieve anything) next command to sql-server processes really long.
I've also noticed this bug/feature/misconfiguration even if I open a DB in Management Studio...
Please, could someone tell me, is there any timer that "puts a DB to sleep" if no one is using it for some time? Can I change the way server behaves in this situation?
Auto Close Idle helps you utilize your multi-user concurrent users licensesmore efficiently. It closes unattended clients remotely after a certainperiod of time or manually. Furthermore, clients can close the most idleuser automatically without the need for the administrator's intervention.For more information visit our web site...http://www.autocloseidle.com
We have a new sales force automation application for sales rep to log their contacts, etc. It runs on mssql 6.5, sp 4.
They log in and leave their connections on without logging off or leave their coonections idle .
We set the user connections fiarly high but we are concerned that the max amount of user connections weill be consumed and the sql serve becomes locked.
My questions are:
1) Is there any parameter in the sql server configuration that will log off idle users have a certain time and dsiconnect them?
2) A backup of the database will be made each night. If there is no parameter, would it be a good idea to stop and start the sql server every night to release the idle connections?
3) If so, how to stop sql server from the commadn and start it with a command line command and do this in a batch file as a scheduled task?
4) Is there any other way to release these idle connections each night?
Any information you can supply will be appreciated. THanks.
Here's the DB Connection code for a site (Web.config file)
I was wondering how I could specify an idle timeout or orphan timeout.
I tried idle timeout=x and kept getting errors
Size=5;Max Pool Size=150;"></add>
I added a connection (ADO.NET) object by name testCon in the connection manager - I wanted to programmatically supply the connection string. So I used the "Expressions" property of the connection object and set the connectionstring to one DTS variable. The idea is to supply the connection string value to the variable - so that the connection object uses my connection string.
Then I added a "Backup Database Task" to my package with the name BkpTask. Now whenever I try to set the connection property of BkpTask to the testCon connection object, by typing testCon, it automatically gets cleared. I am not able to set the connection value.
Then after spending several hours I found that this is because I have customized the connection string in testCon. If I don't customize the connection string, I am able to enter the "testCon" value in the connection property of the BkpTask.
Is this an intrinsic issue?
I have a package that uses a for loop to iterate through an unknown amount of excel files and pull their data into a table. However, there will be cases when the file is corrupted or has some sort of problem so that either the transformation will fail or the excel data source will fail with an oledb connection error.
Could anyone suggest a clean way to trap these errors? Specifically, the "Cannot Aquire Connection from Connection Manager", which is the excel connection.
I have some questions about connection strings.
Note that I am using the "SQL Native Client OLE DB Provider", SQL Sever 2005 Express, ASP.NET, C#.NET, and VS.NET 2005.
Note that I do not want to use the "Attach a database file" type of connection string.
Note that I am using the site http://www.ConnectionStrings.com as a reference.
Note that this "Standard security" connection string...<add name="LocalSqlServer" connectionString="Server=MYTESTOFFICESERVERS;Database=MyDatabase;Uid=MyDatabaseUser;Pwd=MyDatabasePassword;" />...does not work and causes the following run-time error...A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)
Note that this "Trusted connection" connection string...<add name="LocalSqlServer" connectionString="Server=MYTESTOFFICESERVERS;Database=MyDatabase;Trusted_Connection=yes;" />...works but is less-than ideal because it uses a Trusted Connection rather than a Username/Password combination.
(A) What exactly does the error in Item 4 mean?
(B) Do 4 and 5 imply that one must use a Trusted_Connection for all SQL Server 2005 Express connection strings when the database does not reside in the web application's App_Data folder or use a "Attach a database file" type of connection string?
(C) Are there any alternatives?
(D) What do you suggest?
-- Mark Kamoski
is there a way to get the references of connection managers from within a custom data flow task during runtime?
control flow tasks the connection service object can be used to get the
references to connection managers. For data flows I haven't found a way
Where can I get a sample for a custom connection manager which is explained here
My installation for sample codes does not contain connection manager samples.
When running the project in debug mode or non-debug mode, I get the following error from MS Visual Studio:
TITLE: Package Validation Error
Package Validation Error
Error at Package [Connection manager "SYBASE_CONNECTION"]: The connection manager failed to defect from the transaction.
We are using the Windows Task Scheduler as a substitute for the SQL Server Agent, which isn't available in the Express edition. The scheduled task just calls a batch file, which in turn, runs a stored procedure using osql with the -E option for a Trusted Connection.
SQL Server Express has been installed using the defaults, which means the service is running in the "NT AUTHORITYNETWORK SERVICE" account. The scheduled task we create is set to run using the "NT AUTHORITYSYSTEM" account.
Now we find that on Windows Vista (tested using Ultimate Edition) that the scheduled task fails to run the stored procedure until the machine is rebooted the first time after installing SQL Server Express. When I say "fail", I mean that the stored procedure isn't executed. The scheduled task however completes and reports no errors. On Windows XP, we do not run into this problem so I suspect it has something to do with the UAC in Vista?
We further found that after installing SQL Server Express and creating the scheduled task in the "NT AUTHORITYNETWORK SERVICE" account, the scheduled task (and stored procedure) runs fine WITHOUT requiring a reboot.
Can anyone explain why a reboot is needed to get SQL Server Express to run the scheduled task correctly under Windows Vista and the SYSTEM account?
Any help or thoughts greatly appreciated.
I'm having a BIG problem, this is my 3rd day looking for answer !I'm trying to create a custom membership provider with MS SQL database 2005 but not the default ASPNETDB. I've changed the web.config to be as following:<connectionStrings><add name="sqlConn" connectionString="Data Source=.;Integrated Security=True;Initial Catalog=ASPNETDB;"providerName="System.Data.SqlClient" /></connectionStrings> <system.web><trace enabled="true" /><roleManager enabled="true" /><authentication mode="Forms" />
<membership defaultProvider="MySqlProvider"><providers><remove name="AspNetSqlProvider"/><add name="MySqlProvider" connectionStringName="SqlConn" type="System.Web.Security.SqlMembershipProvider" applicationName="/" /></providers></membership>
But when I try to login to the site using the login control the following error occurs:
Server Error in '/etest' Application.
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.Source Error:
Line 149: <roleManager>
Line 150: <providers>
Line 151: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 152: <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 153: </providers>Source File: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Configmachine.config Line: 151
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.213
It is clear that this is a prblem with my Machine.Config file - since I've "worked!" on this file for a while. But when I've checked the Machine.config file I've found the LocalSqlServer connection it is talking about! .
I'm lost and I dunno what to do, can anyone help?
Here is the mahine.config in case if you need it:<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" /></connectionStrings>
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=184.108.40.206, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /></DbProviderFactories>
<processModel autoConfig="true" /><httpHandlers />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /></providers>
<providers><add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /><add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
When I create a new odbc connection to a SQL server 2005 Db I get a failure telling me dat de SQL server does not allow remote connections.
How can I allow the server to allow this.
Any help appreciated
When using jdbc with IntegratedSecurity, I run into this problem when the machine is not part of a domain & gets its IP address via dhcp. Is this expected behavior or a bug in the jdbc driver.
The SQLServer and client application are installed on the same machine and a local admin is logged in, running the client app.
If I change one of the two parameters mentioned above, the connection can be established leading me to believe this may be intentional for security issues. Am I correct?
I am accessing SQL2005 with C# code using OleDbConnection.
A try and catch block catches the following error once a while between the Open() and Close() of the connection:
ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
I do not even have any idea where to start to debug this. The ExecuteNonQuery() runs a delete SQL query. It works 99.9% of the time. I do not see anything wrong when this error happens.
Any hint would be greatly appreciated.
i am getting this exception i.e."
The TCP/IP connection to the host has failed. java.net.ConnectException: Connection timed out: connect" whenever i try to connect to the remote DB which is present at a different system.
I have a Rounding error: Between flat file connection manager Source & OLE DB Connection Destination (SQL Server 2005) in my Dataflow.
File looks like this lets call column names Col A,B,C,D
70410000 RD1 1223631.92 196042.42
70329000 ICD 11025.84 3353.88
71167300 COL 104270.59 24676.96
flat file connection manager settings: first row Column names then Advanced tab Col A float , Col B float , Col C string ,Col D float ,
OLE DB Connection Destination (SQL Server 2005)
CREATE TABLE [dbo].[PT_CUST_ABR](
[PARTY_NO] [float] NULL,
[PARTY_NAME] [varchar](75) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TELECOMABR] [float] NULL,
[GENIABR] [float] NULL,
Problem: ColA (Source) Rounding error to PARTY_NO (Destination)
I have a field of text of in a flat file that the flat file connection manager Source picks up correctly €œ70000893€?
However when it gets the OLE DB Connection Destination the data has changed to 70000896. That€™s before its even Written to the database.
The only clue that something is wrong in the middle is the great Data viewer shows the number as 7.000009E+07
Other clues looking at the data it appears there is a rounding error on only the number that dont end in 00
ColA (Source) PARTY_NO (Destination)
Any ideas people?
Thanks in advance