We came up with this as a one-off to alert us when a certificate was close to expiration (we were burned one too many times)… import java.net.*; import java.security.cert.*; import javax.net.ssl.*; public class GetCertDates { public static void main(String []…
Author: Steve
Deleting in a loop in SQL Server
While discussing a way to delete many rows, but without deleting all of them at the same time (too much transaction logging), we came up with the following… This works pretty well. It’s faster to do it all at once,…
Calculating annual rate of return of a stock index in Excel
I use what is below to calculate a total rate of return over a period of time. This is most useful when computing compounded returns for an individual stock, or an index such as the S&P 500… Public Function ror(pv…
Command line script to print referential integrity constraints
Nothing fancy today, just a quickie as indicated in the subject line of the post… set serverout on format wrapped declare l_level number := 0; –get only tables with no parent tables cursor main is select distinct table_name,constraint_name from user_constraints…
Finding sensitive data in a heap dump
What is below proves the card holder PAN is in the clear in the dump… public class memSecurity { public static void main (String args[]) throws Exception { String c = “1234567887654321”; Thread.sleep(180000); } } Compile and run what is…
Calculating waits for a session for a given time window
We used this to quickly determine where a specific session was spending its time. This simply creates associative arrays for events, the time waited, and the total number of waits for that event, all at a specific point in time.…
Extracting POST arguments from fiddler for JMeter
You can filter on your domain by clicking filters in the top right hand corner row of tabs in Fiddler, then add your domain and click run filterset now in the “Actions” dropdown box. After running your requests in your…
Rolling your own Grid Control with AQ
DBControl can do the same thing, but if you have more than one database on a server, this is where something like this will come in handy. PLSQL setup, you should only have to change the SHOWARD part… begin dbms_aqadm.grant_queue_privilege…
Calculating gaps between full CMS cycles
While troubleshooting a performance issue, we had a need to graph the number of seconds between full collections. We used what is below. This assumes you have added -XX:+PrintGCDetails and -XX:+PrintGCDateStamps as well as a file location for -Xloggc: to…
Hive performance parser
With data in the hiveserver2.log file, this awk scriptlet prints the timestamp, SQL, and seconds to run. There is an issue where the parser thread hands off to the executor, and you can’t always tie the two together. However, at a…