31. Januar 2010

Abgelegt unter: Allgemein — Schlagwörter:, , — os @ 11:17

Interessant finden wir Tom Kytes Meinung zu dem Thema ETL-Tools, hier stellvertretend für PowerCenter Informatica:

Management is mis-speaking. It is not that “business and data transformation rules” would be ‘buried’ in plsql – it is that since they are using informatica, things written in plsql would be “outside the realm of the meta-data informatica keeps”

To me – the primary reason to use an ETL tool is “documentation and maintanence”. You will likely find the tool getting in the way in many cases (times you just want to through your hands up and say ‘lets just code it already’).  But the tool isn’t there necessarily to make this aspect easier – it is there to provide continuity,  documentation, change management, the ability to figure out where the data comes from and where it goes. This is especially important for future generations of developers that will follow you (and want – no, need – that meta data).

Probably not what you expected me to answer :) We have our own ETL tool – we call it OWB (Oracle Warehouse Builder). It happens to generate plsql and oracle specific SQL (and does things in SETS which is great). But it has the same sort of meta data approach. We could argue which is better – Informatica vs OWS but at the end of the day – you are
using them not necessarily because it’ll make the entire ETL process easier or even faster – but because of the documentation they provide. On a large scale effort – with many developers, lots of data sources and a lifespan that should be “long” (eg:  maintaining this system is relevant!) – they make sense.

Zitat von Tom Kyte, ORACLE

6. Dezember 2009

Abgelegt unter: Allgemein — Schlagwörter:, , , — os @ 14:01

database experts bietet KMU’s mit ORACLE, mySQL und SQL Server den Einsatz von Remote Datenbankadministration an.

Immer mehr Firmen investieren in ORACLE und andere Datenbanksysteme. Diese Datenbanksysteme wachsen im Laufe der Zeit, meist schneller als erwartet, und benötigen eher früher als später die Wartung durch einen DBA. Oftmals kommt aus Kosten- oder Kapazitätsgründen der Einsatz eines Vollzeit DBA’s nicht in Frage.

Hier helfen wir Ihnen mit unserem Remote DBA Service. Lesen Sie, wie auch Sie profitieren können.

Link zu Remote DBA

Abgelegt unter: Allgemein — Schlagwörter:, , , — os @ 13:21

Ab sofort bieten wir allen ORACLE Anwendern Unterstützung bei Fragen rund um ORACLE. Nutzen Sie unser Support Center um eine schnelle und kompetente Antwort auf Ihre Frage zu erhalten.

Nach der Registrierung helfen Ihnen unsere Mitarbeiter gerne bei der Lösung Ihrer ORACLE Probleme. Unser einfaches Preismodell garantiert Ihnen schnellen und kompetenten Support zu günstigen Preisen.

Alternativ besteht die Möglichkeit eine email an support /at / database-experts.de zu senden. 

Link zu Support Center Link zu Preismodell

30. Oktober 2009

Abgelegt unter: Allgemein — Schlagwörter:, — os @ 22:38

In der täglichen Arbeit kommt es immer wieder vor, dass das Ergebnis eines Select-Abfrage in eine “comma separated list” umgewandelt werden soll. Während viele Programmiersprachen wie php hierzu Funktionen wie explode/ implode bereitstellen, fehlt eine solche Funktion in Oracle.

Im folgenden zeigen wir, wie mittels zweier simpler PL/SQL Funktionen ein “Concatinate” und “Split” realisierbar ist.

f_concat

Der Funktion f_concat wird das Select-Statement als REF CURSOR übergeben, ein Trennzeichen (Delimiter) ist optional. Der Rückgabewert ist ein String mit der maximale Länge von 32767 Zeichen.

CREATE OR REPLACE FUNCTION
       f_concat (p_cur sys_refcursor, p_del varchar2:= ',')
   RETURN VARCHAR2 IS
   l_value    VARCHAR2 (32767);
   l_result   VARCHAR2 (32767);
BEGIN
   LOOP
      FETCH p_cur
      INTO l_value;
      EXIT WHEN p_cur%NOTFOUND;
      IF l_result IS NOT NULL THEN
         l_result   := l_result || p_del;
      END IF;
      l_result   := l_result || l_value;
   END LOOP;
   RETURN l_result;
END f_concat;

Somit lassen sich zum Beispiel die Attribute einer Tabelle als CSV-Liste ausgeben:

SELECT f_concat (cursor (SELECT column_name
                           FROM dba_tab_columns
                          WHERE table_name = 'CCOL$'),
                 ', ') cols
  FROM DUAL;

Liefert folgende Ausgabe:

CON#, OBJ#, COL#, POS#, INTCOL#, SPARE1, SPARE2, ...
f_split

Das Gegenstück zur oben gezeigen Funktion ist f_split. Die Funktion extrahiert die einzelnen Tokens in einem String und gibt sie jeweils in einer Zeile zurück. Die Funktion benötigt den Typ “table of varchar”. Die Argumente werden extrahiert und in einer Pipeline zurückgegeben.

create or replace type t_split as table of varchar2(32767);
/
create or replace function f_split(p_list varchar2,
p_del varchar2 := ';')
  return t_split pipelined is
    l_idx     pls_integer;
    l_list    varchar2(32767) := p_list;
    l_value   varchar2(32767);
begin
    loop
        l_idx := instr(l_list,p_del);
        if l_idx > 0 then
            pipe row(substr(l_list,1,l_idx-1));
            l_list := substr(l_list,l_idx + length(p_del));
        else
            pipe row(l_list);
            exit;
        end if;
    end loop;
    return;
end f_split;

Durch den type cast “TABLE” kann die Funktion wie eine Tabelle verwendet werden:

select * from table(f_split('eis;zwoi;drü;vier;foif'));
eis
zwoi
drü
vier
foif