Skip to content

Instantly share code, notes, and snippets.

View schlueter's full-sized avatar

Brandon Schlueter schlueter

  • United States of America
View GitHub Profile
@schlueter
schlueter / gist:fc7a418a8f8a5fac5a84
Last active February 9, 2016 03:00
Useful Oracle Queries
# discover what programs are still connected to a db
select sid,serial#,program from v$session where username = '<your_schema>';
# and forcibly disconnect them
select 'alter system kill session ''' || sid || ',' || serial# || ''';' from v$session where username = '<your_schema>'
#Shutdown and restart cdb and pdb
shutdown;
#then
startup;
@schlueter
schlueter / recursive_chef_path.rb
Last active August 29, 2015 14:01
Recursively create folders with chef
split_path = path.split('/')
split_path.each_with_index.map do | _, index |
# Reconstruct each path that makes up the target path and ensure they are created
partial_path = ::File.join split_path.slice(0, index + 1)
next if partial_path == ''
directory partial_path do
owner node[:oracle][:database][:install_user]
group node[:oracle][:database][:install_group]
mode 0775
end