Db2 Gleitender Durchschnitt


IBM Analytics IBM Watson Data Platform Ermöglicht es einfach, alle Daten - und Business-Profis zusammenzuarbeiten, zu visualisieren und kritische Einsichten in Ihrem Unternehmen zu vermitteln, um geschäftsrelevante Ideen schneller aufzudecken. Diese einzigartige, integrierte Self-Service-Plattform macht es einfach, auf alle Arten von Daten zuzugreifen und AI-powered Entscheidungsfindung, für bessere datengesteuerte Ergebnisse. SPSS Predictive Analytics IBM SPSS Predictive Analytics Software bietet fortschrittliche Techniken in einem einfach zu bedienenden Paket, um Ihnen zu helfen, neue Möglichkeiten zu finden, die Effizienz zu verbessern und das Risiko zu minimieren. IBM DB2 Datenbank IBM DB2 ist die Datenbank der Wahl für unternehmensweite Lösungen. Optimiert, um branchenführende Leistung zu liefern und gleichzeitig Kosten zu senken, bietet IBM DB2 extreme Leistung, Flexibilität, Skalierbarkeit und Zuverlässigkeit für jede Größenorganisation. Cognos Analytics auf Cloud Business Intelligence Holen Sie sich die Self-Service, die Sie erwarten, Data Governance Sie benötigen, und berichten Sie vertrauen mit einer sicheren Business Intelligence Software-as-a-Service (SaaS) - Lösung. IBM BigInsights Hadoop IBM BigInsights ist ein Industriestandard-Hadoop-Angebot, das die beste Open-Source-Software mit Enterprise-Grade-Funktionen kombiniert. IBM Planning Analytics Financial Performance Management Eine schnelle, einfache, flexible und komplette Cloud-Planungslösung, die leistungsstarke Analysen in Ihre alltäglichen Entscheidungsprozesse einbaut. IBM Incentive Compensation Management Sales Performance Management Eine hochflexible und skalierbare Lösung zur Automatisierung von Anreizberechnungen und zur Bereitstellung von Online-Vergütungserklärungen und Berichterstattung für Mitarbeiter. Es gibt stürmische Data-Mining-Anforderungen in vielen Bereichen innerhalb von Honda, aber diese waren nicht genug für LOB-Führungskräfte zu entscheiden, um Analytics in ihren realen Aktivitäten zu verwenden, für Kostenreduktion, Betriebseffektivität und neue Wertschöpfung zu verwenden. Turkcell arbeitete mit IBM Business Partner Aksis zusammen, um tief in Millionen von Kundenvertragsdokumenten zu vertiefen, um ihre Kommunikationspräferenzen besser zu verstehen und intelligentere Marketingstrategien zu fahren und gleichzeitig die Einhaltung gesetzlicher Vorschriften zu gewährleisten. Das Ersetzen von Tabellenkalkulationen mit IBM Analytics-Lösungen erstellte die Northwestern Universitys Budgetanalysten eine Zeitlang und Arbeit. Mit der Mjlner Informatics, einer innovativen Software - und Designberatung, nutzt SEGES IBM Watson Analytics, um relevante Daten zu erkunden und einen tieferen, umsetzbaren Einblick in die Trends der Landwirtschaft zu erhalten. Run Oracle-Anwendungen auf DB2 10 für Linux, UNIX und Windows Motivation Entwickeln Sie Fähigkeiten zu diesem Thema Dieser Inhalt ist Teil eines fortschrittlichen Wissenspfades für die Weiterentwicklung Ihrer Fähigkeiten. Siehe DB2-Grundlagen für Oracle-Profis: Migration von Oracle zu DB2 Im März 2009 auf einer Cebit-Präsentation, die ich auf DB2 hielt, verbrannte ich einen 110V-Computerlautsprecher, den ich gedankenlos an Deutschlands 230V Stromnetz angeschlossen hatte, ohne einen Transformator zu benutzen. Auf dieser gleichen Reise habe ich auch das Ladegerät für meine elektrische Zahnbürste und meinen Bartklipper in ähnlichen Vorfällen zerstört. Angesichts meiner Unfähigkeit, aus Fehlern zu lernen, ist es nicht verwunderlich, dass einer meiner Lieblingssagen (Herkunft unbekannt) das ist: Das Problem mit den Standards ist, dass es so viele von ihnen gibt. In der Welt der relationalen Datenbank-Management-Systeme (RDBMS) sind wir mit mindestens drei großen Standards und unzähligen Variationen auf denen: ANSI SQL und ANSI SQLPSM Oracle SQL und PLSQL Sybase und Microsoft174 TSQL Abbildung 1 illustriert mit einem Venn-Diagramm, wie die SQL Dialekte überlappen Abbildung 1. Babylonische Verwirrung von SQL Wenn Sie eine Anwendung schreiben, müssen Sie die Wahl treffen, welche RDBMS-Anbieter zu nutzen. Sobald Sie diese Wahl getroffen haben, sind Sie im Wesentlichen verpflichtet. Jeder Versuch, Verkäufer zu wechseln, um die Vorteile von niedrigeren Preisen, besserer Technologie oder einer besseren Partnerschaft zu nutzen, wird durch Legacy-Code vereitelt, der umfangreiche Umschreibung erfordert, bevor es mit einem anderen RDBMS verwendet werden kann. Darüber hinaus kann Ihr Skill-Set nicht von einem Produkt zum anderen so leicht übertragen werden, wie Sie es erwarten würden. IBM174 DB2174 10 für Linux174, UNIX174 und Windows174 (DB2) verringert drastisch die Barrieren für Anwendungen, die für Oracle geschrieben wurden, wenn sie DB2 aktivieren können. Dies bietet Kunden und Anbietern die Möglichkeit, ein DBMS basierend auf seinen Vorteilen anstatt Anwendungshistorie zu wählen. DB2 10 enthält Oracle-Kompatibilitätsfunktionen Um eine Anwendung zu ermöglichen, die für ein RDBMS geschrieben wurde, um auf einem anderen nahezu unverändert zu laufen, müssen viele Stücke an Ort und Stelle fallen. Verschiedene Sperrmechanismen, Datentypen, SQL, prozedurale Sprache, die sich auf dem Server befinden, und sogar die von der Applikation verwendeten Client-Schnittstellen müssen nicht nur in der Syntax, sondern auch in der Semantik ausgerichtet werden. Alle diese Schritte wurden in DB2 vorgenommen. Änderungen sind die Ausnahme, nicht die Regel (Sie können die Bewerbungsänderungen schnell beurteilen). Tabelle 1 bietet einen schnellen Überblick über häufig verwendete Funktionen. Tabelle 1. Häufig verwendete Funktionen Mit DB2 müssen Sie keine Anwendung portieren. Sie erlauben nur die Anwendung. Im Falle einer verpackten Anwendung ist es sogar möglich, eine Quelle für DB2 und Oracle zu teilen. Mit anderen Worten, das Aktivieren einer Oracle-Anwendung auf DB2 wird nicht komplexer als das Aktivieren eines C-Programms, das für HP-UX geschrieben wurde, um auf AIX zu laufen. Gleichzeitigkeitskontrolle In der Vergangenheit war einer der prominentesten Unterschiede zwischen Oracle und DB2 der Ansatz zur Parallelitätskontrolle. Die eingängige Phrase ist Leser dont Block Schriftsteller, und Schriftsteller nicht blockieren Leser. Tabelle 2 zeigt das Parallelitätsverhalten für Oracle. Tabelle 2. Oracle-Gleichzeitigkeitsverhalten Es stellt sich heraus, dass es keinen semantischen Grund gibt, warum eine Transaktion, die unter CS-Isolation läuft, auf das Ergebnis wartet, wenn eine geänderte Zeile angetroffen wird. Ein ebenso zufriedenstellendes Verhalten ist es, die aktuell begangene Version der geänderten Zeile zu lesen. Dieses Verhalten wurde seit DB2 9.7 implementiert. Was passiert, ist, dass DB2 einfach die aktuell belegte Version einer gesperrten Zeile aus dem Protokoll abruft. In den meisten üblichen Fällen befindet sich die Zeile noch im Log-Puffer, da die Änderung noch nicht begangen wurde. Aber auch wenn die Zeile ausgeschrieben wurde und auch im Log-Puffer überschrieben wurde, weiß DB2 genau, wo sie zu finden ist, damit ein einziger IO die gewünschte Version in den Pufferpool bringt. Wie in Abbildung 2 dargestellt, stellen Sie sich einen Benutzer vor, der einen Namen in einer Mitarbeiter-Tabelle aktualisiert. Bevor dieser Benutzer die Änderung begangen hat, scannt ein anderer Benutzer diese Tabelle. Traditionell hätte der zweite Benutzer auf den ersten Benutzer warten müssen, um zu begehen oder zurückzusetzen. Vielen Dank, um aktuell begangene Daten zu lesen, wird der Scan für den zweiten Benutzer einfach die Version der Zeile aus dem Protokollpuffer abrufen, der die ersten Benutzer nicht enthält. Abbildung 2. Schriftsteller blockieren keine Leser Es ist wichtig zu beachten, dass dieses Verhalten: keine neuen Objekte wie ein Rollback-Segment einführt. Hat keine Leistung Overhead für den Schriftsteller, da das Protokoll muss sowieso geschrieben werden. Kann keine Situation wie einen Snapshot zu alt werden, weil im äußerst unwahrscheinlichen Fall, dass die benötigte Protokolldatei archiviert wurde (während eine Transaktion noch offen war), wird DB2 einfach zurückfallen und darauf warten, dass die Sperre weggeht. Zusätzlich zu diesen Änderungen wurden zusätzliche Verriegelungsvermeidungsverfahren in DB2 eingeführt, um einen Leser zu beseitigen, der ein Schloss unter CS-Isolation hält. Tabelle 4 zeigt das neue Parallelitätsverhalten, das DB2 mit CS hat. Tabelle 4. Neues DB2-Parallelitätsverhalten mit CS Wie Sie sehen können, ist das Gleichzeitigkeitsverhalten nun identisch mit dem von Oracle. In der Tat, jede DB2-Datenbank erstellt seit DB2 9.7 zeigt dieses Verhalten standardmäßig. Neue Datentypen Das Herz jeder Datenbank ist ihre Daten. Nicht übereinstimmende Typen oder nicht übereinstimmende Semantik dieser Typen können die Fähigkeit, eine Anwendung auf ein anderes RDBMS zu aktivieren, ernsthaft beeinträchtigen. Damit Oracle-Anwendungen auf DB2 laufen können, ist es entscheidend, seine nicht standardmäßigen Basistypen wie Strings, Datteln und Numerik zu unterstützen. Neben der Ausrichtung dieser Grundtypen gibt es noch weitere komplexere Typen, die üblicherweise in Oracles PLSQL verwendet werden, die seit DB2 9.7 verfügbar sind, wie in Tabelle 5 gezeigt. Tabelle 5. Neue DB2-Datentypen Unterstützung für NUMBER und NUMBER (p, s) hat Wurde auf Basis von DECFLOAT (mit Power Hardware Beschleunigung) und DECIMAL hinzugefügt. Das Verhalten des VARCHAR2-Typs enthält leere Zeichenfolgen, die als NULL interpretiert werden und eine leere, empfindliche Sortierung führen. NCHAR, NVARCHAR2 und NCLOB Die National Character-Typen bieten Double-Byte-String-Unterstützung für Unicode-Datenbanken. Eine Datenbank im Oracle DATE-Modus enthält neben dem Kalenderdatum auch die TIME-Komponente. Die Skala von Sekundenbruchteilen kann zwischen 0 (Datumszeit) bis zu 12 (Pico Sekunden) gewählt werden. Dieser Typ kann in Verfahrenslogik, Variablen und Parametern zu Routinen verwendet werden. Die ARRAY-Unterstützung in Prozeduren wurde erweitert, um VARRAY-Stilmethoden und Syntax zu unterstützen. Zusätzlich zu regulären Arrays unterstützt DB2 auch assoziative Arrays. Dieser zusammengesetzte Typ kann in Variablen und Parametern und als Element für Arrays und assoziative Arrays verwendet werden. Ref Cursortyp Cursors können Variablen zugeordnet oder mit Parametern umgangen werden. Implizite Casting und Typ Auflösung Wenn es wie eine Ente geht, und es spricht wie eine Ente, dann muss es eine Ente sein. Dies ist das Mantra vieler der neuen Sprachen wie PHP und Ruby. Jedes Literal ist ein String und wird dann als ein anderer Typ basierend auf Kontext verwendet. In Übereinstimmung mit dem SQL-Standard und nach einer Philosophie, dass ein Typ-Mismatch wahrscheinlich ein Hinweis auf einen Codierungsfehler ist, hat DB2 traditionell starken Tippregeln gefolgt, wo Strings und Ziffern nicht verglichen werden können, wenn man nicht explizit auf den anderen geworfen wird. Leider, wenn eine Oracle-Anwendung eine schwache Eingabe in ihrem SQL verwendet, hätte diese Anwendung zuvor nicht gegen DB2 kompiliert. Seit DB2 9.7 ist implizites Casting (oder schwaches Tippen) die Voreinstellung. Das heißt, Strings und Zahlen können verglichen, zugeordnet und betrieben werden in einer sehr flexiblen Weise. Darüber hinaus können untypisierte NULLs an vielen Orten eingesetzt werden, während untypisierte Parameter-Marker fast überall verwendet werden können, dank der verzögerten Vorbereitung. Das heißt, DB2 wird den Typ einer Parametermarke nicht auflösen, bis er den ersten Istwert gesehen hat. Um das implizite Casting abzurunden, unterstützt DB2 auch die Standardisierung von Routineparametern sowie die Zuordnung von Argumenten zu Parametern nach Namen. Erweiterte eingebaute Funktionsbibliothek in DB2 Alle RDBMs bieten Bibliotheken von Funktionen, um auf den Daten zu arbeiten. Das Problem ist, dass keine zwei die gleichen Namen für diese Funktionen verwenden, auch wenn am Ende die Funktionalität sehr ähnlich ist. Zusätzlich zu seinem eigenen traditionellen Satz von Funktionen unterstützt DB2 nun eine mit Oracle kompatible Bibliothek. Die folgende Liste bietet einen schnellen Überblick, aber es ist keineswegs eine abschließende Liste: Umwandlungs - und Besetzungsfunktionen TODATE TOCHAR TOCLOB TONUMBER TOSINGLEBYTE TOTIMESTAMP Jede dieser Funktionen unterstützt eine umfangreiche Palette kompatibler Formatierungsstrings. Die stark gestiegene Überlappung der unterstützten Funktionen zwischen den beiden Produkten impliziert einen deutlich verbesserten Out-of-the-Box-Erfolg, der eine Oracle-Anwendung für DB2 ermöglicht. Oracle SQL Dialektunterstützung Dieser Artikel hat bisher Parallelität, Datentypen, Typisierung und Funktionen abgedeckt. Aber die Unterschiede zwischen Oracle und DB2 gehen tiefer als diese. Der Stoff der SQL-Dialekte, ihre Schlüsselwörter und Semantik unterscheiden sich in einigen Bereichen. Auch jedes Produkt unterstützt einige Features, die das andere einfach nicht macht. Wenn diese Eigenschaften populär sind, beschränken sie die Fähigkeit, allgemeines SQL gegen beide Produkte einzureichen, die viele kleine und große Sprach-Tweaks veranlassen können. Tabelle 6 listet einige Highlights auf. Tabelle 6. Neue SQL-Unterstützung Funktionen zur Verschleierung von PLSQL-Objekten zum Schutz von Vendor IP Weitere Pakete stehen zur Verfügung, wie es bei der Oracle Application Enablement für DB2 für LUW Wiki ist. An dieser Stelle finden Sie auch verschiedene andere Hinweise und Tipps sowie Hintergrundinformationen. Oracle-spezifische JDBC-Erweiterungen JDBC ist eine Standard-Java-Client-Schnittstelle. Es gibt jedoch Erweiterungen, die dem Oracles JDBC-Treiber hinzugefügt wurden, um spezifische Nicht-Standard-Datentypen zu unterstützen. Um den Grad der Kompatibilität für Java-basierte Anwendungen zu maximieren, bietet der DB2 JDBC-Treiber unter anderem Unterstützung für den Aufruf von Prozeduren mit Referenzcursor, VARRAY. Und ROW-Parameter. Unterstützung für OCI-Anwendungen Viele ältere Oracle C-Anwendungen nutzen das Oracle Client Interface (OCI), um mit dem DBMS zu kommunizieren. Da DB2 9.7 einen OCI-kompatiblen Client namens DB2CI bereitstellt, der über 150 OCI-kompatible Funktionen von OCIAttrGet zu OCITransRollback unterstützt. Mit Fix Pack 2 sind sogar OCI7 APIs verfügbar. In vielen Fällen ist es möglich, einfach eine OCI-Anwendung in die DB2CI-Bibliothek zu verknüpfen, so dass die OCI-Anwendung gegen DB2 praktisch unverändert arbeiten kann. Erstellen Sie einfach die folgende Include-Datei namens oci. h: include ltdb2ci. hgt. Stellen Sie sicher, dass die neue oci. h ist vor Oracles oci. h in der PATH. Dann ersetzen Sie die - loci. dll-Link-Option mit - ldb2ci. dll in Ihrem Makefile und kompilieren Sie Ihre Anwendung. SQLPlus-Skriptunterstützung mit CLPPlus Oft, DDL-Skripts und sogar Berichten werden mit dem SQLPlus-Befehlszeilenprozessor geschrieben. Um es einfacher zu machen, diese Skripte zu übertragen, sowie die Fähigkeiten der Entwickler, die sie schreiben, stellt DB2 einen SQLPlus-kompatiblen Befehlszeilenprozessor, genannt CLPPlus, wie in Abbildung 5 gezeigt. Abbildung 5. SQLPlus-kompatibles CLPPlus-Tool Das Tool bietet die Folgende Funktionalität. SQLPlus-kompatible Befehlsoptionen Variable Substitution Spaltenformatierung Reporting-Funktionen Kontrollvariablen Oracle Forms-Aktivierung Oracle Forms ist ein Legacy-Softwareprodukt, das zum Erstellen von Dateneingabesystemen für die Datenbank verwendet wird. Einige Kunden und ISVs haben Hunderte von Oracle Forms-Bildschirmen, die einen Teil einer Anwendung darstellen oder sind. IBM hat mit realease LLC und WonderWorks Group zusammengearbeitet, um nahtlose Oracle Forms zu Java Umwandlungsfähigkeit zur Verfügung zu stellen. Beide Partner bieten Werkzeuge, die Oracle-Formulare in die Java-Sprache übersetzen, in einer hoch automatisierten, effizienten und wartbaren Weise, die das Aussehen und das Gefühl der ursprünglichen Formular-GUI bewahrt, ohne neue Abhängigkeiten auf einem Drittanbieterprodukt zu erzeugen. WonderWorks FusionPaaS kann eine klassische Oracle Fusion Forms-Anwendung konvertieren, wie die in Abbildung 6 dargestellte, in eine J2EE-Anwendung, wie in Abbildung 7 gezeigt, dh 100 Prozent webfähig, auf einem iPad zum Beispiel oder einem anderen Smartphone ausgeführt wird , Und in Web 2.0-Anwendungen wie Google Maps integriert werden. Abbildung 6. Original-Oracle-Fusion-Formulare Abbildung 7. Konvertierte Form mit FusionPaaS Weitere Informationen über WonderWorks FusionPaaS finden Sie im Whitepaper über die Oracle Application Enablement auf DB2 für LUW Wiki. Kontinuierliche Verfeinerung Da immer mehr Kunden und Partner DB2 ermöglichen, werden Feature-Anfragen und Verfeinerungen in die DB2 Fix Pack-Streams aufgenommen, um das Kompatibilitätsniveau kontinuierlich zu verbessern. DB2 9.7 Fix Pack 1 Fix Pack 1 stellt die folgenden Funktionen vor. CCFLAGS-Unterstützung zur Maximierung der Menge an gemeinsam genutztem Code zwischen Oracle und DB2 für Vendor-Anwendungen. FORALL und BULK COLLECT Unterstützung. Die SUBSTRB-Funktion und Verfeinerungen nach SUBSTR. Verbesserungen beim Umgang mit booleschen Ausdrücken. Der OCI-Applikations-kompatible DB2CI-Client. CREATE OR REPLACE für Typen. Erweiterte Unterstützung für PLSQL-Funktionen wie INOUT-Parameter, die Möglichkeit, Tabellen aus einer Funktion zu schreiben und vieles mehr. Die Partnerschaft mit Realease, um Oracle Forms Anwendungen zu ermöglichen. DB2 9.7 Fix Pack 2 Fix Pack 2 stellt die folgenden Funktionen vor. NCHAR. NVARCHAR2 Und NCLOB-Unterstützung, zusammen mit verschiedenen NCHAR-Funktionen wie TONCHAR und TONCLOB. PLSQL-Code-Verschleierung mit den Funktionen DBMSDDL. WRAP und DBMSDDL. CREATEWRAPPED. Benannte Parameteraufruf und DEFAULTs in Funktionen. DEFAULT s in Verfahren, die nicht am Ende sind. BULK COLLECT Leistungsverbesserungen. DB2 9.7 Fix Pack 3 Fix Pack 3 stellt die folgenden Funktionen vor. Fähigkeit, kleine LOBs zu vergleichen, um Seitengrößenbeschränkungen zu überwinden. NUMBER Leistungsverbesserungen. RATIOTOREPORT-Funktion. Verbesserungen an RAISEAPPLICATIONERROR. Runtime Reinheit Ebene Durchsetzung. DB2 9.7 Fix Pack 4 Fix Pack 4 stellt die folgenden Funktionen vor. JDBC-Unterstützung für ROW und ARRAY OF ROW. Multi-Action Trigger Unterstützung. Unterstützung für BEFORE Trigger, die die Datenbank aktualisieren. Unterstützung für LIKE mit nicht konstanten Mustern. LISTAGG String Aggregation Unterstützung. Verbesserungen der autonomen Transaktionsunterstützung. DB2 9.7 Fix Pack 5 Fix Pack 5 stellt die folgenden Funktionen vor. JDBC-Unterstützung für verschachtelte ROW und ARRAY. Nested ROW und ARRAY Unterstützung für PLSQL. Neue NVL2. SUBSTR2 Und HEXTORAW-Funktionen. Unterstützung für BOOLEAN in ROW und ARRAY Typen. Verbesserungen an anonymen Blöcken unterstützen. ProC-Unterstützung Leistungsverbesserungen für SQL, die CHAR-Spalten mit VARCHAR2-Werten vergleichen. DB2 10.1 stellt die folgenden Funktionen vor. Bis zu einer Größenordnung bessere Leistung für Logik schweres SQL PL und PLSQL. Unterstützung für Typdeklarationen lokal zu einem PLSQL-Block. Unterstützung für Prozedurdeklarationen lokal zu einem PLSQL-Block. Statement Level PLSQL löst Row und Column Level Access Control (RCAC) aus, wodurch es einfach ist, FGAC abzubilden. DB2 10.1 Fix Pack 2 Fix Pack 2 stellt die folgenden Funktionen vor. Bessere Leistung für NOTFOUND Ausnahmebehandlung in PLSQL. Unterstützung für SUBTYPE in PLSQL. Unterstützung für PLSQL Pipeline-Tabellenfunktionen. Erlaube die Angabe des Trimmzeichens für LTRIM - und RTRIM-Funktionen. Native NUMBER Unterstützung für die MOD-Funktion. Sehr verbesserte Leistung für den Data Studio PLSQL und SQL PL Debugger. DB2 10.5 stellt die folgenden neuen Funktionen vor. Unterstützung für die Indizierung von Ausdrücken. Unterstützung für Oracle-kompatible, einzigartige Index-Semantik. Erlaube Tabellendefinitionen mit Zeilen über 32KB. Unterstützung für die Funktionen INSTRB, INSTR2, INSTR4, LENGTHB, LENGTH2, LENGTH4 und SUBSTR4. Unterstützung für dblink-Syntax bei der Referenzierung von Remote-Tabellen. Nachfolgende Fixpacks und anstehende Hauptversionen von DB2 sollen eine noch höhere Kompatibilität bieten. Die Aktivierung von DB2 ist so einfach wie Drag & Drop Angesichts der engen Ausrichtung von DB2 mit PLSQL und Oracle SQL besteht kein Bedarf an einem komplexen Migrationstoolkit. Stattdessen können Sie das IBM Data Movement Tool verwenden, mit dem Sie einfach Tabellen, Pakete oder ganze Schemata von Oracle auf DB2 per Drag & Drop verschieben können. Es sind nur minimale Anpassungen erforderlich, um eine Anwendung auf DB2 zu verschieben oder eine Anwendung zu ändern, damit dieselbe Quelle sowohl für DB2 als auch für Oracle funktionieren kann. Die Schritte können so einfach wie folgt sein. Festlegen der notwendigen Registrierungsvariablen: db2set DB2COMPATIBILITYVECTORORA db2set DB2DEFERREDPREPARESEMANTICSYES Neustart des Datenbankmanagers: db2stop db2start Erstellen einer Oracle-kompatiblen Datenbank: db2 create database mydb pagesize 32 K db2 update db cfg für mydb mit autoreval deferredforce Starten Sie das Data Extract Tool und stellen Sie eine Verbindung zum Oracle - und DB2-Datenbanken, wie in Abbildung 8 dargestellt. Abbildung 8. Drag & Drop Oracle-Schemata auf DB2 mit IBM Data Extract Tool Sobald Sie verbunden sind, können Sie wählen, um die DDL nur oder beide DDL und Daten zu extrahieren. Schließlich haben Sie zwei Möglichkeiten: Bereitstellen, indem Sie die generierten Scripts ausführen oder mit dem interaktiven Bereitstellungsfenster fortfahren. Die spätere wird für die meisten nicht-trivialen Anwendungen empfohlen. Verschieben Sie die gewünschten Schemata von Oracle zu DB2 mithilfe der interaktiven Bereitstellung wie in Abbildung 9 gezeigt. Abbildung 9. Drag & Drop Oracle-Schemata auf DB2 mit IBM Data Extract Tool Im interaktiven Bereitstellungsmodus sehen Sie einen Navigationsbaum, der alle aus der Oracle-Datenbank extrahierten Objekte anzeigt . Wählen Sie alle Objekte aus und führen Sie die Option "Bereitstellung" aus. Als Ergebnis wird das Tool die Objekte auf DB2 kopieren und den Fortschritt aufzeichnen. Einige Objekte können nicht erfolgreich implementiert werden, und das Tool gibt Ihnen die Möglichkeit, mit diesen zu arbeiten. Bei der Auswahl eines Objekts sehen Sie die DDL zusammen mit dem Fehler DB2 angetroffen. Jetzt können Sie die Definition nach Bedarf reparieren und neu einstellen. Ziel ist es, alle Objekte interaktiv alleine auf DB2 zu verschieben. Sizing up die Aktivierung auf DB2 So wie einfach wird es wirklich sein, um Ihre Anwendung auf DB2 10 Die Antwort ist natürlich, dass es hängt ab. IBM hat ein Tool zum Download namens MEET DB2. Dieses Tool kann alle Objekte in deiner Oracle-Datenbank analysieren und punkten. Es gibt einen Bericht darüber, was aus der Box funktionieren wird und wo Anpassungen vorgenommen werden müssen. Um eine schnelle Idee zu bekommen, kannst du MEET DB2 herunterladen und es selbst probieren. Wenn Sie es vorziehen, Ihr IBM Team, erreichbar bei askdataca. ibm. Kann Ihnen helfen, schnell eine Kompatibilitätsbewertung Ihrer aktuellen Oracle Datenbank zu liefern. Abbildung 10 zeigt ein Beispiel für die Ausgabe aus dem MEET DB2-Tool. Abbildung 10. MEET DB2 Report Tool zur Bewertung Im Beispielbericht zeigt das Tool an, dass 98 der PLSQL-Anweisungen sofort auf DB2 übertragbar sind. Es bricht auch die Aussagen nach Objekttyp und zeigt, wie viele von jedem Objekttyp während einer Migration Aufmerksamkeit erfordern würde. Seit DB2 9.7 wurden Hunderte von Anwendungen, die Millionen von PLSQL-Code-Zeilen enthalten, detailliert mit einer durchschnittlichen Out-of-the-Box-Übertragungsrate von 90-100 Prozent analysiert. Abbildung 11 zeigt Statistiken, die gegen DB2 9.7 Fix Pack 5 durchgeführt wurden. Abbildung 11. Median von über 98 Prozent der ausgeführten Aussagen Th2 größten 74 Anwendungen von 171 lieferten über 2,5 Millionen Codezeilen. Zwischen 90,1 Prozent und 99,9 Prozent der Codezeilen waren sofort auf DB2 übertragbar. Architektur DB2s Ansatz zur Anwendung Umwandlung ist grundsätzlich anders als die der klassischen Umwandlung. Die meisten Anbieter bieten Werkzeuge, die aus der Ausgangssprache in die Zielsprache offline und mit manueller Hilfe übersetzen. Das Ergebnis ist sehr gewundener Code, der sehr schwer zu pflegen ist. Wenige Anbieter fügen Intercept-Layer hinzu, die die Quellsprache dynamisch in der Zielsprache emulieren. Natürlich sind Emulationen langsam durch Design, vor allem, wenn irgendein Versuch gemacht wird, um korrekte Semantik zu erreichen. Für DB2 ist die Kompatibilität tief in alle Ebenen seines Motors eingebaut, die sich mit Semantik und Syntax beschäftigt. Anstatt um Einschränkungen zu arbeiten, wurde DB2 nativ erweitert, um die notwendigen Funktionen zu unterstützen. Das Architekturdiagramm in Abbildung 12 hebt die Bereiche von DB2 hervor, die signifikante Änderungen zur Unterstützung des Oracle SQL - und PLSQL-Dialekts bewiesen haben. Abbildung 12. Architektur der DB2-Compiler - und Runtime-Engine Die Abschnitte für SQL-Parser und Rewrite im SQL-Compiler, im PLSQL-Parser im PL-Compiler, in der PL-Laufzeit und in der SQL-Laufzeit wurden signifikant erweitert oder hinzugefügt, um den Oracle-Dialekten Rechnung zu tragen. Häufig gestellte Fragen Ist diese Technologie für kritische Anwendungen bereit Eine der größten US-Banken hat ihr Online-Banking-System diese Technologie anvertraut. Wenn Sie Ihr US-Bankkonto heute überprüft haben, haben Sie wahrscheinlich die Ausführung von PLSQL-Paketen auf DB2 getrieben. Welche Version von Oracle unterstützt DB2 10 Unterstützung Die für die SQL - und PLSQL-Dialekte vorgesehene Berichterstattung basiert streng auf dem, was von Anwendungen verwendet wird. Es gibt Funktionen, die in Releases eingeführt wurden, so aktuell wie Oracle 11g, die unterstützt werden, während einige Konstrukte, die in Oracle 8i verfügbar sind, nicht unterstützt werden. In einer Studie von 71 Anwendungen mit über 2,5 Millionen Zeilen, zwischen 90,1 Prozent und 99,9 Prozent des Codes verschoben auf DB2 9.7.5 ohne Änderung mit einem Median von über 98. Viele der verbleibenden Anpassungen können automatisiert werden, seitdem angesprochen wurde in DB2 10, oder sind sonst wiederholt. Wie schnell wird meine Oracle-Anwendung auf DB2 laufen Das ist die Million-Dollar-Frage Leider, Oracle Lizenzbedingungen Begriffe verbieten jedermann zu veröffentlichen Benchmarking-Ergebnisse ohne vorherige schriftliche Zustimmung. Durch seine sehr Design und bestätigt durch Qualitätssicherung Benchmarking, eine Anwendung geschrieben gegen PLSQL auf DB2 ist so schnell wie eine schriftlich gegen SQL PL auf DB2 geschrieben. Verkäufer, die den Aktivierungsprozess durchgemacht haben, sind in der Regel angenehm überrascht. Wie viel Arbeit war es, diese Features zu bieten. Nicht annähernd so viel wie man denken könnte. Einige anfängliche Arbeiten wie CONNECT BY und NUMBER. Wurde für DB2 9.5 taktisch gemacht. Im Ernst war der Aufwand in DB2 9.7 in weniger als 18 Monaten abgeschlossen. Seitdem werden wir in zunehmendem Maße das Niveau der Kompatibilität verbessern, wie es die Kunden benötigen. Was sind häufige Komplikationen bei der Aktivierung von Oracle auf DB2 Die Kompatibilität von DB2 ist offensichtlich nicht 100 Prozent, also wird es wahrscheinlich einige Schluckauf geben, wenn man zum ersten Mal in DB2 konvertiert. Viele dieser Herausforderungen sind trivial und einfach zu beheben. Beispielsweise unterstützt DB2 keine lokal deklarierten Funktionen. Sie müssten also deklarierte Funktionen in das Paket bringen oder sie mit lokal deklarierten Prozeduren ersetzen. Welche Editionen von DB2 unterstützen Oracle SQL-Kompatibilitätsfunktionen Alle oben beschriebenen Funktionen werden auf allen Plattformen unterstützt, die von DB2 für Linux, UNIX und Windows unterstützt werden. Dazu gehören Windows, Linux (auf Intel, Power und Mainframe), HP und Sun Solaris. Alle Editionen von DB2 werden unterstützt. Es gibt einige technische Einschränkungen bei der Verwendung von PLSQL-Funktionen und Triggern in DPF. Unterstützt DB2 Express-C PLSQL Ja Sie können aus den Datenbankgrößenbeschränkungen von Oracle XE ausbrechen, indem Sie auf DB2 10 Express C umschalten. Und am besten: Sie können es auf der Cloud ausprobieren (siehe Abschnitt Verwandte Themen). Was war das härteste Feature zu implementieren Bei weitem ist VARCHAR2 Semantik am schwersten zu implementieren. Die nachlaufenden Leerzeichen bedeuten Semantik und NULL ist leere String fortsetzen. Fazit Dank seiner nativen Multi-Dialekt-SQL-Unterstützung ermöglicht der neue DB2 die einfache Aktivierung von Oracle-Anwendungen für DB2. Anbieter von verpackten Anwendungen können ihre Anwendungen auf Oracle und DB2 zu minimalen zusätzlichen Kosten anbieten. Kunden können frei wählen, der Anbieter, der die Technologie bietet, die sie benötigen, ohne von früheren Entscheidungen begrenzt zu sein. Um diese Funktionen zu testen, laden Sie eine Testversion von DB2 10 herunter (siehe Abschnitt Verwandte Themen). Downloadable resources Verwandte Themen Nehmen Sie den kostenlosen, selbstgesteuerten DB2 Workshop für Oracle Professionals, um mehr über dieses Thema zu erfahren. Read Whats neu in DB2 10 für Linux, UNIX und Windows. Eine Materie der Zeit: Das zeitliche Datenmanagement in DB2 10 bietet mehr Informationen. Erfahren Sie mehr durch das Lesen von DB2 V10.1 Multi-Temperatur Data Management Empfehlungen. Check out DB2 V10.1 Abfrage Leistungserweiterungen. Besuchen Sie IDUG DB2 Tech Channel, um zu hören und zu sehen DB2 Tech Talk-Videos auf Themen wie ein DB2 10 technische Tiefe Tauchen auf die wichtigsten Features der neuen Produkt-Release. Siehe das DB2 10-Launchpad, um einen Überblick über den Wert von DB2 zu erhalten. Check out MEET DB2 und analysiere deine Oracle-Datenbank, um die Kompatibilität mit DB2 zu schätzen. Watch the Moving to DB2 ist ein einfaches Video für eine Demonstration, die einen Überblick über die Anwendungsfreigabe für DB2 gibt. DB2 CLPPlus zeigt die Verwendung der SQLPlus-kompatiblen CLPPlus-Shell. Watch DB2: Native PLSQL-Unterstützung, die die vielen von DB2 unterstützten PLSQL-Funktionen präsentiert. Check out DB2 pureScale. Mit DB2 pureScale können Sie skalieren und bieten kontinuierliche Verfügbarkeit für Ihre OLTP-Anwendungen. Überprüfen Sie IBM DB2 e-Kit für Datenbank-Profis, registrieren Sie sich für dieses E-Kit und erfahren Sie, wie einfach es ist, für DB2 für Linux, UNIX und Windows geschult und zertifiziert zu werden. Erweitern Sie Ihr Kompetenzportfolio oder erweitern Sie Ihre DBMS-Vendor-Unterstützung um DB2. Versuche IBM DB2 Express-C 10 im Kompatibilitätsmodus und in der Cloud. Mit der Cloud können Sie die DB2-Kompatibilität mit Oracle problemlos testen, ohne dass Sie DB2 lokal installieren müssen. Laden Sie eine kostenlose Testversion von DB2 10 für Linux, UNIX und Windows herunter. Download DB2 Express-C 10. Eine kostenfreie Version des DB2 Express-Datenbankservers für die Community. Bewerten Sie IBM Produkte in der Art und Weise, wie es Ihnen am besten passt: Laden Sie eine Produktversion herunter, probieren Sie ein Produkt online, verwenden Sie ein Produkt in einer Cloud-Umgebung oder verbringen Sie ein paar Stunden in der SOA Sandbox, um die Implementierung von Service Oriented Architecture effizient zu erlernen. Melden Sie sich an oder registrieren Sie sich, um Kommentare hinzuzufügen und zu unterzeichnen. SM Datenbank - und Wiederherstellungsprotokoll TSM Datenbankversion 5.5 und früher Diese Informationen wurden auf eine separate Seite verschoben, da TSM 5.x jetzt nicht unterstützt TSM 5.x Grundlegende Datenbankstruktur TSM verwendet Eine DB2 relationale Datenbank. Das bedeutet, dass es viel größer sein kann als die alte Legacy-Datenbank, braucht keine Datenbank-Audits und wird sich bei Bedarf automatisch neu organisieren. Software-Datenbankspiegelung wird nicht mehr unterstützt. Eine Sache zu beachten ist, dass Sie keine anderen DB2-Anwendungen auf dem gleichen Server wie die, die Hosting Ihre TSM-Datenbank, aber Sie können mehrere TSM-Instanzen auf einem Host-Server. Eine TSM-Instanz ist alles, was erforderlich ist, um einen TSM-Server auszuführen, einschließlich Datenbank, Protokolle, Speicherpools usw. Da es sich bei der Datenbank um DB2 handelt, ist es möglich, direkt außerhalb von TSM zu verbinden und Abfragebefehle auszuführen. Um dies in einer Windows-Umgebung zu tun, gehen Sie folgendermaßen vor: Öffnen Sie eine Windows-Eingabeaufforderung. Führen Sie den Befehl db2cmd aus. Dies öffnet ein neues Befehlsfenster mit der DB2-Umgebung. Führen Sie aus diesem neuen Fenster die folgenden Befehle aus. Set DB2INSTANCEserver1 db2 connect to TSMDB1 db2 set schema TSMDB1 In einer UNIX - oder Linux-Umgebung ist der Prozess: Melden Sie sich mit der Instanzbenutzer-ID an. Führen Sie aus einer Shell die folgenden Befehle aus. Db2 connect to TSMDB1 db2 set schema TSMDB1 Nachdem du eine Verbindung zur Datenbank herstellst, kannst du DB2 select commands ausführen. Um beispielsweise die Liste aller Tabellenindizes zu erhalten, die vom Tivoli Storage Manager-Server verwendet werden, führen Sie den folgenden Befehl aus: db2 select indname von syscat. indexes where indschemaTSMDB1 Um eine Liste von Indizes zu erhalten, die von einer bestimmten Tabelle verwendet werden, verwenden Sie die Tabname-Parameter, um den Tabellennamen zu identifizieren. Um beispielsweise eine Liste von Indizes zu erhalten, die von der BACKUPOBJECTS-Tabelle verwendet werden, führen Sie den folgenden Befehl aus: db2 select indname von syscat. indexes wobei indschemaTSMDB1 und tabnameBACKUPOBJECTS Um eine Liste von Tabellennamen zu erhalten, führen Sie den folgenden Befehl aus: db2 quotselect tabname von syscat. tables wo tabschemaTSMDB1 und typeVquot Datenbank Sizing und Tuning Die Datenbank kann in bis zu 128 Verzeichnissen oder Containern vorhanden sein, um den richtigen DB2-Term zu verwenden. Die Daten werden gleichmäßig über die Verzeichnisse gestreift und die Container benötigen kein Anfangsformat, bevor sie verwendet werden können. Die Q DBSPACE-Ausgabe unten zeigt eine Datenbank, die über 3 Container gestreift wird. (MB) VERFÜGBAR (MB) tsmtivolidbdir001 102,144 6,919,22 98,224 tsmtivolidbdir002 102,144 6,919,22 98,224 tsmtivolidbdir003 102,144 6,919,22 98,224 Wenn eine TSM-Datenbank zunächst auf mehreren Dateisystemen erstellt wird, wird diese Datenbank gleichmäßig verteilt. Deutsch: www. tab. fzk. de/de/projekt/zusammenf...ng/ab117.htm. Englisch: www. tab. fzk. de/en/projekt/zusammenf...ng/ab117.htm Über alle Dateisysteme. Allerdings, wenn Sie ein zusätzliches Dateisystem in den Datenbankbereich mit dem Befehl extend dbs hinzufügen, wird DB2 die Datenbank nicht ausgleichen, um die Daten gleichmäßig zu verbreiten. Dies bedeutet, dass, wenn einige der ursprünglichen Datei-Räume waren 100 voll, werden sie immer noch 100 voll, nachdem der neue Dateiplatz hinzugefügt wird und dies könnte dazu führen, dass die TSM zu stoppen. Wenn Sie TSM Server V6.2 oder höher ausführen, können Sie die Datenbank dynamisch mit DB2-Befehlen ausgleichen. I suggest that you look up the IBM technote about this, and also contact IBM for advice before trying this. However in outline the process goes like this: At a quiet time, log into the DB2 command line with the DB2 administrator userid and run these commands db2 connect to tsmdb1 db2 set schema tsmdb1 db2 alter tablespace tablename rebalance The tables that IBM mention in the technote are SYSCATSPACE, USERSPACE1, LARGESPACE1, LARGEIDXSPACE1, IDXSPACE1, SYSTOOLSPACE. It can take about 30 minutes to rebalance a large tablespace. When all tablespaces have done the rebalance and execute the following commands to reduce the same list of tablespaces. db2 alter tablespace tablename reduce max After the rebalancereduce, the file systems should be equally utilized and none should be full The maximum database size for TSM 6.3 and TSM 7.1 is 4TB, and 2TB for TSM 6.2. The DB2 database is largely self tuning, so there is no requirement for DB2 tuning skills. A new parameter, DBMEMPERCENT, replaces the old BUFFPOOLSIZE. This set of buffers contains much more data than the old buffer so the recommendation is to set its size to unlimited. In fact, TSMDB2 will try to change it to unlimited on startup. Deduplication reduces the amount of storage space used for backups, but this comes at the cost of increased database space as TSM must track the metadata needed to reconstitute deduplicated data. There is no exact formula for working out that database increase, but it is possible to estimate the database size impact. Deduplication data is stored in chunks of variable size, but the average size is about 100k. Each chunk uses about 490 bytes in the database, and then another 190 bytes if it is copied to a copy storage pool. Compare that with the normal overhead of 200 bytes needed to store metadata for every copy of every file backed up. If you want to know how many files are stored on your TSM server, use the following select command select sum(cast(numfiles as bigint)) from occupancy where nodename is not null and filespaceid is not null So it would appear reasonably easy to estimate your database size, all you need to know is backup file count and the number of bytes in your storage pools. However it is not quite as easy as this, as the first set of chunks that are created are called base chunks and they are not automatically expired when that file is deleted, as other files may be linked to them. Worst case, and very unlikely, is that this effect could double the chunk count. So, considering an enterprise that is managing 20TB of data, with the primary storage pool deduplicated, and a copy storage pool that is not deduplicated. Estimated of chunks created 200,000,000 (20,000,000,000,000 100,000) Database cost for storing chunks in primary pool 98,000,000,000 (200,000,000 x 490) Database cost for storing chunks in copy pool 38 GB (200,000,000 x 190) Initial estimated database cost for deduplication 136 GB Add in the worst case scenario for non-expiring base chunks then database cost is 272GB If a copy storage pool is deduplicated, the same cost would apply as if it were stored in an additional primary pool. IBM provides a pearl script that provides details on how your database handles deduplication content, once you have been running dedup for a while. Search the IBM site for tsmdedupstats. pl and you should find it. It gives you information like database size broken down by rows in the large tables, the number of client nodes registered, by storage pool, the percentage of pool deduplicated and how many bytes deduplication is saving in each pool. It also gives you detailed deduplication information like chunk count and average chunk size. The database uses DB2 relational consistency rules to prevent incorrect data from entering, and is self auditing. The database will also run automatic runstats from time to time. This is a DB2 feature that optimises storage paths through the database to improve performance. The database also uses relational indices, so it does not require special index tables to speed up SQL queries. Recovery log sizing and tuning TSM has three recovery logs. The Active log contains updates that have not been committed to disk yet and is used for roll-forward or roll-back in case of problems. Once a transaction is committed, the data is moved to the archive log. The default size for the Active log is 2GB and the size can be increased by increments of 512MB right up to 128GB. The Archive log contains committed transaction data and is used for PIT recovery of the database. The Archive log is cleared out by a full database backup. However it retains all data updates applied right back to the second last backup, so you need to size your archive log with that in mind. The Failover Archive log TSM collectively calls these three logs the recovery log, but a DB2 DBA would just call them transaction logs. The log files form part of the TSM database, and unlike the legacy TSM database there is no need to create and format log volumes. The logmode is equivalent to legacy roll-forward. In DB2 terms, these are archive logs, not circular logs. This means that the log files can fill up, so log file management is still required. You can specify a failover log for the Archive log to help prevent this, but the Active log cannot failover and the size is fixed between 2GB and 128GB, so dont allocate all the space that you have available for the Active log, keep some in reserve for emergencies. It is highly recommended that FailoverArchiveLog space be set aside for possible emergency use. You can use slower disks for FailoverArchiveLog space. If the Active log fills up and the server stops, the process to get your TSM server up again is: DSMSERV DISPLAY LOG - to check the current log status Update the Active log size parameter in dsmserv. opt Start the server up Prevention is better than cure, and the active log can become pinned by client sessions that are either hung or running very slowly. A pinned backup can result in the active log becoming full. It is possible to automatically identify and terminate any hung or long-running client sessions by using the THROUGHPUTDATATHRESHOLD and THROUGHPUTTIMETHRESHOLD options. These are specified in the dsmserv. opt file and are used by the server to monitor the status of each client session. If after the amount of time specified by THROUGHPUTTIMETHRESHOLD, the average throughput is less than the value specified by the THROUGHPUTDATATHRESHOLD parameter, then the session will be cancelled by the server. You code these parameters in dsmserv. opt like this: throughputtimethreshold 100 throughputdatathreshold 60 This means that if a session is not achieving an average throughput of at least 60KB per second after running for 100 minutes, the server will cancel this client session. These values are for illustration purposes, you need to pick the values that work best for your site. The archive logs should be automatically deleted after a full database backup completes, but in some cases this might not happen and then the archive logs will continue to grow until the filespace is full. Run the DB2 command get db cfg for tsmdb1 and check the output, which should have the default values set like this. Number of database backups to retain (NUMDBBACKUPS) 1 Recovery history retention (days) (RECHISRETENTN) 0 Auto deletion of recovery objects (AUTODELRECOBJ) ON Once the number of backups specified by the NUMDBBACKUPS is reached, the old backups are marked as expired and will be deleted by the next database backup. The AUTODELRECOBJ parameter specifies whether the database log files, backup images, and load copy images associated with those backups should be deleted at the same time. These parameters cannot be changed from within TSM by a TSM administrator and should not be changed from the DB2 command line, but left at the default values. If you get a LOGREAD388 error, then the TSM server will crash. This error happens when a recovery log volume becomes corrupted. If this happens to you, your first option should be to check your operating system error logs. If they indicate that a file system has corruption errors or disk errors, get your system administrator to check out the operating system and see if the error can be fixed there. Your next option is to check to see if your logs are mirrored, and if so then tell TSM to use the mirror copy. From an OS command line issue the command below and check the output dsmserv display logv this will tell you if the logs are mirrored if the command shows more than one copy for the log files. If they are mirrored, then add the option MIRRORREAD LOG VERIFY in the dsmserv. opt file, and that will force the TSM server to sync from the other copy. If dsmserv. opt already contains a MIRRORREAD line then comment it out to make sure that your option is used. If the TSM server starts OK, then it has fixed the issue by copying the uncorrupted data over from the copy log, and all is well. If this fails, then you will probably have to restore your database to the latest backup, but you might want to contact IBM for further advice first. You may want to change the location of the achive logs, maybe because you have added a bigger file system and this is usually quite easy. Take a full database backup, not just because that is the starting point for any change, but also because a full backup of the TSM database will clear the archive logs down. Halt the TSM server Edit the dsmserv. opt, changing the values for ARCHLOGDirectory and ARCHFAILOVERLOGDIR to your new paths. Start the TSM server up again and the directory structure will be automatically generated in the new empty filesystem. There is no need to copy the archive logs over from the original location, because your full backup emptied them out. If you want to prove to yourself that this worked, then a query log fd command should show the new locations. If you really need to, or even just want to, it is possible to update DB2 directly to change the log location. You should really ask your IBM support rep for advice before you start, but an outline process would go like. backup your database (full), devconfig and volhistory files. Halt your TSM Server Login to your DB2 command line and check the existing log locations with command db2 get db cfg for tsmdb1 Create your new archive log directory and paths, and make sure that the TSM instance user has readwrite access to them. Update DB2 to use the new path structure with these 3 commands, substituting your paths as appropriate db2 update db cfg for tsmdb1 using OVERFLOWLOGPATH tsmnewarchivelogpath db2 update db cfg for tsmdb1 using LOGARCHMETH1 DISK:tsmnewarchivelogarchmethpath db2 update db cfg for tsmdb1 using FAILARCHPATH tsmnewarchivelogfailarchpath run the db2 get db cfg for tsmb1 command again and make sure your changes worked Edit your dsmserv. opt and update the archive log path entry to match the changes you made to DB2 Start your TSM Server up Run the q log fd command and check archive log location. Activity, Schedule and Event logs The TSM server stores information about server and client activity in three places the Activity Log, The Events Log and the Summary Log. The Activity Log tells you everything that is happening on the TSM server, the Events log details all the activity that is triggered by the TSM server Scheduler, including both Admin and Client schedules. The Summary Log, as the name suggests, stores summary data of things like expiration, reclamation, backups and restores. Since TSM 6.0 all three of these logs are stored in the TSM database so they use database space and can cause problems if they hold too much data. To find out how many days worth of data they are holding, run the QUERY STATUS command and look for lines like Activity Log Retention Period: 5 Day(s) Event Record Retention Period: 10 Day(s) Activity Summary Retention Period: 30 Day(s) You can change these default entries using the SET command as shown below. The numbers are for illustration purposes and should not be considered as recommendations. Most people stick with the defaults. If you increase them, then monitor the impact on database size. set ACTlogretention 10 Set EVentretention 12 Set SUMmaryretention 20 If you want to to know exactly how much data is held in the event and summary tables, you could try the following (rather complicated) queries that appeared in IBM tech notes in 2014. You need to run them from a DB2 command line, not the TSM command line, so you initialy connect to the TSM database then run the queries like this db2 connect to tsmdb1 db2 set schema tsmdb1 db2 select tu. name, cast(rowsintable as bigint),cast(tableusedmb as bigint),cast(tableallocmb as bigint),cast(indexusedmb as bigint),cast(indexallocmb as bigint) - from ( select substr(tabname,1,28) as name, bigint(card) as rowsintable, bigint(float(t. npages)(1024(b. pagesize1024))) as tableusedmb from syscat. tables t, syscat. tablespaces b where t. tbspaceb. tbspace and t. tabschemaTSMDB1 ) as tu, ( select substr(tabname,1,28) as name, bigint(sum(i. nleaf)(b. pagesize1024)1024) as indexusedmb from syscat. indexes i, syscat. tablespaces b - where i. tbspaceidb. tbspaceid and i. tabschemaTSMDB1 - group by tabname, pagesize ) as iu, ( select substr(tabname,1,28) as name, bigint(dataobjectpsize1024) as tableallocmb, bigint(indexobjectpsize1024) as indexallocmb from sysibmadm. admintabinfo ) as ta - where tu. nameiu. name and tu. nameta. name and tu. nameSCHEDULEEVENT with ur db2 select tu. name, cast(rowsintable as bigint),cast(tableusedmb as bigint),cast(tableallocmb as bigint),cast(indexusedmb as bigint),cast(indexallocmb as bigint) - from ( select substr(tabname,1,28) as name, bigint(card) as rowsintable, bigint(float(t. npages)(1024(b. pagesize1024))) as tableusedmb from syscat. tables t, syscat. tablespaces b - where t. tbspaceb. tbspace and t. tabschemaTSMDB1 ) as tu, ( select substr(tabname,1,28) as name, bigint(sum(i. nleaf)(b. pagesize1024)1024) as indexusedmb - from syscat. indexes i, syscat. tablespaces b where i. tbspaceidb. tbspaceid and i. tabschemaTSMDB1 - group by tabname, pagesize ) as iu, ( select substr(tabname,1,28) as name, bigint(dataobjectpsize1024) as tableallocmb, bigint(indexobjectpsize1024) as indexallocmb from sysibmadm. admintabinfo ) as ta - where tu. nameiu. name and tu. nameta. name and tu. nameACTIVITYSUMMARY with ur Backing up the TSM Database It is very important that your TSM database is regularily backed up using TSM commands, so it can be recovered if it gets corrupted. Most sites take 2 types of backup, an on-site copy to disk and an off-site copy to tape. The location of TSM database backup files are stored in the volume history, so it is essential at a minimum that you backup both the volume history file, and the TSM database. It is also a good idea to backup the device config file at the same time. The shortest database backup command is simply backup db devclassclassname Where the classname in the command points to a sequential access device class, either disk or tape. This will default to an incremental backup that will use scratch tapes and the command line will not hang while the backup runs. You can change these defaults by using parameters ScratchNo means dont use scratch tapes and then you have to tell TSM which volumes to use with a VOLumenamescsvvolumelist parameter WaitNo means the command will wait until the database backup completes before it moves on to the next task. This is typically used in automated server management scripts. The TYPE parameter is used to decide what tpe of backup to take. Options are TypeFull, TypeIncremental or TypeDBSnapshot. A Full backup will copy the entire TSM database and will then truncate the TSM server active and archive logs. An Incremental backup will copy the changes that have been made to the TSM database between the current point in time and the last full database backup. The maximum number of incremental backups you can run between full backups is 32. A DBsnapshot is also a full backup of the TSM database, but it runs independently of the full incremental backup sequence and will not truncate the TSM database transaction logs. BACKUP DEVCONFIG command backups up the device class definitions, library definitions, drive definitions and exit definitions. You must have this information available to restore the Tivoli Storage Manager database. The command is simply with an optional Filenames parameter where you can tell TSM where to store the backups. If you dont use the Filenames parameter, then TSM looks for the filename that is contained in the server options file, under the DEVCONFIG option. The BACKUP VOLHISTORY command saves history records for database backup and dump volumes, and information about lots of other volumes, for instance Volumes removed by using the DELETE VOLUME command or during reclamation of scratch volumes. The command is simply with an optional Filenames parameter where you can tell TSM where to store the backups. If you dont use the Filenames parameter, then TSM looks for the filename that is contained in the server options file, under the VOLUMEHISTORY option. There is one thing to be aware of, if you start poking about in the db2diag. log file for the DB2 system that the TSM server runs on. You might see error messages like MESSAGE. ADM10502W Health indicator quotDatabase Backup Requiredquot (quotdb. dbbackupreqquot) is in state quotManual backup requiredquot on quotdatabasequot quottsm1.TSMDB1quot This is just the DB2 health monitor warning that the database config is set to AUTODBBACKUP OFF as DB2 thinks it should be managing database backups. TSM needs to manage its own database backups so it can update the volume history file when backups run, so AUTODBBACKUP should be set to OFF and this is working as designed. As long as you are scheduling database backups through TSM, the ADM10502W messages can be ignored. Restoring the TSM Database The restore process will depend on what you need to achieve and where you are starting from. Three major scenarios exist The database is broken and requires a simple restore up to the last committed transaction The database is corrupt and needs a point in time restore to a known good state The hosting server has crashed and a full DR restore is required Taking these three in turn. Restoring a server database to its most current state Assuming the active and archive logs are intact, all backups exist and all the files and directories for the database still exist, the restore process is simply halt the server then from the OS command line, issue the command dsmserv restore db Restoring a server database to a point in time This is a little more complex. You need the latest full backup and the latest incremental backup from before the point in time. You also need the Server options file and the Volume history file, but note that the volume history file is wiped by the restore process, so take a copy of it before you start. If necessary, re-create your database and recovery log directories. To restore the database to a backup that was created before 16:00 on August 23, 2014, enter: dsmserv restore db todate08232014 totime16:00 The server will then find the last full backup from the volume history file and restore it, then work its way through any incremental backups create before the date and time specified above. However, the problem is that as you have wound the database back to a previous time, it is now out of step with the data in the storage pools, as migration and expiration might have run after the backup. Your old volume history file has a record of all volume usage, so take a look at it and pull out a list of all volumes that were changed after the point in time restore. What you are looking for is volume statuses of STGREUSE (updates) STGNEW (added volumes) and STGDELETE (removed volumes) - you can do this while you are waiting for the restore to run. Run an AUDIT VOLUME command with the FIXYES parameter against all your disk volumes, and all tape volumes marged as reused or deleted. If storage pool volumes were added after the backup you will need to add them again. If the audit cannot find a backup file, it will be permanently lost and so copied again on the next backup. If the file exists in a copy storage pool, it will be marked as damaged, so you will need to run the RESTORE STGPOOL command to get those files restored from the copy. If you dont have any backups, the ultimate cleanup is to run DELETE VOLUME with the DISCARDYES parameter, but this will delete your backup data. You will also need to run an AUDIT LIBRARY command to fix any tape volume anomalies. Disaster Recovery issues A disaster recovery restore adds another layer of complexity. First you need to rebuild your server, hopefully from a SYSBAK or MKSYSB that puts all the relevant code back exactly as it was. If you do need to re-install TSM then note that the IBM manuals specifically state that The restore operation must be done by a Tivoli Storage Manager server at a code level that is the same as that on the server that was backed up - This means that the server code level can not change at all - not even by a patch level. You will probably then need to define your tape library, at least one drive, and paths using DEFINE LIBRARY, DEFINE DRIVE and DEFINE PATH commands. At this point you should have a TSM system ready for restore, so you can follow whichever of the 2 options above is appropriate. Best practice for Database and Storage Pool disks The following are some of the Best Practices recommendations from IBM for setting up DB disk volumes for TSM Servers Use fast, low latency disks for the Database, use SSD if you can afford it. Avoid the slower internal disks included by default in most AIX servers, and avoid consumer grade PATASATA disks. Use faster disks for the Active Logs too. Do not mix active logs with disks containing the DB, archive logs, or system files such as page or swap space. Slower disks for archive logs and failover archive logs can be used, if needed. Use multiple database containers. For an average size DB, it is recommended to use at least 4 containers initially for the DB. Larger TSM servers, or TSM servers planning on using data deduplication, should have up to 8 containers or more. You should plan for growth with additional containers up front as adding containers later can result in an imbalance of IO and create hot spots. Place each database container in a different filesystem. This improves performance DB2 will stripe the database data across the various containers. Tivoli Storage Manager supports up to 128 containers for the DB. Ideally place each container on a different LUN, though this is not so important for high end disks like XIV or VMAX. There should be a ratio of one database directory, array, or LUN for each inventory expiration process. The block size for the DB varies depending on the tablespace, most are 16K, but a few are 32K. Segmentstrip sizes on disk subsystems should be 64K or 128K. If you use RAID, then define all your LUNs with the same size and type. Dont mix 41 RAID5 and 42 RAID6 together. RAID10 will outperform RAID for heavy write workloads, but costs twice as much. RAID1 is good for active logs. Smaller capacity disks are better than larger ones if they have the same rotational speed. Have containers on disks that have the same capacity and IO characteristics. dont mix 10K and 15K drives for the DB containers. Cache subsystem readahead is good to use for the active logs it helps in archiving them faster. Disk subsystems detect readahead on a LUN by LUN basis. If you have multiple reads going against a LUN, then this detection fails. So several smaller LUNs are better than a few large ones, but too many LUNS can be harder to manage. However it is very difficult to given generic rules about disk configuration as this very much depends on what type of disks you are using. High end disk subsystems such as the EMC DMX, the HDS VSP and the IBM DS8000 have very large front end cache to speed up performance, and stripe data in a way that makes it difficult to separate data by physical spindle. The IBM XIV takes this virtualisation to a higher level again. To get the best performance from these devices you want enough LUNs to spread the IO and get readahead cahce benefit, but not so many that they become difficlult to manage. For the XIV, consider using a queue depth of 64 per HBA to get best advantage of the parallelism capabilities. Dont stripe your data using logical volumes, let the hardware do the striping. As a rule of thumb, consider using 50GB volumes for DISK pools and 25GB volumes for file pools. Define the same number of volumes per LUN as the RAID type to make up the LUN, so for example with 41 RAID5, define 450GB volumes per LUN, then each LUN will use 250GB, with effective capacity of 200GB. The Unix Tips section contains some detail on how to use VMSTAT and IOSTAT commands to investigate potential disk bottlenecks. Using DB2 commands on a TSM server IBMs design model for TSM v6 and upwards is to store TSM metadata in a DB2 database, without the TSM administrators needing to know anything about DB2 and how to manage it. It is now becoming obvious that a TSM Administrator does need to know a bit of DB2, but it would always be wise to contact IBM for advice before running base DB2 cvommands. If you have a test sandpit system that you can try things out on, then here are a few DB2 commands that might be useful. On Windows, you start a DB2 command line from Start - gt All Programs - gt IBMDB2 - gt Command Line Tools. AUTHORISING A USERID TO BE ABLE TO START THE TSM SERVER The TSM DB2 system is owned by the userid that installed it, and normally only that userid has the administration authority needed to manage the DB2 database, including the ability to start the TSM service. However you can give access to another userid using DB2 commands. Open up a command line as the TSM instance owner by right clicking on it and taking the run as option. You will need the instance owner userid and password to do this. Once you have the command line, type the following commands db2 connect to tsmdb1 db2 grant dbadm on database to user TSMADMIN Userid TSMADMIN can now be used to stop and start the TSM services Recovering from a full archive log Under tsm 6.x, the archive and active log directories can fill up, and if they do, the server will shut down. To prevent this, you need to make sure you trigger a FULL database backup once the archive log hits a threshold, but if the worst happens and the log files do fill up, you need a recovery process. If this happens then you cannot use TSM commands to move the logs into bigger directories, as you cannot start TSM. What you need to do is create temporary logs elsewhere, then prune the archive log using native DB2 commands. However, remember that the archive log will hold enough information to wind back through the last 2 full backups, so you need to run 2 full backups to clear it down. Create a temporary directory large enough to hold your active logs. The dsmserv. opt file may contain the log sizes in the ACTIVELOGSIZE parameter, and if not, it will point to the physical log location. Open a DB2 command line and run the commands below to switch the logs to a new location Set db2instanceSERVER1 db2start db2 update db cfg for tsmdb1 using newlogpath pathtonewlogs db2stop db2start Activate the database to copy the log files with the following command, this command does not affect the original logs. This may take a while, and success will be indicated when you see a command prompt again. db2 activate db tsmdb1 Now you need to back the database up to clear the logs out, and you need to do this on disk, so identify or create a directory with enough space to take a database backup then run the following DB2 commands. db2stop db2start db2 backup db tsmdb1 to pathtodatabasebackupdirectory The archive logs will start pruning once you see the Backup Successful message, but this could take a while to appear if your database is large. Make a note of the backup timestamp, which will look something like The timestamp for this backup image is: 20120412130821 Find some more space, and run another full DB2 database backup with the command. db2 backup db tsmdb1 to pathtoanotherdatabasebackupdirectory When this second backup completes, the archive log directory and original active log directory are empty of log files. Make a note of the backup timestamp again, let us call this one 20120412150425 Now you need to delete the first backup using these commands - note how you use the timestamp from step 4.db2stop db2start db2 connect to tsmdb1 db2 PRUNE HISTORY 20120412130821 WITH FORCE OPTION AND DELETE Point DB2 back to the original, empty active log in the original location, you will get this from the ACTIVELOGDIRECTORY parameter in dsmserv. optdb2 UPDATE DATABASE CONFIG FOR TSMDB1 USING NEWLOGPATH pathtoactivelogdir Connect to the database again, and that will automatically start moving the active logs from the temporary location to original active log location, and again, this can take a while if the logs are big. db2 force application all db2stop db2start db2 connect to tsmdb1 Now you need to start the TSM server up and run a good backup. You need to start the server in the foreground to do this, so open a normal Windows command line and navigate to the server directory and run dsmserv. If you have more than one TSM server on this machine, you may need to use the - k option to get the right server. This will bring you up a TSM server command line. Disable your client sessions then take 2 full database backups. You need to know your backup device classes to be able to do this. Disable sessions Backup db typefull dev yourdbdevclass Delete the second DB2 database backup as follows, using the database timestamp that you recorded in step 5.db2 PRUNE HISTORY 20120412150425 WITH FORCE OPTION AND DELETE Now you can halt your server in the foreground, and start it normally. Remember to enable sessions. It is possible to query what is happening while a database recovery is in progress with the db2pd utility, a DB2 diagnostic tool that is provided with the TSM server installation code. You simply run this as a command from the shell prompt, like this: db2pd db2pdgt You are running db2pd in interactive mode. db2pdgt If you want command line mode, rerun db2pd with valid options. db2pdgt Type - h or - help for help. db2pdgt Type q to quit. To check out what is happening with a database recovery, run db2pdgt - recovery - db tsmdb1 STARTING AND STOPPING AUTO RUNSTATS Runstats is used to optimise access paths through the TSM tables and should normally be set to run automatically as required. However if runstats starts automatically when the TSM is started up after a database upgrade, it can cause performance problems to the extent that no-one can log into the system. To temporarily suspend auto runstats, before halting the TSM server for an upgrade, submit the following commands to the DB2 instance that is associated with the TSM server: db2 connect to tsmdb1 db2 update db cfg for TSMDB1 using AUTORUNSTATS OFF Now runstats will not start automatically when you restart TSM server. However you need runstats to keep your database optimised, so once you are happy that your TSM server is up and running, submit the following commands to the DB2 instance for your TSM server and Runstats will resume normal processing. db2 connect to tsmdb1 db2 update db cfg for TSMDB1 using AUTORUNSTATS ON If you have a corrupt TSM database, it is possible that it is just the database index that is corrupt and if so, it can be rebuilt without having to restore the whole database. You really should be involving IBM and following their advice before trying a rebuild, but it might be worth knowing how to tell if corruption in DB2 is with the Table or the Index. The DB2 Database Analyzing and Reporting tool, db2dart, can help here. If you run the tool and check the output, it will tell you which pool is in error. Look for messages like Error: Extent number 136 in tablespace 3 is orphaned. Then you need to grep the db2diag. log for Obj: The important part is the type type:0 is table, type:1 is index and if it is type:1 then the index can be rebuilt to fix the corruption issue, but as I said above, consult IBM first. SOME OTHER POTENTIALLY USEFUL COMMANDS You can enter any DB2 command from the DB2 command line, including SQL queries and commands that update or delete the database, so be careful. Some of the query commands could be useful for investigating TSM problems get instance - returns the name of the TSM server list active databases - will show the TSM database name as known to DB2, and the path to it. get dbm config - shows the settings for the database configuration manager db2start and db2stop - obvious what these are They should never be necessary as DB2 should be started automatically as part of the server startup, but if necessary, it can be done manually The following commands require you to be logged in with adminstrator authority and connected to a database get db cfg show detail - shows the confguration parameters for the database list tables - for the connected database describe table tablename - lists the columns for the specified table Automatic Database reorganisation issues Reclaimable Storage TSM should automatically tune and manage its database. However this might not always work. One problem that you might see is that your database grows a lot faster than you might have expected, even though you are running expiration and the number of objects in the database is not growing by much. Apart from consuming space, this growth can also cause performance problems. DB2 should have a feature called reclaimable storage which according to IBM can consolidate in-use extents below the high water mark and return unused extents in your table space to the system for reuse. A problem can arise if you originally installed TSM 6.1 as that used DB2 9.5 tablespaces and they do not have the reclaimable storage feature. If you then upgraded your TSM to higher levels, you will still be using DB2 9.5. You could get in touch with IBM and obtain the scripts that will allow you to upgrade DB2 to release 9.7. The issue is that the scripts must be run while the server is halted and generally require ten to thirty hours to run, and sometimes much longer. If you are not sure whether the database was created by installing Tivoli Storage Manager V6.1 or by installing a later version, issue the following SELECT command: db2 quotselect cast(TBSPNAME as char(30)), reclaimablespaceenabled from table(mongettablespace(,-1)) where TBSPNAME in (USERSPACE1,IDXSPACE1, LARGESPACE1,LARGEIDXSPACE1)quot gt reclaimablespace. txt In the output, the RECLAIMABLESPACEENABLED column displays a value of 0 for V6.1 databases, even if the server was later upgraded to V6.2 or later. If you installed TSM 6.2 then things are a bit better, as that used DB2 9.7, and that release did include reclaimable storage. However even then you might still not be able to reuse freed up space, as if your workload is high, the database reorg utility can conflict with your regular housekeeping. Large deduplicated storage pools can be an especial problem. How does TSM reclaimable storage work If you are running version 7.1.1.200 or later, then online index reorganization is enabled by default, and a reorganization and cleanup process is run automatically on all tables. If you have the DISABLEINDEXREORG and DISABLEREORGCLEANUPINDEX options in your dsmserv. opt file, then these options will be silently ignored. If your server level is earlier than 7.1.1.200, then you may see ANR3497W messages in the activity log If a table requires reorganization, ANR3497W, quotReorganization is required on table table name. The reason code is 1.quot If the indexes for a table require reorganization, ANR3497W, quotReorganization is required on table table name. The reason code is 2.quot If an index reorganization with the CLEANUP PAGES ALL option is required on the BFBITFILEEXTENTS table, ANR3497W, quotReorganization is required on table BFBITFILEEXTENTS. The reason code is 3.quot TSM checks via DB2 to see which tables and indexes need to be reorganised, then it works through the list and processes the tables one at a time. It can take a long time to reorganise a large table, possibly a month or more. The process will be paused at the end of the daily reorg window, then restarted when the next daily window starts. When each table reorg is complete, TSM will run a RUNSTATS agains the table to optimise its performance. Once all the tables and indexes are reorganised, TSM will then wait at least 20 days before it starts the process again. Database reorganisation cannot run alongside database backup. If a backup is running, the reorg process will not start. If the reorg process is running, then every so often it will pause and allow a backup to run, if one is required or scheduled. If table reorganization is in progress at the end of the reorganization window, it is paused until the reorganization window starts the next day, when reorganization is resumed. If index reorganization is in progress at the end of the reorganization window, reorganization continues. It is not possible to pause index reorganizations. How do I know if TSM reclaimable storage is running The easiest way is to check the server log for messages ANR0293I and ANR0294I are issued when a table reorg starts and completes ANR0317I and ANR0318I are issued when a table index reorg starts and completes ANR0336I and ANR0337I are issued when a RUNSTATS starts and completes, when RUNSTATS is triggered at the end of a table or index reorg. A more direct way is to run the DB2 reorgchk command. Open a DB2 command window and type db2 reorgchk current statistics on table all db2reorgchk. out What control do I have over what reclaimable storage does You can run reorganisations online or offline. Online means run alongside other work, which might cause performance and contention issues. Offline means bring the server down to run the reorgs, but then the reorgs run 100 times faster. Neither of these options sounds attractive. In general, the more current your level of TSM, the better control you have over online reorgs. Some of the options below might not be valid for older releases of TSM. The default position is that online reorganisation can run 24 hours a day, but you can use options REORGBEGINTIME hh:mm and REORGDURATION nn to control when reorganisation starts, and how long it runs for. The nn parameter is hours. You should aim to schedule reorg activity at a time when server utilisation is low. Things to avoid are intense backup and archive processing, and expiration, migration, or reclamation. ALLOWREORGTABLE and ALLOWREORGINDEX can be set to NO or YES. The default values are YES for Table reorg and NO for Index reorg. Index reorg really needs to run at a quiet time, and if you enable it you must set the server option DBDB2KEEPTABLELOCK NO as it can cause database deadlocks (this is the default for TSM v6.3 onwards). Also, unlike Table reorg, Index reorg cannot be paused but if necessary it can be cancelled from a DB2 command line. I suggest you discuss options with IBM before enabling ALLOWREORGINDEX and DBDB2KEEPTABLELOCK NO as there are several factors to consider. If you see locking problems, for example error messages like ANR1880W: Server transaction was canceled because of a conflicting lock on table REPLICATINGOBJECTS, you can disable reorgs for selected tables or indexes. To do this you need to add parameters to the database options file, then halt and restart the server. The options are DISABLEREORGTABLE, DISABLEREORGIndex and DISABLEREORGCleanupindex. DISABLEREORGTABLE and DISABLEREORGIndex take a comma separated list of tables, while DISABLEREORGCleanupindex will only accept BFBITFILEEXTENTS. The following parameter are examples, you need to find out which tables are appropriate for your site. DISABLEREORGIndex and DISABLEREORGCleanupindex are deprecated from TSM 7.1.1. DISABLEREORGTABLE BFBITFILEEXTENTS, REPLICATINGOBJECTS, BACKUPOBJECTS DISABLEREORGIndex BACKUPOBJECTS, ARCHIVEOBJECTS DISABLEREORGCLEANUPINDEX BFBITFILEEXTENTS IBM advises that online reorganization might not work on the following tables: BFAGGREGATEDBITFILES BFBITFILEEXTENTS BACKUPOBJECTS ARCHIVEOBJECTS Investigating Problems with the Server Instance The first place to start is the TSM Active log, but if you need to go deeper, then the DB2 logs can be useful. However finding those logs can be a challenge as the location can depend on the the OS platform or even the OS release level. The best way to be sure you have the correct log is to check the DIAGPATH variable in DB2. Start up a DB2 command line, in Windows go to Start-gt Programs-gt IBM DB2-gt Command Line tools-gt Command Window and in UNIX, su - db2inst1 (db2inst1 is the default instance, if you change the instance name or have multiple instances, you need to su to the correct userid for your instance). You then type db2 to open the DB2 command line From the db2 command line type db2gt get dbm cfg. The command produces a lot of output, look for the line like Diagnostic data directory path (DIAGPATH) homeE1WT1e1wt1sqllibdb2dump and this shows the path to the log files. If the DIAGPATH is blank, look for the default PATH directory instead. quit gets you out of that DB2 command line The DB2diag. log contains information like database backups, table reorganizations, memory management messages, start and stop of TSM server and hardware information logged at instance start time, as well as error and warning messages. Sometimes when investigation TSM server problems, the DB2 terminology does not quite match TSM so the error messages in the DB2 logs can look a bit strange. For example, Tivoli Storage Manager refers to transactions which DB2 calls to units of work (UOW). Tivoli Storage Manager uses select statements where DB2 uses SQL and are also sometimes referred to as DML, or data manipulation language statements. Another potentially useful file is the startup trace log dsmupgdx. trc, which is located in c:program filestivolitsm for Windows or opttivolitsmserver for UNIX and Linux servers. If you get database startup problems its alwayus worth checking the file to see if any useful error messages exist. Some TSM errors messages are very generic and more investigation is needed to pinpoint the problem. An example is ANR8503E A failure occurred in writing to volume. To investigate this you need to enable a TSM server trace. To do this, enter the following commands from the TSM server command line trace disable trace enable pvr addmsg trace begin pathnametrace. out redo the activity that created the error message trace flush trace end trace disable The open the trace file and look at the messages that were written out just before the error. You might sometimes see an error message, ANR2981E Database backup terminated due to environment or setup issue related to file access - DB2 sqlcode -2033 sqlerrmc 106. The messages in the DB2 log file are a bit confusing, and will be something like MESSAGE. SQL2033N An error occurred while accessing TSM during the processing of a database utility. TSM reason code: . FUNCTION: DB2 UDB, database utilities, sqlubDeleteVendorImage, probe:558 MESSAGE. SQL2062N An error occurred while accessing media quotquot. Reason code:quotquot. DATA 1. String, 27 bytes Error returned by sqluvdel. DATA 2. Vendor RC, PDDB2TYPEVENDORRC, 4 bytes Vendor RC0x0000001A26 -- see DB2 API Guide for meaning. DATA 3. Hexdump, 48 bytes 0x0A00060137109070. 0000 006A 3133 3639 2031 3036 0000 0000. j1369 106. 0x0A00060137109080. 0000 0000 0000 0000 0000 0000 0000 0000. 0x0A00060137109090. 0000 0000 0000 0000 0000 0000 0000 0000. A possible cause is that the DSMI variables are not defined correctly in the DB2 user profile. This is found in sqllibuserprofile in UNIXLinux systems. The script variables should be set as export DSMICONFIGhometsminst1tsminst1tsmdbmgr. opt export DSMIDIRusrtivolitsmclientapibin64 export DSMILOGhometsminst1tsminst1 Sometimes after a problem, DB2 goes into crash recovery mode and the TSM server appears to be hung. DB2 crash recovery can take a long time. If your TSM server is hung, check your DB2 db2diag. log for a message like MESSAGE. DIA2051W Forward phase of crash recovery has completed. Next LSN is 0000259AD0276FD8. Then log into DB2 as the instance owner and run the command db2 list utilities show detail. If Crash Recovery is active, the message will tell you how much work it needs to do, so you can estimate how much longer it will take. Some of the sample output of this command is shown below. Type CRASH RECOVERY Database Name TSMDB1 . Estimated Percentage Complete 100 Phase Number 1 . Phase Number Current 2 Total Work 25937697602 bytes Completed Work 25769328527 bytes Start Time 10172013 11:36:29.368810 Errors on Database Startup Your first point of call should be to raise an incident with TSM support and get advice on your problem. However the following might help. When trying to start up TSM the following error message can appear ANR0170E - Error detected, database restart required, and you may see errors in the actlog a bit like ANR0171I dbieval. c(874): Error detected on 3:2, database in evaluation mode. ANR0170E dbieval. c(935): Error detected on 3:2, database restart required. ANR0162W Supplemental database diagnostic information: -1:58031:-1034 (IBMCLI Driver SQL1034C The database is damaged. The application has been disconnected from the database. All applications processing the database have been stopped. The resolution is to restart DB2 manually with the RESTART command. Open up a DB2 command line window as explained above then issue the following set db2instancedb2inst1 (this is the default instance) db2 force application all db2stop db2 restart database db2inst1 You might have to run the restart command a few times before the issue is resolved. If this does not fix the problem you probably need to contact IBM Support, although you can use the db2dart command to run a database analysis. This generates a report file that would be useful for IBM support. db2 force application all db2stop db2dart db2inst1 db Another possible message is ANR0151W Database manager fails to start. This problem can occur after a database crash, maybe due to a hardware issue. If the database will not start up with the dsmserv command and you see errors like ANR0151W Database manager fails to start. Improper shutdown of instance produced orphaned IPC resources And you see entries like this in the db2diag. log I779399E357 LEVEL: Severe PID. 18375 TID. 140737134171936PROC. db2star2 INSTANCE: tsmserv NODE. 000 FUNCTION: DB2 UDB, base sys utilities, DB2StartMain, probe:580 MESSAGE. ECF0x900003DE-1879047202ECFTRCAPIMUTEXLOCKERROR Trace facility mutex unexpected lock error The problem is that some Inter Process Communication (IPC) tasks are still active and are locking out resources. You need to cancel the DB2 instance then remove the IPC resoures. Log on with the Tivoli Storage Manager server instance user ID and run the following command to stop the DB2 instance db2stop or if necessary, db2kill Check to see if there are outstanding IPC resources that are associated with the instance Clean up any IPC resources that are associated with the instance - bash-3.1 ipclean ipclean: Removing DB2 engine and clients IPC resources for tsmserv. Verify whether there are outstanding IPC resources that were not removed by the ipclean command. If there are outstanding IPC resources associated to the instance, use the following commands to remove them To remove a shared memory segment resource ipcrm - m shmid To remove a semaphore resource ipcrm - s semid To remove a message queue resource ipcrm - q msgid Once all outstanding IPC resources have been removed, you should be able to restart the Tivoli Storage Manager server. On Windows, a TSM server might fail to start after an upgrade with the error ANR0188E Fail to start the database manager. Database manager license not found The DB2 License has probably expired. To check this, log onto windows with your TSM Server instance userid, open a command prompt and type DB2CLP. This will open another DB2CLP command window, and from this window enter the command db2licm - l. If the licence has expired you will see Product name: DB2 Enterprise Server Edition Expiry date: Expired Product identifier: db2ese Version information: x. x The DB2 license file is called db2ese. lic and was shipped with your TSM server package. Its location will depend on where you extracted the server package, but assuming you extracted to a directory d:tsmextract, you will find it in the following directory, where DB2x. x corresponds to your DB2 version number. d:tsmextractCOIPackageStepsDB2x. xFILESesedb2licensedb2ese. lic Navigate your command line to that directory, then you can register the DB2 license again with the following command db2licm - a db2ese. lic LIC1402I License added successfully. Run the db2licm - l command again and now you should see Product name: DB2 Enterprise Server Edition License type: Restricted Expiry date: Permanent Product identifier: db2ese Version information: x. x and you should be able to start your TSM Server instance normally. AIX Maximum Number of Processes You may see a database backup failing on an AIX server with an error like ANR2968E Database backup terminated. DB2 sqlcode: -2033. DB2 sqlerrmc: 292 If this error is not corrected the recovery log will fill up and crash the server. You may also see a message like Insufficient AIX system resource in the db2diag log file. The API error code 192 means that the API was unable to fork or create a process to do its database backup. AIX has a parameter called maxuproc which limits the maximum number of processes that a user is allowed per user, and this value should be increased. To see what value is set, use the command lsattr - l sys0 - E grep maxuproc and to change the value use the command below, selecting a value that is suitable for your server. chdev - l sys0 - a maxuproc2048 Effect of Deduplication on Database size Deduplication will save a lot of backend storage, but it does this at the expense of increasing the size of the TSM database because the TSM database has to store and track the metadata that is required to manage the deduplication. The exact amount of extra space required is difficult to calculate up front, as it depends on your average deduplication chunk size and this will vary depending on how well your data deduplicates. IBM suggests an typical chunk size of 100,000 bytes, and provides some scripts that you can run to measure your exact average chunk size once you have deduplication working. Each chunk needs 490 bytes of metadata to describe the data in the primary pool, and another 190 bytes for the data in each copy pool. A starting point is to estimate your database size without deduplication, and to do this you use the formula dbsize filecount numberofbackupcopies 200 To give you an idea of how many backup files exist, you can find the number of backup files that you are holding with the following SQL query on an existing server select sum(cast(numfiles as bigint)) from occupancy where nodename is not null and filespaceid is not null To calculate the deduplication overhead, use the formula below to get the number of chunks chunkcount totalbackedupdatainGB 10,000 2 The doubling factor at the end of the formula is to cater for base deduplication chunks that is, chunks that must remain even after a file is expired and deleted from TSM. The extra database overhead is then chunkcount (490 190 extrabackupcopies) Running this formula on an existing server with a 135GB database predicted an increase of 105GB with deduplication, which is not a trivial amount. Moving a TSM database hosted on Windows If you run your TSM server under Windows, then by default, your TSM database will be installed on the C: This can be an issue as the C: is usually reserved for system data, and system administrators prefer that your application data be stored on a different drive. It is possible to move the database using the DB2 utility db2relocatedb. However db2relocatedb will not actually move your database, you have to do that yourself. What it does is update the pointers within DB2 so it knows where the database has been moved to. First, just confirm that the database is allocated on the C. Run the db2cmd command from a Windows command line to open a DB2 command line, then run db2 list database directory and within the command listing you should see a line Local database directory C: Now, just incase something goes wrong, run a full TSM database backup Stop the TSM Server with the HALT command. This should stop DB2 as well, but check and make sure it is down. Copy your data to the new drive with the Windows copy command. Assuming you are going to the G. this would be copy c:server1 g:server1 Yes, you could move it, but if you use copy, the original data is still on the c: incase anything unforseen happens - nothing wrong with having 2 backout plans Take a look at the copy, and make sure the data and directory structure is as you expected The db2relocatedb utility needs a configuration file to tell it what you are moving. The configuration file would normally be created in the same directory as db2relocateddb runs from and is usually called reloc. cfg. However you can create the file anywhere, in which case you need to specify the absolute path in the command example below. Assuming you are using the default TSM database name and database instance then in our case, the config file will contain DBNAMETSMDB1 DBPATHC:,G: INSTANCESERVER1 Create this file then run the db2relocatedb command pointing it to the configuration file location. db2relocatedb - f reloc. cfg Now start your TSM server up again and check that all is well. Rerun that db2 list database directory command and check that the server is actually running from the g: Once you are certain all is well you can deleted the data off the c:

Comments

Popular posts from this blog

Forex Bank Konto Australien

4xp Forex Forum

Forex 95