Skip to content

Instantly share code, notes, and snippets.

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">
@davidhooey
davidhooey / oracle_which_sql_caused_wait_event.sql
Created September 24, 2014 15:42
Oracle Which SQL_ID Caused A Particular Wait Event
select
event,
sql_id,
snap_id,
dbid,
instance_number,
sample_time,
session_id,
session_serial#,
user_id,
@davidhooey
davidhooey / oracle_awrsqrpt_sql.sql
Created September 24, 2014 15:40
Oracle Generate AWR SQL Report Through SQL
-- Find the dbid, instance_number and begin and end snap_id to be used.
select
snap_id,
dbid,
instance_number,
begin_interval_time,
end_interval_time
from
dba_hist_snapshot
@davidhooey
davidhooey / oracle_awrrpt_sql.sql
Last active August 29, 2015 14:06
Oracle Generate AWR Report Through SQL
-- Find the dbid, instance_number and begin and end snap_id to be used.
select
snap_id,
dbid,
instance_number,
begin_interval_time,
end_interval_time
from
@davidhooey
davidhooey / oracle_wait_events_for_sql_id_within_time_period.sql
Created September 24, 2014 15:31
Oracle Wait Events for SQL_ID within Specific Time Frame
-- V$ACTIVE_SESSION_HISTORY
select
event,
sum(time_waited) time_waited
from
v$active_session_history
where
sql_id = 'SQL_ID'
and
sample_time between
@davidhooey
davidhooey / tiny_png.rb
Created August 11, 2014 14:50
Compress PNGs using the TinyPNG service.
require "net/https"
require "uri"
# Ensure we have two parameters.
if ARGV.length != 2
puts "Usage: #{$0} input_directory output_directory"
exit 1
end
key = "PLACE_TINY_PNG_KEY_HERE"
@davidhooey
davidhooey / sql_server_delete_duplicate_rows.sql
Last active August 29, 2015 14:02
Remove duplicate rows in SQL Server.
delete from tableName
where %%physloc%% not in
(
select
max(%%physloc%%)
from
tableName
group by
column1,
column2,
@davidhooey
davidhooey / bdd.rb
Created April 16, 2014 13:49 — forked from adkron/bdd.rb
class Fifo
EmptyError = Class.new(Exception)
Node = Struct.new(:value, :next)
attr_accessor :size, :top
private :size=, :top=
def initialize
self.size = 0
@davidhooey
davidhooey / oracle_tablespace_usage.sql
Created April 11, 2014 19:43
Oracle Tablespace Usage
select
d.tablespace_name tn,
d.block_size bs,
d.extent_management lm,
d.segment_space_management assm,
d.status st,
to_char(f.bytes/1024,'999,999,999')||'K' bts,
to_char((f.bytes-s.free_bytes)/1024,'999,999,999')||'K' used,
to_char(round((f.bytes-s.free_bytes)/f.bytes*100),'990.9')||'%' pct,
case trunc(33*(f.bytes-s.free_bytes)/f.bytes)
@davidhooey
davidhooey / oracle_lock_mon.sql
Created April 8, 2014 16:00
SQL*Plus command file to log transaction locks.
Rem oracle_lock_mon.sql
Rem
Rem NAME
Rem oracle_lock_mon.sql
Rem
Rem DESCRIPTION
Rem SQL*Plus command file to log transaction locks.
Rem This script is based on the
Rem /rdbms/admin/utllockt.sql script.
Rem