Month: August 2012

JDBC and Oracle Database Change Notification

Below is a simple example of a cutdown example of using DCN in Oracle with JDBC. I plan on presenting this to our developers as an alternative to the ATG InventoryCache manager module. import java.sql.*; import java.util.*; import oracle.jdbc.*; import…

SQL Server example of a C# stored procedure

Below is a simple example of using CLR. Source code for procedure… using System.IO; using Microsoft.SqlServer.Server; public partial class spaceProc { [Microsoft.SqlServer.Server.SqlProcedure] public static void freeSpace() { foreach (DriveInfo drive in DriveInfo.GetDrives()) { if (drive.IsReady) { SqlPipe p = SqlContext.Pipe;…

TIMESTAMP in GV$SQL_BIND_CAPTURE

This has been an issue since at least 10.2.0.3, and appears to still be the case in 11.2.0.3, almost five years later. A TIMESTAMP datatype in GV$SQL_BIND_CAPTURE is not printed. Fortunately, the following works. select anydata.accesstimestamp(value_anydata) from v$sql_bind_capture where sql_id=’&your_sql_id’;

Allowing oracle to read /var/log/messages

The system log sometimes contains important information for troubleshooting cluster issues. setfacl -m u:oracle:r /var/log/messages On RHAT, the ACL is preserved so when logrotate is run, oracle will be able to read the new /var/log/messages file and the “old” ones…

Finding java thread consuming CPU

Periodically, we will have an application server go to 100% CPU utilization on a single java process. Below is the methodology I use to troubleshoot a high CPU thread consumer in java. 1. As the user running the Java Virtual…

tcpdump to see Oracle errors

Not all exceptions are created equally, and most you can ignore (the one below you can, in general). However, if you have to troubleshoot on JBOSS (or anywhere a Linux application connects to an Oracle database), what is below is…