Max pool .NET issue on ADO.NET and a quick solution

This is the error message you will get when pool is maxed out. Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Please try closing reader, command, connection by using close() and dispose() before using the method below. If the pooling is enabled in the application, sometime closing the connection by using Dispose() or Close() is just going to put the connection on the sleep mode (awaiting command). Even though there is connection closing statements on the application, on the database side, it was putting those connections on the sleep mode. As it built up, there were no more pool left, therefore it timed out. Solution is to add Pooling = False on the connection string of the application. This closes the connection as soon as dispose() is introduced. Hence no timeouts waiting for open pool.
Database=testdb; Server=testserver; uid=test; PWD=test; Pooling=False; Connect Timeout=30
I am not responsible if you use my solution and mess up something. Do at your own risk. Works for me here. Checking number of connections on database to see if max pool has reached …
--Total number of connections
SELECT DB_NAME(dbid) AS 'Database Name',
COUNT(dbid) AS 'Total Connections'
FROM sys.sysprocesses WITH (nolock)
WHERE dbid > 0
GROUP BY dbid;
 
--Connections
SELECT hostname, program_name, STATUS, cmd FROM sys.sysprocesses
WHERE DB_NAME(dbid) = 'Database Name goes here';
FacebookTwitterGoogle+Share

Removes the ^M character in Unix/Linux

This script removes the ^M character from the file. Mainly for those who use windows editor to edit Unix/Linux text files. I would definitely recommend VI or emacs if you are messing with Unix/Linux text files. Create a shell script file and copy paste the code below.
#!/bin/ksh
#Script to remove the ugly DOS ^M characters
 
for readfiles in $@
do
tr -d 'r' < $readfiles > $sometempfile.tmp
mv $sometempfile.tmp $readfiles
done

Fast tutorial for explain plan on Oracle

user1@testserver : /home/firestorm => sqlplus
 
SQL*Plus: Release 9.2.0.7.0 - Production on Wed Jul 2 15:27:33 2008
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
 
Enter user-name: user1
Enter password: **********
 
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
 
dbserver:SQL> @?/rdbms/admin/utlxplan
 
dbserver:SQL> truncate table plan_table;
 
Table truncated.
 
dbserver:SQL> commit;
 
Commit complete.
 
dbserver:SQL> explain plan for
2  select count(*) from schemaname.tablename;
 
Explained.
 
dbserver:SQL> select * from table(dbms_xplan.display);
 
PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------------
 
--------------------------------------------------------------------------------------------------------
| Id  | Operation              |  Name            | Rows  | Bytes | Cost  |  TQ    |IN-OUT| PQ Distrib |
--------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT REMOTE|                  |     1 |       | 26979 |        |      |            |
|   1 |  SORT AGGREGATE        |                  |     1 |       |       |        |      |            |
|   2 |   SORT AGGREGATE       |                  |     1 |       |       | 20,00  | P->S | QC (RAND)  |
|   3 |    TABLE ACCESS FULL   | TABLENAME        |   309M|       | 26979 | 20,00  | PCWP |            |
--------------------------------------------------------------------------------------------------------
 
Note: fully remote operation, cpu costing is off
 
11 rows selected.
 
dbserver:SQL> exit;