Author: Steve

Loading snowflake from Oracle

Single class to illustrate loading data… import java.sql.*; import java.util.*; public class loadSnowflake { public static void main(String[] args) throws Exception { Class.forName(“oracle.jdbc.driver.OracleDriver”); Class.forName(“com.snowflake.client.jdbc.SnowflakeDriver”); Properties properties = new Properties(); properties.put(“user”, “showard”); properties.put(“password”, “*****”); properties.put(“account”, “rcaccount#”); properties.put(“schema”, “PUBLIC”); Connection connection =…

Who installed which packages when

Just a quick how-to this morning… # for id in $(yum history list all | grep showard | awk ‘{print $1}’ | head -1); do echo “****************************************************”; yum history info ${id}; done **************************************************** Loaded plugins: product-id, rhnplugin, search-disabled-repos, security, subscription-manager…

Browsers and Cache-Control headers

Chrome and Microsoft Edge both have odd rules for this. If you reload a tab, the browser completely ignores the directive and requests the content, anyway. If you copy the URL to a new tab and request it, it honors…

ELK simple POC

I tried using the getting started guide, and knew I was in trouble when they had me downloading shakespeare.json. Why does every IT person think that other IT people are “cultured” and would be interested in Shakespeare as a datasource…

Improving batch inserts into MySQL

We had a custom class to copy data from Oracle to MySQL at AWS. It was sending each statement individually, even though we batched them. import java.sql.*; public class test { public static void main(String args[]) throws Exception { Class.forName(“com.mysql.jdbc.Driver”);…

Running admin commands on secondary mongodb server

You have to let your session know that reading this information from a non-primary server is OK (literally)… -bash-4.1$ mongo rs1:SECONDARY> show dbs 2018-02-01T10:37:58.457-0500 E QUERY [thread1] Error: listDatabases failed:{ “operationTime” : Timestamp(1517499476, 1), “ok” : 0, “errmsg” : “not…

Spinlocks, does Oracle use them?

I often write simple C programs to better understand how a given enterprise software program works. Latches in the Oracle database are “in memory locks that protect critical sections of code”. Oracle kernel developers decide that a given section of…