Skip to content

Instantly share code, notes, and snippets.

@davidhooey
davidhooey / captured_binds_for_sqlid.sql
Created April 9, 2018 19:47
List values used for bind variables from single SQL_ID.
select
snap_id,
sql_id,
name,
position,
datatype_string,
to_char(last_captured,'YYYY-MM-DD HH24:MI:SS') last_captured,
value_string
from
dba_hist_sqlbind
@davidhooey
davidhooey / p4merge4git.md
Created June 14, 2017 14:55 — forked from tony4d/p4merge4git.md
Setup p4merge as a visual diff and merge tool for git
@davidhooey
davidhooey / promisedRequest.js
Created October 19, 2016 14:03 — forked from anandsunderraman/promisedRequest.js
Node.js request with Q promises
//import the http library
var http = require('http'),
//npm install q before requiring it
Q = require('q');
//a js object with options
var googleNewsOptions = {
hostname: 'ajax.googleapis.com',
path: '/ajax/services/search/news?v=1.0&q=nodejs',
method: 'GET'
@davidhooey
davidhooey / oracle_top_sql_current.sql
Last active January 14, 2020 23:46
Oracle top current SQL
select
*
from
(
select
module,
sql_id,
child_number,
plan_hash_value,
executions,
@davidhooey
davidhooey / oracle_top_sql_history.sql
Last active January 14, 2020 23:45
Oracle top historical SQL
select
*
from
(
select
ss.module,
ss.snap_id,
ss.sql_id,
ss.plan_hash_value,
ss.executions_total,
@davidhooey
davidhooey / oracle_blocker_blocked_sess_history.sql
Last active November 21, 2023 18:30
Oracle blocker and blocked session information from history.
select distinct
-- Snapshot ID
min(blocked.snap_id) as first_snap_id,
max(blocked.snap_id) as last_snap_id,
-- Sample ID and Time
min(blocked.sample_id) as first_sample_id,
min(blocked.sample_id) as last_sample_id,
to_char(
min(blocked.sample_time),
@davidhooey
davidhooey / protips.js
Created January 3, 2016 23:49 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@davidhooey
davidhooey / xvfb
Last active August 29, 2015 14:21 — forked from jterrace/xvfb
Xfvb init script for ubuntu
# Installation
#
# 1. Install Xvfb
#
# sudo apt-get install xvfb
#
# 2. Add this file to /etc/init.d/xvfb
#
# 3. Make the script execuable.
#
@davidhooey
davidhooey / oracle_create_sts_from_application_sql.sql
Created May 19, 2015 22:49
Create Oracle SQL Tuning Set for an application's cached statements.
--
-- Create SQL Tuning Set
--
begin
dbms_sqltune.create_sqlset
(
sqlset_name => 'AppName_STS_01',
description => 'SQL Tuning Set for AppName',
sqlset_owner => 'SYS'
);
@davidhooey
davidhooey / oracle_blocker_blocked_sessions.sql
Last active July 21, 2020 17:24
Oracle blocker and blocked session information.
select
-- Session causing the block
blockers.blocker_instance_id as blocker_instance_id,
blocker.sid as blocker_sid,
blocker.serial# as blocker_serial#,
blocker.username as blocker_username,
blocker.status as blocker_status,
blocker.machine as blocker_machine,
blocker.program as blocker_program,
blocker.sql_id as blocker_sql_id,