Development

Simple example of C# program accessing Oracle

Tuesday, May 15, 2012
By Steve

Nothing big, just a placeholder for an example of what is in the subject line. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 //C:\Users\showard>C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe /r:"C:\oracle\product\11.2.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll" checkConn.cs   using System; using Oracle.DataAccess.Client;   public class checkConn { public static void Main(String... »

Print thread dump for a single thread

Monday, April 9, 2012
By Steve

We had an issue where a single thread was using all the CPU. We wanted to check it at the command line while troubleshooting. We used what is below… $ jstack 3000 | awk '{if ($1 == "\"Thread-9\"") {i = 1;print $0} else if (i == 1 && $0 != "") {print $0}... »

Java date difference in milliseconds

Wednesday, March 28, 2012
By Steve

Every time I need to do math on a date in java, I end up googling it. While that isn’t the worst way to do things (hey, it’s probably how you found this ), I wanted something I *knew* would be there. I know there are libraries out there for this, but I usually... »

Query SQL Server stored procedure text with JDBC

Wednesday, February 8, 2012
By Steve

I needed to quickly print the text associated with several stored procedures across multiple database servers to individual files. I used what is below. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30... »

Additional cursor trace information in 11.2.0

Sunday, December 11, 2011
By Steve

Oracle has added a lot of additional trace output in the 10046 optimizer trace files. As I have posted previously, I find the output in these files to be useful not only for troubleshooting performance issues, but also understanding the business flow of the application in cases where I don’t have access to the... »

Querying load balancing information from the Load Balancing Advisory

Tuesday, October 11, 2011
By Steve

I use what is below to periodically gather what the load balancing advisory posts. The data reflects the percentage of connections to distribute to each instance for a given service in a RAC. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21... »

Which SQL statement is responsible for a wait event?

Saturday, September 24, 2011
By Steve

We generate a daily health check report for each database that contains high level summaries of the previous days activities. One element of this report is a list of the top ten non idle wait events (disclaimer: I know that sometimes idle wait events can be important, but if they are, they can usually... »

Constructing a thread when you don’t know the class ahead of time

Thursday, September 1, 2011
By Steve

While building a generic load testing toolkit, I found it useful to be able to use a standard invocation framework for running a thread class that contains the actual application code to be stress tested. However, I had some problems determining how to dynamically create a set of threads when I didn’t know the... »

Simple usage of a user profile to limit concurrent logins

Thursday, June 23, 2011
By Steve

We had an issue in a development database where a group of developers were not using a connection manager, but trying to manage their own connections. This did not end well. To limit our exposure and the impact on other application users, we implemented a simple profile for the problematic user. A simple test... »

Multiple threads using same physical connection

Tuesday, June 21, 2011
By Steve

This just doesn’t sound good. Having multiple threads use the same physical connection sounds like an exercise in frustration. Although the OracleDataSource connection object is thread safe, there is really no need to create a smaller number of connections than threads and then use them as static class variables. We had this issue last... »