This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest' | |
module OracleStmtUtils | |
def stmt_to_sqlid(stmt) | |
d1, d2, msb, lsb = Digest::MD5.digest(stmt + "\x00").unpack('IIII') | |
sqln = msb * (2 ** 32) + lsb | |
stop = Math.log(sqln, Math::E) / Math.log(32, Math::E) + 1 | |
sqlid = String.new | |
alphabet = '0123456789abcdfghjkmnpqrstuvwxyz' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Fifo | |
EmptyError = Class.new(Exception) | |
Node = Struct.new(:value, :next) | |
attr_accessor :size, :top | |
private :size=, :top= | |
def initialize | |
self.size = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete from tableName | |
where %%physloc%% not in | |
( | |
select | |
max(%%physloc%%) | |
from | |
tableName | |
group by | |
column1, | |
column2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |