Issue with System.Data.OracleClient and ODP.Net 11g together used in .net 2.0 web site - odp.net

In our .net framework 2.0 based application we were using System.Data.Oracleclient and now migrating to ODP.Net, the volume of the project is too high,
so we cannot do the entire migration on one go, as a result the application is using 2 providers System.Data.Oracleclient & ODP.Net as of now.
Now we are changing our OS, from Windows xp 32bit to Windows 7 64bit. While doing so we observed the following,
1) A query executes in < 1 sec using System.Data.Oracleclient & ODP.Net 10g 64bit (Oracle.DataAccess.dll version 2.102.2.20).
and the same query executes in < 1 sec on Oracle SQL Developer v1.5.
2) However the same query is taking 2-3 mins to execute using System.Data.OracleClient with ODP.Net 11g 64bit (Oracle.DataAccess.dll version 2.112.3.0).
we found a remarkable performance degradation in point 2),
we have to use System.Data.OracleClient with ODP.Net 11g 64bit (Oracle.DataAccess.dll version 2.112.3.0) on Windows 7 64bit OS,
but we cannot live with the performance degradation as mentioned in point 2),
and we cannot convert all code which uses System.Data.OracleClient to ODP.Net very quickly.
So can anyone help us, on why do we see such remarkable performance degradation as mentioned in point 2), and what do we do to resolve this problem.
Regards
Sanjib Harchowdhury

Adding the following to your config will send odp.net tracing info to a log file:
<oracle.dataaccess.client>
<settings>
<add name="TraceFileName" value="c:\temp\odpnet-tests.trc"/>
<add name="TraceLevel" value="63"/>
</settings>
</oracle.dataaccess.client>
This will probably only be helpful if you can find a large gap in time. Chances are rows are actually coming in, just at a slower pace.
Try adding "enlist=false" to your connection string. I don't consider this a solution since it effecitively disables distributed transactions but it should help you isolate the issue. You can get a little bit more information from an oracle forumns post:
From an ODP perspective, all we can really point out is that the
behavior occurs when OCI_ATR_EXTERNAL_NAME and OCI_ATR_INTERNAL_NAME
are set on the underlying OCI connection (which is what happens when
distrib tx support is enabled).
I'd guess what you're not seeing is that the execution plan is actually different (meaning the actual performance hit is actually occuring on the server) between the odp.net call and the sql developer call. Have your dba trace the connection and obtain execution plans from both the odp.net call and the call straight from SQL Developer (or with the enlist=false parameter).
If you confirm different execution plans or if you want to take a preemptive shot in the dark, update the statistics on the related tables. In my case this corrected the issue, indicating that execution plan generation doesn't really follow different rules for the different types of connections but that the cost analysis is just slighly more pesimistic when a distributed transaction might be involved. Query hints to force an execution plan are also an option but only as a last resort.
Finally, it could be a network issue. If your odp.net install is using a fresh oracle home (which I would expect unless you did some post-install configuring) then the tnsnames.ora could be different. Host names might not be fully qualified, creating more delays resolving the server. I'd only expect the first attempt (and not subsequent attempts) to be slow in this case so I don't think it's the issue but I thought it should be mentioned.

please refer this link, or just replace ODP.Net 64bit component with ODP.Net 32bit, as we are using asp.net we could easily configure our application to run using the 32bit component in Windows 7 (x64) edition.

Related

SSRS 2005 export to PDF never ends

I have a case where the Reporting Services takes an infinite amount of time to export to PDF for huge number of pages; around 1600 page.
Exporting to excel works fine for this amount of pages, but to pdf, it does not. I tried to increase the virtual memory, it still did not work.
I am using Reporting Services 2005. Would upgrading to a newer version fix the problem? What alternatives do I have (even if upgrading is a solution, since my client is not ready to upgrade).
It’s worth noting that the server used by my client has very good specs in terms of memory, processor…
Thank you.
Roy Helayel
This is a known issue with SQL Server 2005 Reporting Services. SQL Server 2008 introduced much better performance for generating large reports (see this MSDN forum thread). If generating large reports to PDF is a requirement for your client then they should consider upgrading to a newer version of SQL Server.

