Skip to content

Instantly share code, notes, and snippets.

View igelbox's full-sized avatar

Vakhurin Sergei igelbox

View GitHub Profile
@igelbox
igelbox / demo.js
Created May 12, 2017 20:20
Configure custom DNS lookuper for NodeJS' superagent package
'use strict';
const dns = require('dns');
const superagent = require('superagent');
const hostIndexes = new Map();
require('./superagent-custom-lookup')(superagent, (addresses, host) => {
let index = hostIndexes.get(host) || 0;
const result = addresses[index];
index = (index + 1) % addresses.length;
select
sw.sid||','||sw.serial#, sw.machine, sw.program, sw.wait_event, sw.blocking_session, o.object_name
, (select sql_text from v$sql where sql_id=sw.sql_id and rownum=1) as sql, p.spid
from (
select s.*, w.event as wait_event
from v$session_wait w
join v$session s on s.sid=w.sid
start with w.event not in ('SQL*Net message from client', 'rdbms ipc message')
connect by prior s.blocking_session = w.sid
) sw