Skip to content

Instantly share code, notes, and snippets.

@ibre5041
ibre5041 / OracleSQLID.java
Created July 19, 2020 14:33
Compute SQL hash - a.k.a. Oracle SQL_ID
import java.math.BigInteger;
import java.security.MessageDigest;
/**
* Compute SQL_ID for SQL string
* @author Ivan Brezina(ibre5041)
*
*/
class OracleSQLID {
/**
set serveroutput on size unlimited
declare
v_ItemCount integer;
begin
SELECT count(*)
INTO v_ItemCount
FROM ALL_OBJECTS AO
WHERE AO.OWNER = '&USER'
AND AO.OBJECT_TYPE NOT IN ('INDEX', 'LOB')
AND AO.OBJECT_NAME NOT LIKE 'BIN$%';
@ibre5041
ibre5041 / FindOracle.cmake
Last active December 24, 2022 21:23
CMake: Configure Oracle libraries
#.rst:
# FindOracle
# ----------
#
# Configure Oracle libraries
#
# ORACLE_FOUND - system has Oracle OCI
# ORACLE_HAS_XML - Oracle has XDK support(thick client installed)
# ORACLE_INCLUDES - where to find oci.h
# ORACLE_LIBRARIES - the libraries to link against to use Oracle OCI