Skip to content

Instantly share code, notes, and snippets.

View arbo-hacker's full-sized avatar

Alejandro Barreto arbo-hacker

View GitHub Profile
@arbo-hacker
arbo-hacker / eliminar-concurrente.sql
Created January 23, 2016 05:41
Como eliminar un concurrente de Oracle Financials / EBS / E-Business Suite
DECLARE
-- Change the following two parameters to fit your needs
p_progShortName VARCHAR2 (100) := '&nombre del concurrente'; -- este debe ser obtenido de la tabla fnd_concurrent_programs
p_forceDelete BOOLEAN := TRUE;
num_programID NUMBER;
var_progName VARCHAR2 (100);
num_appID NUMBER;
num_execID NUMBER;
num_appIDName VARCHAR2 (100);
@arbo-hacker
arbo-hacker / mfqueue-tables-retek.sql
Created January 23, 2016 05:48
Como monitorear las tablas MFQUEUE en Oracle Retail
select 'CODES_MFQUEUE' COLA, count(1) ENCOLADOS from CODES_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'RUA_MFQUEUE' COLA, count(1) ENCOLADOS from RUA_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'BANNER_MFQUEUE' COLA, count(1) ENCOLADOS from BANNER_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'ITEM_MFQUEUE' COLA, count(1) ENCOLADOS from ITEM_MFQUEUE I WHERE PUB_STATUS = 'U' AND I.APPROVE_IND = 'Y' union all
select 'SEEDOBJ_MFQUEUE' COLA, count(1) ENCOLADOS from SEEDOBJ_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'WH_MFQUEUE' COLA, count(1) ENCOLADOS from WH_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'STORE_MFQUEUE' COLA, count(1) ENCOLADOS from STORE_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'SUPPLIER_MFQUEUE' COLA, count(1) ENCOLADOS from SUPPLIER_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'TSF_MFQUEUE' COLA, count(1) ENCOLADOS from TSF_MFQUEUE WHERE PUB_STATUS = 'U' union all
select 'PARTNER_MFQUEUE' COLA, count(1) ENCOLADOS from PARTNER_MFQUEUE WHERE PUB_STATUS = 'U' union al
@arbo-hacker
arbo-hacker / find-object-error.sql
Last active January 23, 2016 05:46
Error de un procedimiento / funcion invalido en Oracle
-- error de un objeto invalido
select * from sys.ERROR$ where obj#
in (select obj#
from sys.utl_recomp_invalid_all
where objname='&nombreprocedimiento'
);
@arbo-hacker
arbo-hacker / enable-acl-oracle.sql
Last active January 23, 2016 05:36
Permitir invocar Web Services desde base de datos Oracle 11g
---######## Este script crea el ACL en la BD:
begin
dbms_network_acl_admin.create_acl (
acl             => 'nombreacl.xml',
description     => 'Normal Access',
principal       => 'CONNECT',
is_grant        => TRUE,
privilege       => 'connect',
start_date      => null,
end_date        => null
@arbo-hacker
arbo-hacker / query-util-altiris-1.sql
Created January 23, 2016 05:30
Querys utilitarios en Altiris (parte 1)
-- Casos creados por alguien
select distinct number,title from workitem
where created_by_worker_contact_id=(select contact_id from worker where upper(name) like '%ARBO%')
order by number desc;
-- Personas asociados a una cola de atención específica
select * from worker where queue_id=455;
-- Cantidad de casos asociados a todos los integrantes de una cola de atención
select     (select w3.name from worker w3 where w3.id= w1.assigned_to_worker_id) asignado_a,count(*) Casos
@arbo-hacker
arbo-hacker / consumir-url-usando-certificados.cs
Created January 23, 2016 05:23
Consumir una URL a través de un Proxy usando Certificados
//Hay q forzar a aceptar el certificado, ya que
//el nombre que se utiliza en la solicitud HTTP no
//coincide con el nombre del servidor que se emite con el certificado SSL
System.Net.ServicePointManager.CertificatePolicy = new MyPolicy();
WebProxy proxy = new WebProxy("http://servidorconproxy:8080/",true);
proxy.Credentials = new NetworkCredential("user","password");
System.Net.HttpWebRequest hr=System.Net.WebRequest.Create("https://www.unapagina.com") as System.Net.HttpWebRequest ;
hr.Proxy = proxy;
HttpWebResponse o=hr.GetResponse() as HttpWebResponse;
@arbo-hacker
arbo-hacker / enable-java6-in-macos.sh
Created January 23, 2016 05:07
Habilitar Java 6 web plugin y Web Start en MacOS
# 1. Abrir el terminal y situarte en la carpeta Utilities.
# 2. Escribir el siguiente comando y presionar la tecla enter:
sudo mkdir -p /Library/Internet\ Plug-Ins/disabled
# 3. Escribir el siguiente comando y presionar la tecla enter:
sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled
# 4. Escribir el siguiente comando y presionar la tecla enter:
@arbo-hacker
arbo-hacker / uso_fnc_filename.sql
Last active January 23, 2016 05:00
Uso de funcion FNC_FILENAME
-- Uso de funcion FNC_FILENAME ubicada en https://gist.github.com/arbo-hacker/f8385586df6b20ff5419
SELECT FNC_FILENAME('D:\user\Desktop\pafii\leeme.txt', '\', 'txt') nombre_archivo archivo
FROM DUAL;
-- O
set serveroutput on
DECLARE
v_FILENAME VARCHAR2(50);
@arbo-hacker
arbo-hacker / Registros numericos.sql
Last active January 23, 2016 04:53
Como saber si el valor de un campo es numerico en PL/SQL
-- Obtener todos los registros que son alfanumericos
select * from (
select '123' campo from dual
union all
select '1X2' from dual
) tmp
where translate(campo,'T 0123456789','T') is not null;
-- Obtener todos los registros que son numericos
select * from (
@arbo-hacker
arbo-hacker / FNC_FILENAME.sql
Last active January 23, 2016 04:52
Funcion para obtener nombre de archivo
CREATE OR REPLACE FUNCTION FNC_FILENAME (ruta_archivo VARCHAR2,
barra VARCHAR2,
extension VARCHAR2)
RETURN VARCHAR2
IS
BEGIN
RETURN REGEXP_SUBSTR (ruta_archivo,
'[^' || barra || ']+.' || extension,
1,
1);