Category Archives: Databases

Blog Links: SQL Server Tricks and Tips

By | February 8, 2017

The following are some interesting SQL Server related links: A lot of times you have to relocate the data and log files of a SQL Server. It can be that the default installation was not OK or you change the storage. The following tutorial is very useful Move System Databases Using SQL Server with R… Read More »

Blog Links: Hacking MSSQL, a strong case for implementing PCI

By | February 8, 2017

A fabulous piece from Rick Osgood on Hacking Microsoft SQL Server Without a Password. Using a man in the middle attach and ARP spoofing with a combination of free tools like Wireshark, Ettercap filters is able to hijack the SQL connection and execute arbitrary queries instead of the real queries. He manages even to create… Read More »

DB2: Debug db2 SQL exceptions

By | March 8, 2017

Sometimes the db2 exceptions are cryptic or hidden by the application layer. In this case the only way to find the db2 SQL exception is to investigate in db2 logs. First check the log level setup in the Database Manager Configuration. Log in as the user under which db2 instance runs, in my case db2inst1.… Read More »

DB2: SQL Error: -803, SQLState: 23505, Unique Constraint Violation

By | December 8, 2019

Yet another thread of DB2 errors from an EJB application that connects to a DB2 instance. The reported thread of errors: [7/13/16 12:46:38:670 IST] 00000098 SqlExceptionH Z org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions [jcc][t4][102][10040][4.19.26] Batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions… Read More »

DB2: SQL Error: -803, SQLState: 23505 due to NON-UTF8 character in parameter

By | October 24, 2017

Sometimes Java and databases do not use the same standards to represent data. This can lead to strange exceptions for which sometimes can be hard to pin point the cause. We have the following Exception reported in the enterprise application log. Let’s analyse the errors. [7/13/16 12:46:32:752 IST] 00001456 SqlExceptionH Z org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions SQL Error:… Read More »

DB2 : Claim back space from dropped tables

By | February 8, 2017

Especially when creating a demo image of an enterprise system we want to have a smaller footprint than the full system that was cloned. The same is true when the image is used for volume benchmarks. Between different benchmark sessions we want to clean the old test data and maybe in the end we want… Read More »

DB2 (Reason code = “18”.. SQLCODE=-30090, SQLSTATE=25000)

By | February 8, 2017

In a setup having an enterprise application depending on a database instance where some tables are defined as nicknames to tables from a federated database, it can happen to get this very cryptic DB2 error. I already had a post related to this case when the setup uses access to a federated database https://blog.voina.be/db2-sql-error-30090-caused-by-read-only-table-nickname-to-a-federated-database/. You… Read More »

Clone DB2 10g FC23 install to a virtual machine (FC23 or RHEL7)

By | February 8, 2017

I wanted to move my test db2 installation based on a Fedora Core 23 to a RHEL7 virtual machine without having to reinstall everything and not lose any data. This is in fact cloning my test environment database. This is not an easy task as is not officially supported by IBM but the beauty of… Read More »

DB2: Find a foreign key

By | February 8, 2017

Sometimes working with Hibernate you get the following error in case a persist is executed on an object with dependencies. com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: Error for batch element #1: The insert or update value of the FOREIGN KEY “INST1.MESSAGE.FK_1FUTL48XT47HPPGH0YXQM1MIJ” is not equal to any value of the parent key of the parent table.. SQLCODE=-530, SQLSTATE=23503, DRIVER=4.13.127 From IBM… Read More »

Oracle: Finding and adding indices

By | February 8, 2017

Sometimes things go slow in the database even if the original setup was done with a lot of care. The data traffic the usage of the application can sometimes impose the need of extra indices in addition to the original indices added by the enterprise application client that uses the Oracle database. The following procedure… Read More »