Project using two different versions of SQL Server

I am a junior developer and about to get my feet wet in my first "real" project. However we are trying to figure out a way to set everything up as the current developer lives out of country.
I was told to install certain programs, subversion clients and SQL Server 2000.
It does not seem that SQL Server 2000 can be installed on Windows 7. Are there inherent issues with me developing in a higher version of SQL Server like 2005? Is there an issue with stored procedures that can not be properly translated from on SQL Server version to another?
Again, I'm fairly new at this; please let me know if this is just a bad idea, impossible and any other guidance you can provide.
There are many features in newer versions of MSSQL that were not there in 2000 (multi-row inserts, newer hashing algorithms, and VARCHAR(MAX) to name a few). If you're using SQL Server Management Studio, it will not check these differences for you, even if you are connected to a SQL server 2000 database - it automatically uses 2008 rules for its syntax highlighting. Because of this it's easy to accidentally write code that's not 2000-compatible.
As far as getting 2000 running, if you have the install disk for an older version of windows, you could run a VM (http://www.microsoft.com/windows/virtual-pc/) and install the database server there. If your company has a separate development environment, you could create a copy of the production database to work off of as well.
The newer versions of SQL server bring new language and database features, if you write something using a feature that is available in SQL 2005 and not 2000 i.e. PIVOT then when you try and promote this to live then it will just get a syntax error.
There is no translation, if you went back in time 11 years, you'd still speak English you'd just get an odd look if you talked about 'Tweeting'.
You can set the database compatibility level to an earlier version for the specific database you are working on. This will stop you using the more modern features.
For the most part, you won't run into issues is you're simply running standard stored procedures and SQL statements.
However, there are several things that might not work properly if you're not in sync. SQL2005 was a relatively major upgrade and instroduced quite a bit of new functionality.
I don't know what you've got for available resources - dollars, etc, but if you have an MSDN Subscription at a level that provides you access to operating systems, then I would strongly recommend setting up a virual machine with an older version of Windows using your MSDN licenses, just to keep things on an even playing field.

Possible Server Improvements?

I need an expert insight to my problem. most of my experience is development so i dont have enough grasp regarding server issues or maintenance. Main problem is when traffic is high request to this SQL server times out. there are several applications connecting to this server, some are web some are windows app. i would like to know if i need to do hardware upgrade(more ram, more hdisk space and how much of each is enough) or SQL server maintenance (rebuilding index, SP enhancement, denormalization etc.) or both?
OK first let me give you some specs of the server i'm having trouble with.
OS: MS Windows Server 2003 Standard
Version: 5.2.3790 SP 1 Build 3790
System Type: x64-based PC
Processor: EM64T Family 6 Model 15 Stepping 6 GenuinIntel ~2993 Mhz
RAM: 8gb
free C: space: 400mb
SQL Server Soft. Ver.: Sql Server 2005 Developer Edition
hope info above is enough for a diagnosis. my main concern initially is the available space in c:. also i'm looking at the RAM, i use perfmon and when traffic is high its reaching its max. as for CPU i have no idea but sometimes its running at 100% but its not always like that so i think its normal.
next question i think will be pointless because i cant give you sql db details but i will ask anyway. Will reindexing help or SP optimazation and to what extent? db is at 50+gb now
do we need a new server(hardware)?
Will Updating the sql server software help? from 2005 to 2008? is there an issue when your SQL server prod is only dev edition?
when you have an issue like this what could be the default fix or quick fix if there are any..
I hope an experienced Sys. Ad. or DBA or some programming god have pitty on me and enlighten me regarding this problem
Thanks in advance.
The first step would be to provide more useful information in your question. How does the server behave under pressure.
Use perfmon and or Sql Profiler http://msdn.microsoft.com/en-us/library/ms187929.aspx to log a number of data points while it is under load.
Also see Performance tuning with SQL Server and https://serverfault.com/questions/4700/how-to-do-periodic-sql-server-performance-monitoring-and-troubleshooting

SQL Server 2008 express performance in production environment?

I am about to move servers and i was talking to somebody and they suggested using sql server express 2008 installed on the servers. I have full access to the server.
Does this express engine work at the same speed (performance) as a true sql server 2008?
I know about the limitations i..e max 4 GB per DB ... and max 1 GB of ram... Considering the server has 2GB installed and is shared with windows... i don't see this being a problem but would love to hear some feedback..
I have around 4 dbs .. and they have maybe 4 users logged into them at the same time, its not a great deal of use really...
What i really trying to mesure up is if i should installed SQL SERVER 2008 FULL version on the server or express..
Any help with a choice would be really helpful.
It appears express uses the same DB engine as the FULL version ...
I don't need any clever replication, clustering or things like that...
But i want to go down the right path ...
Any help really appreciated
Express is the same code as the other SQL editions (Workgroup, Standard, Enterprise/Developer and Data Center). The only different code base is the 'CE' edition, that is based on the mobile SQL CE code. Express has the restrictions you already enumerated (DB size, RAM) and also is using only one scheduler, so in effect will use only one CPU core. Also certain features are restricted in Express, like certain replication scenarios. The biggest advantage is that customers can start with Express and if they out-grow its capabilities they can swap in a higher edition without any application change, the database files are interchangeable between all editions, including Express.
Its the same engine, but I found you have to fight it all the way in making it anything but a desktop-environment database, from management to tcpip configuration, etc. And of course, it has built in limits on database size and resource usage. Once it is configured the way you want though, it runs fine. In real production settings I find the lack of SSIS quite the killer, though.
So the bottom line is that it is usable, but not great. You might also consider the Workgroup edition, which is reasonably priced and less limited, but of course it is more expensive than free.
Just to add to this SQL Express 2008 R2 can use multiple cores (but only 1 CPU).
You'll probably be fine with Express. It's the same basic engine. If you ever want to upgrade, the process should be rather painless.
you should be fine, performance should be similar to full version in your case since your databases are small

Profiler for Sql CE

i wonder if there is something similar to Sql Profiler for Sql Server Compact Edition?
i use SqlCE as backend for a desktop application and it would be really great to have something like sql profiler for this embedded database.
or at least something simliar to the NHibernate show_sql feature...
any ideas?
thanks
j.
The only tested solution I know of that could solve this problem is Altiris Profiler which is a tool I designed at my previous job, but is closed source and not-for-sale.
The way you would hook it in, is by creating a factory for your commands and proxing them for profiling purposes before using them (using RealProxy). Its really light weight and about 10 lines of code to implement.
On my question Flory talks about a new tool called dynaTrace that may also be able to solve this problem as well.
I don't think that would work - CE seems like a totally different beast.
You can enable some logging that might help you:
http://msdn.microsoft.com/en-us/library/ms171949(SQL.90).aspx
I tried to do this and managed to set the database up and connect from SSMS - you have to specify the alternate connection type of 'SQL Server Compact Edition'. Profiler has no such thing - and entering a path to the datafile for the 'database' field did nothing.
Try to install a Standard version (with the profiler) and you might be able to connect to the CE instance also.
I think that its possible that it could be done using the Default Profiler Trace Template (from Visual Studio 2008). I talk about using the template for a non-CE version of SQL in my weblog at: http://codingathome.blogspot.com/2009/04/create-sql-trace-and-read-it-using-sql.html .
Its possible that template would work for the CE version of SQL. I haven't tried it. Your milage might vary. I know that SQL CE doesn't support stored procedures so chances are this wont work. You might have to setup debugging in your code in order to trace queries.
Since CE doesn't support a stored procedure I bet you can still run the script as a .sql script and get the tracing events installed. Its worth a try.