PoT.im.06.1.027.14 Presentation

Embed Size (px)

Citation preview

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    1/196

    IBM Software

    Information Management

    An IBM Proof of Technology

    IBM DB2 10.1 Administrationfor the Experienced Oracle DBA

    Presentations

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    2/196

    An IBM Proof of Technology

    PoT.IM.06.1.027.14

    Copyright IBM Corporation, 2004, 2012

    US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

    Version 7.0 December 7, 2012

    Burt Vialpando & Vikram Khatri

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    3/196

    DB2 10.1 Administration for the Experienced Oracle DBA Proof of Technology Announcement

    DB2 10.1 Administration

    for the Experienced Oracle DBA

    A Proof of TechnologyIBM

    DB2

    10.1 comes with many powerful features that help ease the day-to-day activities all DBAs

    must perform in every IT shop. In this Proof of Technology, specific comparisons with Oracle are madethroughout to help customers better understand the feature and function differences between DB2 andthe competitive Oracle product. This session consists of both presentation and hands-on lab exercises.

    Objective

    This session enables customers to gain an understanding of IBM DB2 10.1 administration, evaluate theDB2 10.1 administration vs. Oracle administration, and expedite their purchasing decision process. Inbrief, DBAs already working with Oracle, or those considering adding Oracle to their repertoire, will beable to see just how easy and yet powerful DB2 administration can be.

    Audience

    This Proof of Technology is for Data Management Architects, Database Administrators and DatabaseDevelopers and other decision influencers evaluating IBM technologies either from an Oracle shop orfrom those considering Oracle as an alternative.

    Core Topics

    Introduction & Overview DB2 vs. Oracle product offering comparison.

    Instance Exploration & the CLP Instance management, Command Line Processor usage & registry variables.

    Database Exploration Create & manage databases, key database features

    Data Studio The IBM DBA and developer Eclipse based GUI tool

    CLPPlus & Oracle compatibility The new DBA command line tool and creating PL/SQL objects and more.

    Security ConceptsAuthorities, privileges, groups, roles, encryption, label security and more.

    Autonomic Computing Auto memory management, parameter configuration, storage managementand utility throttling, intelligent backup, REORG & RUNSTATS.

    Elective Topics

    Deep Compression DB2s industry leading, deep compression capability.

    Explain Facilities & the optimizer Learn the basics of the DB2 optimizer and make your queries run better.

    DB2 Workload Manager (WLM) Meet service level agreements by intelligently sharing all your databaseresources between disparate resources

    Monitoring (DB2 core capabilities) Core engine snapshots, SQL functions, db2pd and event monitors

    pureXML What the DBA needs to know about pureXML, an industry unique approach.

    Multidimensional Clusters (MDCs) Maximize query performance with row co-location unique to the industry.

    Data Movement Utilities Core engine load, import, export, db2move, db2look, db2relocatedb & more.

    Backup, Restore & Recovery Core engine functionality for keeping your data safe.

    Additional Misc. Topics Temporal data management, multi-temperature storage, federation, DB2Cloud offerings

    Length

    2 full days, 9:00 AM to 5:30 PM

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    4/196

    DB2 10.1 Administration for the Experienced Oracle DBAAn IBM Proof of Technology

    DETAILED AGENDA

    I. CORE TOPICS

    Introduct ion and Overview 10 minutes

    Presentation - 10 slides 10 minutes

    This covers IBM DB2 and Oracle product offerings. Highlighted is the fact that DB2 offers a complete androbust set of products for any and every IT shop.

    01 - Instance Exploration and Using the CLP 1 hour 30 minutes

    Presentation 20 slides 35 minutes

    This covers environment and registry variables as well as parameters. This is followed with a lesson onusing the DB2 Command Line Processor to facilitate the labs. Highlighted is ease of instance creationand ease of CLP use.

    Lab 01 Exercises 55 minutes

    Operating system directories and files Start and stop a DB2 instance CLP introduction Create a new DB2 instance Catalog a DB2 instance Extra exercises: db2support, instance administrative views, db2diag, db2pd, db2cfexp,inspect & the

    Generic Control Facility

    02 Database Creation and Exploration 1 hour 15 minutes

    Presentation 21 slides 45 minutes

    This covers the Oracle vs. DB2 system catalog, table space and storage handling differences. It alsodiscusses some basic administration differences between the two databases. Highlighted is ease ofdatabase creation and basic maintenance.

    Lab 02 Exercises 35 minutes

    General database commands DB2 system and local database directories Creating a database Exploring various functionality features: database administration views, memory tracking, event

    monitoring, database size/capacity Extra exercises: Altering a table

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    5/196

    DB2 10.1 Administration for Experienced DBAs Page 2 of 7 PoT Detailed Agenda

    03 Data Studio 1 hour 10 minutes

    Presentation 27 slides 35 minutes

    IBM Data Studio is the latest in a complete tool for both DBA and developers. Its graphical user interfaceis easy to use and powerful. Many of its features will be shown in this presentation and lab topic.

    Lab 03 Exercises 45 minutes

    Launching Data Studio Connecting to and managing a database (instance and database management and running SQL) Exploring tables, overview diagrams, editing and sampling data, generating DDL and table

    maintenance Extra Exercise: Debug a stored procedure Extra Exercise: Performance profile a stored procedure

    04 CLPPlus and Oracle Compatibility 1 hour 5 minutes

    Presentation 17 slides 30 minutes

    First, the presentation gives an overview of how the new command line interface called the CLPPlusworks. Then a demonstration of Oracle compatibility features is done.

    Lab 04 Exercises 40 minutes

    Logging on to CLPPlus Interactive CLPPlus commands Running a script file in CLPPlus batch mode Oracle compatibility examples (SQL and PL/SQL examples, migrating an Oracle schema, auto_reval,

    currently committed, anonymous block PL/SQL)

    05 - Security Concepts 1 hour 10 minutes

    Presentation 19 slides 30 minutes

    This covers the basic Oracle vs. DB2 security approach differences as well as common terminology. Italso covers DB2 privileges and authorities. Highlighted is ease of use and reasons why DB2s securityapproach is a highly affective one.

    Lab 05 Exercises 40 minutes

    Instance level security Database level security Object level security Using the system catalog security views User and group overview

    Schemas Viewing database authorities Column and row level security Schemas Extra exercise: db2audit and AUDIT POLICY (instance and database level auditing examples) Extra exercise: LBAC quick look

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    6/196

    DB2 10.1 Administration for Experienced DBAs Page 3 of 7 PoT Detailed Agenda

    06 Autonomic Computing 1 hour 20 minutes

    Presentation 28 slides 45 minutes

    This covers what autonomic computing is and how the following autonomic features work in DB2: SelfTuning Memory Manager (STMM) Automatic Storage, Utility Throttling and the Configuration Advisor.

    Finally, automatic maintenance for RUNSTATS, REORGS and backups is shown. Highlighted are all thereasons Oracle DBAs will be delighted with the ease of use and power of these features as compared toOracle.

    Lab 06 Exercises 25 minutes

    Self-Tuning Memory Manager (STMM) Automatic Storage Autoconfigure Extra exercise: Automatic Maintenance Extra exercise: Statistic Profiling Extra exercise: SYSTOOLS setup

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    7/196

    DB2 10.1 Administration for Experienced DBAs Page 4 of 7 PoT Detailed Agenda

    II. ELECTIVE TOPICS

    07 Deep Compression 60 minutes

    Compression - 16 slides - 20 minutes

    Lab 07 Exercises - 25 minutes

    Compression - 20 minutes

    Estimating compression Full REORG compression REORG with sample data compression Automatic dictionary compression Index Compression

    08 - Explain Facilities and the Optimizer 1 hour 10 minutes

    Presentation 15 slides 25 minutes

    This presentation quickly compares Oracle and DB2 explain facilities, but then dives into discussing thevarious DB2 explain utilities and what each is best suited for. An overview of the DB2 optimizer is alsogiven.

    Lab 08 Exercises 45 minutes

    Create explain tables Set up explain example using a UNION ALL view (sub lesson) Visual Explain in Data Studio Visual Explain tuning a query (design change example, SQL change example) Using db2exfmt explain multiple queries at once Extra exercise: Using db2expln (static mode and dynamic mode examples) Extra exercises: REBIND and ROW MOVEMENT

    09 DB2 Workload Manager (WLM) - 1 hour 40 minutes

    Presentation - 38 slides - 60 minutes

    The DB2 Workload Manager can manage and control all work executed in your DB2 database. Eachuser that requests work is mapped to a workload that in turn controls the amount of CPU, prefetch andbuffer pool used. In addition, thresholds can limit or remap activities dynamically. This allows differentusers to get different amounts of resource in the database, even if when executing identical workloads.

    Lab 09 Exercises - 40 minutes

    Setting up a custom workload manager environment Setting up and running a simulated workloads (three different users with different WLM capabilities) Using db2pd for monitoring and reporting Working with WLM event monitors Misc WLM lessons

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    8/196

    DB2 10.1 Administration for Experienced DBAs Page 5 of 7 PoT Detailed Agenda

    10 Monitoring 1 hour

    Presentation 15 slides 30 minutes

    This topic covers all the DB2 core engine monitoring capabilities: snapshots, SQL table functions, eventmonitors, usage lists, db2pd, db2top

    Lab 15 Exercises 30 minutes

    Snapshot monitoring switch use and a snapshot example Event monitoring using a statement event monitor to break down the execution of SQL in a stored

    procedure Data Studio stored procedure profiling Lightweight monitoring using SQL table functions and db2pd

    11 DB2 pureXML 1 hour

    Presentation 16 slides 30 minutes

    This covers what a DBA needs to know about XML in DB2: What XML is, why it is used in the industryand how to use it in a DB2 database. Highlighted is the fact that DB2 uses a unique hybrid hierarchicaland relational database engine that handles XML in a pure, native format.

    Lab 11 Exercises 30 minutes

    Creating an XML supporting database and an XML supporting table Inserting and exploring XML data Importing & Exporting XML data Creating indexes on XML data Extra exercises: Registering and validating with an XSR

    12 Multidimensional Clusters (MDCs) 1 hour

    Presentation 18 slides 30 minutes

    DB2 MDCs can define a table in such a way as to have it clustered on more than one dimension whichcan give performance benefits for many query scenarios as well as alleviating the need to reorganize thedata. Since there is nothing like this in Oracle, this flagship DB2 feature is described and an overview isgiven of how it works as well as when and why you would use it.

    Lab 12 Exercises 30 minutes

    Set up CARS and CARS_MDC table example Explore MDC table space, table and index usage through the catalog Explore MDC table organization, visually with Data Studio Use db2batch to test MDC performance

    Extra exercise: MDC performance timing tests using stored procedures

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    9/196

    DB2 10.1 Administration for Experienced DBAs Page 6 of 7 PoT Detailed Agenda

    13 - Data Movement Utili ties 1 hour 30 minutes

    Presentation 33 slides - 60 minutes

    A quick comparison of Oracle vs. DB2 data movement utilities is made. Then DB2 utilities are focused onby giving an overview of them and their usages. Then each of these is described: export, import, load,

    db2move, backup, restore, standby, transportable database, and replication. Emphasis is on showingrich selection and variety of data movement utilities and options in DB2

    Lab 13 Exercises 30 minutes

    db2relocatedb db2move and db2look SYSPROC.ADMIN_MOVE_TABLE Data ingest

    14 - Backup, Restore & Recovery 2 hours

    Presentation - 26 slides 45 minutes

    This covers architecture and training comparisons between Oracle and DB2. It then hones in on DB2functionality for the following: offline backup, history file, offline restore, configure database logging, onlinebackup, online restore, incremental backup & restore and recover dropped tables. Though powerful inscope, DB2 ease of use is highlighted.

    Lab 14 Exercises 75 minutes

    Create test database Offline backup & restore Configure database logging Online database backup Database restore (recovery mode) Recover dropped table Extra exercise: Restore history file Extra exercise: Move table space location (redirected restore) Extra exercise: Online table space backup & restore Extra exercise: Incremental and Delta backup & restore

    16 Additional Misc. Topics 1 hour 30 minutes

    All topics presentations Temporal data management - 12 slides - 20 minutes Multi-temperature storage - 4 slides - 10 minutes Federation - 4 slides - 10 minutes DB2 Cloud offerings - 4 slides - 10 minutes

    Temporal data management, time travel query Lab - 20 minutes

    Temporal data management, build, insert, update, delete Time travel query examples

    Federation Lab - 20 minutes

    Show federation through a pre-built script Show federation through a GUI

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    10/196

    DB2 10.1 Administration for Experienced DBAs Page 7 of 7 PoT Detailed Agenda

    PoT Revision History

    Version Revision Descript ion By Whom When

    4.1 PoT update for DB2 9.7 (Cobra) ReleaseBurt VialpandoVikram Khatri

    09/01/2009

    4.2 PoT update for DB2 9.7 Fix Pack 1 Burt Vialpando 04/05/2010

    5.0PoT update for DB2 9.7 Fix Pack 3, Data Studio2.2.0.2 and VM image on Windows 7 Enterprise

    Burt Vialpando 09/23/2010

    5.1 PoT update for DB2 9.7 Fix Pack 5, Data Studio 3.1 Burt Vialpando 10/21/2011

    6.0 PoT update for DB2 10.1, Data Studio 3.1.1 Burt Vialpando 04/15/2012

    6.1 Minor corrections to materials Burt Vialpando 08/25/2012

    7.0 Rewritten for SUSE Linux Burt Vialpando 12/07/2012

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    11/196

    2012 IBM Corporation

    An IBM Proof of Techno logy

    IBM DB2 10.1 Administration

    For the Experienced Oracle DBA

    Part 1 Core Topics

    Version 7.0 December 7, 2012

    Burt Vialpando & Vikram Khatri

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Welcome to the Technical Exploration Center

    Introductions

    Access restrictions

    Restrooms

    Emergency Exits

    Smoking Policy

    Breakfast / Lunch / Snacks location and times

    Special meal requirements?

    2

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    12/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Proof of Technology (PoT) OverviewPart 1 Agenda Core Topics

    IBM DB2 Introduction & Overview

    DB2 Instance Exploration & Using the CLP - Lab 01

    DB2 Database Creation and Exploration - Lab 02

    IBM Data Studio - Lab 03

    DB2 CLPPlus and Oracle Compatibility - Lab 04

    DB2 Security Concepts - Lab 05

    DB2 Autonomic Computing - Lab 06

    DB2 Deep Compression - Lab 07

    DB2 Explain Facilities & the Optimizer - Lab 08

    DB2 Workload Manager - Lab 09

    DB2 Monitoring (core engine) - Lab 10

    DB2 pureXML - Lab 11

    DB2 Multidimensional Clusters - Lab 12

    DB2 Data Movement Utilities (core engine) - Lab 13

    DB2 Backup, Restore & Recovery (core engine) - Lab 14

    Additional Misc. DB2 Topics - Lab 15

    Core Topics

    Elective Topics

    3

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Proof of TechnologySchedule

    Activi tySessionLengthHour:Mins

    RunningTotal

    Hour:Mins

    StartTime

    EndTime

    Day 1 PoT greetings, intro and logistics 0:10 0:10 9:00 AM 9:10 AM

    DB2 Introduction & overview 0:10 0:20 9:10 AM 9:20 AM

    Instance and the CLP presentation 0:35 0:55 9:20 AM 9:55 AM

    break 0:10 1:05 9:55 AM 10:05 AM

    Lab 01 0:55 2:00 10:05 AM 11:00 AM

    Database presentation 0:45 2:45 11:00 AM 11:45 AM

    lunch 0:45 3:30 11:45 AM 12:30 PM

    Lab 02 0:40 4:10 12:30 PM 1:10 PMData Studio presentation 0:35 4:45 1:10 PM 1:45 PM

    Lab 03 0:45 5:30 1:45 PM 2:30 PM

    break 0:10 5:40 2:30 PM 2:40 PM

    CLPPlus & Oracle Compatibility presentation 0:30 6:10 2:40 PM 3:10 PM

    Lab 04 0:40 6:50 3:10 PM 3:50 PM

    Security presentation 0:30 7:20 3:50 PM 4:20 PM

    Lab 05 0:40 8:00 4:20 PM 5:00 PM

    Day 2 Autonomic Computing presentation 0:45 0:45 9:00 AM 9:45 AM

    Lab 06 (or finish up any other core labs) 0:45 1:30 9:45 AM 10:30 AM

    Elective topics 5:25 6:55 10:30 AM 3:55 PM

    wrap up and surveys 0:05 7:00 3:55 PM 4:00 PM4

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    13/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    PoT OverviewScope, assumptions and icons

    The scope is for DB2 for Linux UNIX and Windows (LUW)

    The goal is to demonstrate specific IBM DB2 methodologies for implementing your currentDBA skill set in DB2

    The target audience is the experienced Oracle database administrator (DBA)

    Reasonably deep knowledge of relational database principles is assumed

    With a technical knowledge of Oracle specifics

    The target audience shou ld know the operating system (OS) reasonably well

    The labs will be done in a SUSE Linux environment

    Knowing how to get around in Unix will be important to the labs

    5

    Slide with a focus on DB2 only

    Slide with an extra cost feature or product

    DB2 10.1 latest feature

    Presentation icons

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    PoT OverviewUsing Vmware Stay in full screen mode

    If you ever get out of full screen mode click on this icon

    6

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    14/196

    2012 IBM Corporation

    An IBM Proof of Techno logy

    IBM DB2 Introduction & Overview

    10 slides

    Burt Vialpando

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    DB2 for Linux UNIX and Windows PackagingDB2 editions

    DB2 10.1 Editions

    DB2 Express-C (no cost download and deploy - optional license available)

    Windows, Linux, Solaris

    4 GB memory, 2 cores

    DB2 Express Edition

    Windows, Linux, Solaris, IBM AIX, HP-UX, Linux on system z

    8 GB memory, 4 cores

    DB2 Developer Edition

    Easy licensing to support all the features a DB2 developer would need

    DB2 Workgroup Server Edition

    Windows, Linux, Solaris, IBM AIX, HP-UX, Linux on system z

    64 GB memory, 4 sockets, 16 cores

    DB2 Enterprise Server Edition

    Windows, Linux, Solaris, IBM AIX, HP-UX, Linux on system z

    No limit on memory and CPU

    DB2 Advanced Enterprise Server Edition

    Same as DB2 ESE but with many more features licensed

    8

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    15/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    DB2 for Linux UNIX and Windows PackagingDB2 OS platforms

    OS Software Hardware

    AIX AIX Version 6.1 (64-bit kernel required) AIX Version 7.1 (64-bit kernel required)

    64-bit Common Hardware Reference Platform(CHRP) architecture, excluding POWER3

    All processors that are capable of running the

    supported AIX operating systems

    HP-UX HP-UX 11iv3 (11.31) Itanium based HP Integrity Series Systems

    Linux Red Hat Enterprise Linux 5 Update 6 Red Hat Enterprise Linux 6 SUSE Linux Enterprise Server 10 SP3 SUSE Linux Enterprise Server 11 SP1

    x86, 32-bit Intel and AMD processors x64, 64-bit AMD64 & Intel EM64T processors POWER (System i, System p, and POWERSystems that support Linux)

    IBM System z196 ,IBM System z9 or z10

    Solaris Solaris 10 (64-bit kernel required) UltraSPARC or SPARC64 Solaris x64 (Intel 64 or AMD64)

    Windows XP Professional, Enterprise, Ultimate Vista Business, Enterprise, Ultimate Windows 7 Professional, Enterprise,Ultimate(all above either 32-bit or 64-bit)

    All Intel and AMD processors capable or runningthe supported Windows operating systems,32-bit and 64-bit.

    9

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    DB2 for Linux UNIX and Windows PackagingFeatures and functions supported by edition part 1

    Feature / Function DB2 Express-C DB2 Express DB2 Workgroup DB2 EnterpriseServer

    DB2 AdvancedEnterprise Server

    IBM Data Studio YES YES YES YES YES

    pureXML Storage YES YES YES YES YES

    Temporal Data Mgmt / Time Travel Query * YES YES YES YES YES

    Compression for Backup YES YES YES YES YES

    Row Column Access Control * No YES YES YES YES

    Label Based Access Control No YES YES YES YES

    SQL Replication No YES YES YES YES

    High Availability Disaster Recovery

    (with Tivoli System Automation)

    No YES YES YES YES

    Online Reorg No YES YES YES YES

    Advanc ed Copy Servic es No YES YES YES YES

    Multi-Temperature Storage * No No No YES YES

    Materialized Query Tables No No No YES YES

    Multi-Dimensional Clustering No No No YES YES

    Query Parallelism No No No YES YES

    Connection Concentrator No No No YES YES

    Table Partitioning No No No YES YES

    Plan Lockdown No No No YES YES

    Scan Sharing No No No YES YES

    10

    *

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    16/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    DB2 for Linux UNIX and Windows PackagingFeatures and functions supported by edition part 2

    Feature / Function DB2 Express-C DB2 Express DB2 Workgroup DB2 EnterpriseServer

    DB2 AdvancedEnterprise Server

    DB2 pureScale No No YES W/ pureScale Feature W/ pureScale Feature

    Row Compression (with index, XML, etc.) No No No With StorageOptimization Feature

    YES

    Geodetic Extender No No No Geo det ic Feat ur e Geo det ic Feat ur e

    Homogenous Q Replication No No No No YES (restricted to LUW only)

    Workload Management No No No Partial (monitoring) YES

    Continuous Data Ingest * No No No No YES

    InfoSphere Data Replication No SPP SPP SPP YES

    InfoSphere Optim Perfor mance Manager(with Extended Insight)

    No SPP SPP SPP YES

    InfoSphere Optim Configur ation Manager No SPP SPP SPP YES

    InfoSphere Optim Query Worklo ad Tuner No SPP SPP SPP YES

    InfoSphere Optim pureQuery Runtime forLUW

    No SPP SPP SPP YES

    InfoSphere Optim Data Architect No SPP SPP SPP YES (10 users)

    11

    *

    SPP = Separately purchasable produ ct

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    DB2 for Linux UNIX and Windows PackagingOptimized for your business

    Pick the DB2 that fits your needs

    1. A single machine with a dedicated database

    Linux, Unix and Windows

    Grow by adding more processors and more memory (scale up)

    Start small and grow bigger by simply using more disk space

    Best suited for the majority of business requirements, from small to the large scale

    2. A multiple logical or physical machine with partitioned database (DPF)

    Linux, Unix and Windows

    Grow by adding more logical or physical nodes (scale out) Best suited for data warehousing needs

    IBM Smart Analytics System (ISAS) is a pre-configured appliance for different classes

    3. A multiple logical or physical machines with a shared database (pureScale)

    AIX and Linux

    Optimized for the OLTP operations with a focus on the continuous availability

    A shared database used by all DB2 members

    Grow by adding logical or physical DB2 members

    12

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    17/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    DB2 for Linux UNIX and Windows PackagingInstallation methods & utilities

    Installation Method Windows UNIXDB2 Setup Wizard Yes Yes

    db2_install script No Yes

    Response File ( Silent) Installation(db2setup r)

    Yes Yes

    Manual installation No Yes

    To ins tall DB2:

    On UNIX, you can be a non-root user

    On Windows, you need to be an Administrator

    Tool Comment

    db2prereqcheck Checks system prerequisites before an install

    db2rfe Enable root functionality later after a non-root install

    db2rspgn Generate a response file from a current install should one not exist

    db2iprune Prune files from install for unused features making it smaller

    db2val Check the state of an install

    db2_deinstall Uninstall features, can use a response file UNIX only

    db2unins Uninstall features, can use a response file Windows only

    InstallFixPack Install fix packs

    Linux & UNIX Hardware & OSMinimum Requirements:

    Resource Oracle

    Requirement

    DB2 Requirement

    CPU 1 - 1 GHz processor 1 - 1 GHz processor

    RAM 1GB 512 MB min. (1GBrecommended)

    Swap space 1.5GB 50% of RAM

    Temp space 200MB 60MB

    System drive - 40MB

    13

    Install related tools

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Tools & Products ComparisonAdministration & development tools & products

    Oracle IBM Description of Usage

    Oracle 11g Enterprise DB2 Enterprise Server 10.1 CE Relational Database Management System

    Real Application Clusters pureScale CE Active / Active multi-node processing

    Enterprise Manager Database ConfigurationAssistant

    Administration Assistant

    IBM Data Studio XT InfoSphere Optim Performance Manager InfoSphere Optim Configuration Manager DB2 Recovery Expert

    GUI database master console, control,management, recovery, etc.

    SQL Developer IBM Data Studio XT GUI command line and procedure developer

    SQL*Plus CLPPlus CE DB2 Command Line Processor (CLP) CE

    OS level line oriented database access

    SQL Analyzer DB2 Visual Explain XT (with IBM Data Studio) db2exfmt, db2expln CE InfoSphere Optim Query Workload Tuner

    Query analysis & visual explains

    Oracle Forms Developer DB2 Table Editor Developer Suite Forms creation, development, usage

    Resource Manager DB2 Workload Manager CE Workload control

    Database Replay InfoSphere Optim Query Capture and Replay Workload capture and testing replay

    CE = Part of Cor e Engine

    XT = Extra tool that comes with the Core Engine

    14

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    18/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Tools & Products ComparisonHigh availability, communication & connectivity products

    Oracle IBM Description of Usage

    Data Guard High Availability / Disaster Recovery CE High availability and/or disaster recovery solution

    Transparent Gateway Access Managers for IBM

    CICS, IBM Information

    Management System, DB2

    IBM InfoSphere Federation Server IBM DB2 Connect DB2 Homogeneous Federation CE

    Federation & information integration

    Advanced Replication Message Broker

    DB2 SQL Replication CE IBM InfoSphere Change Data Capture InfoSphere Replication Server IBM MQSeries

    Replication, message queuing

    Internet Commerce Server Internet Application Server

    WebSphere Portal Studio IBM Enterprise Information Portal

    Internet servicing, connection

    Spatial & Intermedia Time Series

    IBM Content Manager family IBM FileNet family

    Image searching, content management, processmanagement

    Hyperion IBM Cognos Business Intelligence (BI) and Reporting Server

    CE = Part of Cor e Engine

    15

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Tools & Products ComparisonInternet, java, data warehousing & OLAP tools & products

    Oracle IBM Description of Usage

    JDeveloper Designer Portal (WebDB) Objects

    IBM Data Studio XT InfoSphere Data Architect

    Java & web development & object modeling

    Data Mart Suite Warehouse Builder

    InfoSphere Warehouse InfoSphere Change Data Capture InfoSphere DataStage

    InfoSphere Replication Server DB2 AlphaBlox

    IBM OmniFind

    Data Warehouse building , data movement,management

    Pure*Integrate InfoSphere QualityStage Data cleansing Express Server Express Objects

    InfoSphere Warehouse Cubing Services Cognos Business Intelligence

    OLAP, data marts, cubes

    Discoverer Reports

    Cognos Business Intelligence IBM DataQuant

    Reporting - in all its forms

    Data Mining Suite Darwin

    InfoSphere Mining with IBM Cognos

    InfoSphere Streams IBM Smart Analytics System

    Data mining

    XT = Extra tool that comes with the Core Engine

    16

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    19/196

    2012 IBM Corporation

    An IBM Proof of Techno logy

    Lab 01 INSTANCE

    20 slides

    Burt Vialpando

    DB2 Instance Exploration and Using

    the Command Line Processor (CLP)

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Server ArchitectureThe DB2 instance overview

    A DB2 Instance is also called a Database Manager or DBM

    An instance performs the following (for the databases they manage):

    Overall database memory usage & defaults:

    Utility impact limits

    Sort, hash, Java and other heap limits and defaults

    Monitoring:

    Health

    Snapshot

    Auditing (instance level)

    Diagnostic & notification logging

    Connection management

    User authentication

    Communication protocols

    Agents & pooling management

    Transaction management

    Workload Management dispatcher service

    Federation control

    Distributed transaction management (DPF)

    Inter-partition communication (DPF)

    18

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    20/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Server ArchitectureThe Oracle unique System ID (SID)

    An Oracle SID is a log ical access to database physical st ructures

    An Oracle SID in a (non-RAC) envi ronment can

    Access only one database at a time

    Oracle terms "instance" & " database" o ften used interchangeably by DBAs &

    users, however: Instance is logical and related to memory and processes

    Database is persistent and related to files

    19

    pfile / spfile

    Datafiles

    Redo logfiles

    BufferPools

    Datacache

    Dictionary

    Database 2

    Oracle Instance 2

    Processes

    Arch ivedLog files

    Redo logfiles

    Control file

    Password filepfile / spfile

    Datafiles

    Redo logfiles

    BufferPools

    Datacache

    Dictionary

    Database 1

    Oracle Instance 1

    Processes

    Arch ivedLog files

    Redo logfiles

    Control file

    Password file

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Server ArchitectureThe DB2 instance

    A DB2 instance is a logical access to database logical and phys ical s tructures A DB2 instance (non pureScale) can access more than one database at a t ime

    Note: most production instances manage only one database

    In a DB2 instance Many Engine Dispatchable Units (EDUs) are shared by all databases Instance configuration parameter (dbm cfg) affects all databases in that instance Database configuration parameters (db cfg) exist for each database

    DB2 terms "instance" & "database" have very distinct meanings

    20

    DBM config

    DataFiles

    Log files DB ThreadEDUs

    BufferPoolsBufferPools

    Catalog DB config

    Database 1

    Log files

    DataFiles

    DB ThreadEDUs

    BufferPoolsBufferPools

    CatalogDB config

    Database 2

    DB2 Instance

    ProcessEDUs

    DBMThreadEDUs

    Arch ivedLog files

    Arch ivedLog files

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    21/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Server ArchitectureOracle processes list (not exhaustive)

    * Can be many

    Level Process Purpose

    Required Server Server processes - Either dedicated or shared, performs requests for the client

    SMON System monitor - Space maintenance & crash recovery agent

    PMONCKPT

    Process monitor - Cleans up failed user processes and frees of resources of these processesCheck point - Flushes modified data from the buffer cache to the disk and updates the control

    file and data files by doing a header update (DBWn actually does the data file write)

    DBWn * Database writer - Writes the dirty buffers from the database buffer cache to the data files on disk

    LGWR Log Writer - Performs sequential writes from the redo log buffer to the redo log files on disk

    Optional MMAN Memory Manager - SGA & PGA memory broker

    MMOM Manageability Monitor - AWR problem detection and self tuning

    MMNL Manageability Monitor Light - Transfer statistics AWR collects to disk

    RECO Resolve for distributed databases - (DISTRIBUTED_TRANSACTIONS mode)

    ARCn * Arch ive log mo nit or - Writes redo logs to archive areas (in ARCHIVE LOG mode)

    SNPn * Snapshot & job scheduler

    Dnnn * & Snnn * Dispatchers - shared server processing agent

    CTWR Change Tracking Writer - RMAN support

    CJQ0, J000 Job Coordinator & Scheduler - assigns jobs to the job queue processes

    DBRM Resource Manager

    DIA0 Diagnosability Process Zero - hand detection and deadlock resolution

    DIAG Diagnostic Dumps

    SMCO Space Management Coordinator - proactive space allocation and reclamation

    ASM Aut omat ic Sto rage Manag ement - related processes are ASMB, ARB, RBAL

    EMNC Event Monitor - event management coordination

    FBDA Flashback Data Archive

    DMON Data Guard Broker

    21

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Server ArchitectureDB2 Engine Dispatchable Unit list (not exhaustive)

    * Can be many

    Level EDU Purpose Similar to inOracle

    Instance d b2sysc Main Syst em con tro ller Server

    PROCESS db2wdog Watchdog - UNIX systems only, handles abnormal termination PMON & SMON

    db2fmp Fenced process executes stored procedures and user defined functions

    db2acd Autonomic computing for health monitor and automatic maintenance MMOM & MMNL

    Instance d b2r es yn c Re-s yn c ag en t - scans the global re-sync list RECO

    THREAD db2car t Invokes user ex its to archive or retr ieve log f iles (Archive Log) ACRn

    db2fmd Fault Monitor keeps instances and monitoring up

    db2ipccm In ter -p rocess l is tener - handles local client programs Listener

    db2tcpcm, &others *

    TCP/IP remote communication listener, & other listeners (depending upon whichprotocols are specified in the DB2COMM variable)

    Listener

    db2d isp Cl ien t connec ti on concentrator d i spatcher Dnnn & Snnn

    db2wlmddb2wlmt

    db2wlmtm

    Workload Manager collects Workload Manager statisticsWorkload Manager Dispatcher scheduling thread

    Workload Manager Dispatcher timer thread

    DBRM

    Database db2loggr Log reader - manipulates log files to handle transaction processing & recovery PMON

    THREAD db2loggw Log writer flushes logs from log buffer to transaction logs on disk LGWR

    db2s tmm Sel f-tun ing memory manager MMAN

    d b2uext 2 Arch ive log m on it or ARCn

    db2pfchr * Buf fer pool pre-fetcher

    db2pclnr * Buf fer pool page c leaner DBWn & CKPT

    db2taskd Background database tasks SNPn

    d b2l og ts Tab le s pace t rac kin g logs which table spaces are in which logs CTWR

    db2hadrp/s High Availability and Disaster Recovery primary and secondary server threads DMON

    App lication db2agent * Various agent threads Server

    22

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    22/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Server ArchitectureDB2 listing EDUs (processes and threads)

    db2pd -edus

    Oracle note:

    On the OS use: ps ef | grep [SID]or

    in SQL*Plus use: v$bgprocess

    23

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Memory Architecture (with background processes)Oracle Linux/UNIX example

    Redo LogBuffer

    SGA

    Oracle Instance

    Shared Pool

    Library Cache

    Dictionary Cache

    PMON DBWRSMON CKPTLGWR othersothersothers

    UserProcess

    ServerProcess

    PGA

    Oracle Database

    Oracle Session *

    sort_area_size

    hash_area_size

    bitmap_merge_area_size

    create_bitmap_area_sizeMMANMMOMCKPTARCnSNPnASM

    * Dedicated Server example

    Java Pool(optional)

    Large Pool

    (optional)

    Data Buffer Cache

    db_2k_cache_size

    db_4k_cache_size

    keep recycle

    db_cache_size - default

    (e.g. db_block_size = 8k)

    db_16k_cache_size

    db_32k_cache_size

    Streams Pool

    (optional)

    Other

    PL/SQL Area

    SQL Area

    Control Structures

    Latches / locks

    Background processes

    pfile, control files, data files, etc.

    Result Cache

    BV

    24

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    23/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Memory Architecture (with background EDUs)DB2 Linux/UNIX example

    * Database Partitioning Feature ** Can be controlled by DB2 Self-Tuning Memory Manager

    DB2 Instance

    Monitor Heap mon_heap_sz

    db2agent

    DB2 Database

    DB2 Application

    App. Shared Memory

    aslheapsz di r_cache

    App. Private Memory

    agent_stack_sz

    applheapsz

    sortheap

    App. Global Memory

    app_ctl_heap_sz (WF *)

    Audit Buffer(optional)

    audit_buf_sz

    db2fmtlg

    db2wdog

    db2gds

    db2ipccm

    db2dlockdb2pclnrdb2loggr db2loggw

    Buffer Pools **

    4k buffer pool8k buffer pool

    16k buffer pool

    4k buffer pool

    4k buffer pool

    32k buffer pool

    Database Heap

    logbuffsz

    catalog_cache_sz

    Utility Heap

    util_heap_sz

    PackageCache **

    pckcachesz

    Lock List **

    locklist

    Sorting **

    sheapthres_shr

    8k buffer pool

    Other memoryareas

    db2pfch

    db2resyn

    db2tcpcm

    db2sysc

    others

    others

    local

    remote

    db2syslog

    db2rebal

    FCM Buffs (DPF *)(optional)

    fcm_num_buffers

    rqrioblk

    sortheap

    database_memory

    java_heap_sz

    stmtheap

    stat_heap_sz

    Instance processes & threads

    Database threads

    BV

    25

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Parameter ConfigurationComparison

    Oracle Parameter Fact DB2 Parameter Fact

    300+ parameters for 11g 120+ DB and 90+ DBM parameters for 10.1

    PFILE required at database creation Generates parameters on its own at instance anddatabase creation

    DBAs use templates or pre-created PFILEs tocreate a database

    DBAs use AUTOCONFIGURE to generate atdatabase creation

    DBAs need to convert PFILE to SPFILE atsome point manually

    The DB and DBM have SPFILE like functionalityby default

    DBAs need to know those parameters that arestatic as they can only be changed withSCOPE=SPFILE

    An instance restart is needed to make this takeaffect

    DBAs do not concern themselves with scope asthey can change any parameter any time

    Those parameters that require an instance restartor a database reactivation will display a messagestating this

    DBAs check for scope change by looking in twodynamic views: v$parameter (current instance setting) v$spparameter (spfile values)

    DBAs see parameters that have not been changed(deferred value) in the current instance anddatabase by using two administrative views: sysibmadm.dbcfg sysibmadm.dbmcfg

    26

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    24/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Registry / Environment VariablesDB2s unique approach

    DB2 registry variables Manage DB2 customization without the need for many OS environment variables simplify

    your .profiles Allow for changes to DB2 without a system reboot Use db2set or use the Configuration Assistant to manage

    DB2 uses only 2 specific environment variables (OS controlled): db2path, db2instance

    Oracle environment variables

    Variable example Function

    db2adminserverdb2commdb2includedb2instance (e)db2instdefdb2ownerdb2path (e)db2system

    Specifies which instance runs t he admin. serverStarted communications m anagerPath to include in SQL searchesCurrent instanceDefault instanceInstance owning machineDirectory where product is installedServer name id

    Variable example Function

    ora_cwdora_sid_pfileoracle_home

    oracle_sidoracle_basenls_langrdbms_archiverdbms_controlsqlpath

    Current Oracle directoryPath to init.ora fileEnvironment where products run

    Default Instan ce (SID)Root of t he Oracle directory treeLanguage, character & territory setLocation of backup database filesLocation of backup database control filesLocation of SQL scripts

    27

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    > db2set all [displays all set variables, including global ones]

    > db2set h [displays help detail on this command]

    > db2set lr [displays all available variables, set or not]

    > db2set db2bqtime=2 [sets a particular variable to a particular value]

    > db2set db2bqtime= [resets the value to its default]

    db2 => !db2set all [interactive CLP mode requires OS ! invocation method]

    [i] DB2COMM=TCPIP

    [i] DB2AUTOSTART=YES

    [g] DB2SYSTEM=potserver

    [g] DB2ADMINSERVER=dasusr1

    db2setThe profile Registry Variable interface

    28

    LEGEND

    [e] Environment Variables OS controlled

    [g] Global Registry Variables effects entire server

    [i] Instance Registry Variables effects current instance

    [n] Node Registry Variables (not shown) node controlled

    [u] User Registry Variables (not shown) user controlled

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    25/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Command Line Processor (CLP)The three modes

    The CLP has three modes:

    Mode Comments

    Command OS prompt, prefaced with a db2 before each command

    OS commands can be mixed with DB2 commands:> db2 get dbm cfg | grep AUTO

    > db2 select * from mytable > outfile.txt

    Batch OS prompt, db2 and an -f option to designate the input file:

    > db2 f inputfile.sql

    Interactive CLP prompt, default: db2 =>

    Can run OS commands with a !

    > db2 [enter]

    db2 => get dbm cfg

    db2 => select * from mytable

    db2 => !ls a

    29

    Windows Note:

    The Windows operating systemrequires an OS shell to run DB2commands. It is invoked usingthis: db2cmd

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    CLP Help

    > db2 ?

    db2 [option ...] [db2-command | sql-statement |[? [phrase | message | sqlstate | class-code]]]

    option: -a, -c, -d, -e{c|s}, -finfile, -i, -lhistfile, -o, -m, -n,-p, -q, -rreport, -s, -t, -td;, -v, -w, -x, -zoutputfile.

    db2-command:ACTIVATE DATABASE GET CONTACTS REDISTRIBUTE DB PARTITIONADD CONTACT GET/UPDATE DB CFG REFRESH LDAPADD CONTACTGROUP GET/UPDATE DBM CFG REGISTER LDAPADD DATALINKS MANAGER GET DBM MONITOR SWITCHES REGISTER XMLSCHEMA

    etc.,

    GET CONTACTGROUP RECONCILE XQUERYGET CONTACTGROUPS RECOVER

    Note: Some commands are operating system specific and may not be available.For further help:

    ? db2-command - help for specified command? OPTIONS - help for all command options? HELP - help for reading help screens

    The preceding three options can be run as db2 from an OS prompt.!db2ic - DB2 Information Center (Windows only)

    This command can also be run as db2ic from an OS prompt.

    > db2 ? sql0100 [this is an example of an SQL message help request]

    Tip:

    db2 ? help helps youread and use help

    screens-----------------------------------

    db2 help launches theInformation Center

    Tip:

    db2 ? help helps youread and use help

    screens-----------------------------------

    db2 help launches theInformation Center

    Tip:

    db2 ? help helps youread and use help

    screens-----------------------------------

    db2 help launches theInformation Center

    30

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    26/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Command Line Processor Option Settings

    Backend process wait time (seconds) (DB2BQTIME) = 1No. of retries to connect to backend (DB2BQTRY) = 60Request queue wait time (seconds) (DB2RQTIME) = 5Input queue wait time (seconds) (DB2IQTIME) = 5Command options (DB2OPTIONS) =

    Option Description Current Setting--------- ---------------------------------------------- ---------------------a Display SQLCA OFF-c Auto-Commit ON-d Retrieve / display XML declarations OFF-e Display SQLCODE/SQLSTATE OFF-f Read from input file OFF-i Pretty print XML data OFF-l Log commands in history file OFF-m Print number of rows OFF-n Remove new line character OFF-o Display output ON-p Display interactive input prompt ON-q Preserve whitespace for XML data OFF-r Save output to report file OFF-s Stop execution on command error OFF

    -t Set statement termination character OFF-v Echo current command OFF-w Display FETCH/SELECT warning msgs ON-x Suppress printing of column headings OFF-z Save all output to output file OFF

    db2 => list command options

    CLP Options

    Tip:Leaving the interactive mode

    turns off your db2option settings!-------------------------------------------? options is different from list

    command options-------------------------------------------Most db2option switches can be

    temporarily overridden in a batchmode

    Tip:Leaving the interactive mode

    turns off your db2option settings!-------------------------------------------? options is different from list

    command options-------------------------------------------Most db2option switches can be

    temporarily overridden in a batchmode

    Tip:Leaving the interactive mode

    turns off your db2option settings!-------------------------------------------? options is different from list

    command options-------------------------------------------Most db2option switches can be

    temporarily overridden in a batchmode

    Setting CLP option examples

    db2 => update command options using a OFF [turns this off]

    db2 => set DB2OPTIONS=+a [Windows alternative for the same thing]db2 => export DB2OPTIONS=+a [UNIX alternative for the same thing]

    31

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    CLP Prompt Customization

    > db2set db2_clpprompt=DB2 CLP %da@%d: [sets the prompt to look like this]

    Database Connection Information

    Database server = DB2/LINUXX8664 10.1.2SQL authorization ID = DBAPOTLocal database alias = SAMPLE

    DB2 CLP DBAPOT @SAMPLE:

    Variable Value Assigned During Runtime

    %i The local al ias o f i ns tance cur rentl y at tached

    %d The local al ias of database cur rentl y connec ted

    %ia The auth id of the cur rent i ns tance at tachment

    %da The authorization ID of the current database connection

    %n New line

    > db2set db2_clpprompt ="Yes Master? "

    > db2set db2_clpprompt=" (Instance: %i, Database: %d):"

    CLP RUNTIME VARIABLES

    32

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    27/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    CLP History and runcmd Commands

    Command history [reverse] [n] displays the last commands cached

    20 ascending is default display and 20 is the default cached

    Set db2_clp_histsize registry variable to change cache size

    runcmd runs the numbered command from the history cache These ONLY work in interactive mode

    db2 => history

    db2 => runcmd 3

    db2 => history1 connect to sample2 list command options3 select * from sysibm.sysdummy120 select * from customer

    db2 =>

    db2 => runcmd 3IBMREQD-------------Y

    1 record(s) selected

    db2 =>

    33

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    CLP Edit Command

    Command edit [editor] [n] invokes editor with

    Last history command [if not specified]

    Number n history command [if specified by number n]

    Number n from last history command [if specified with negative number n]

    edit and edit -1 are the same command

    Editor used default order

    Editor named in the edit command

    Editor specified by the DB2_CLP_EDITORregistry variable

    Editor specified by theVISUAL environment variable

    Editor specified by the EDITORenvironment variable

    Windows - the Notepad editor; UNIX- the vi editor

    After editor is closed

    You will be asked to execute the above command (y/n)?

    y executes the command and caches it for history retrievaln does not execute the command, but caches it for history retrieval

    34

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    28/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    CLP Command WindowBatch mode example

    Batch or shell files can execute saved DB2 command files

    These can produce yet other output files for various purposes

    Here is a Generate RUNSTATS commands example -x to suppress column headings -td to set the end of command delimiter as @ -f to indicate input file name -z to indicate output file name

    db2 connect to sample

    db2 -x -td@ -f CLPxmp01.db2 -z CLPxmp01OUT.txt

    db2 connect reset

    CLPxmp01.sh

    CLPxmp01.db2 CLPxmp01OUT.txt

    select 'RUNSTATS ON TABLE'||rtrim(tabschema)||'.'||tabname||

    ON ALL COLUMNS ALLOW WRITE ACCESS;'from sysstat.tableswhere card = -1@

    RUNSTATS ON TABLE SYSIBM.SYSVIEWSON

    ALL COLUMNS ALLOW WRITE ACCESS;

    RUNSTATS ON TABLE SYSIBM.SYSVIEWDEPONALL COLUMNS ALLOW WRITE ACCESS;

    etc.

    35

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    CLP Command WindowSQLCOMPAT Running Oracle scripts with the CLP

    First you need to set up DB2 enabling an Oracle environment

    See slide: CLPPlus - Getting started by enabling an Oracle environment in DB2:

    Then, you can do the following:

    PLSQL_script01.sq l

    CREATE PACKAGE BODY ClassPackage ASPROCEDURE AddStudent(p_StudentID IN students.id%TYPE,

    p_Course IN classes.course%TYPE) ISBEGININSERT INTO reg_students (student_id, course)

    VALUES (p_StudentID, p_Course);COMMIT;

    END AddStudent; (more procedures and functions)/

    The CLP understands the PL/SQL backslash /

    Run the PL/SQL script using the CLP

    36

    db2 SET SQLCOMPAT PLSQL

    db2 -f PLSQL_script01.sql

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    29/196

    2012 IBM Corporation

    An IBM Proof of Techno logy

    DB2 Database Creation and

    Exploration

    22 slides

    Burt Vialpando21 slides

    Burt Vialpando

    Lab 02 DATABASE

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Database Administration BasicsManual database creation step by step comparison

    Oracle DB2

    #1 Set environment variables:ORACLE_SID, ORACLE_BASE,ORACLE_HOME

    Set registry variables:DB2INST, DB2INSTPROF(DB2PATH is set during install)

    #2 Create password file(using orapwd)

    N/A DB2 uses external authentication, noneed to do this

    #3 Create pfile N/A DB2 invokes autoconfigure automatically

    #4 STARTUP NOMOUNT DB2START (to start the instance)#5 CREATE DATABASE CREATE DATABASE

    #6 Build data dictionary views(using catalog.sql)

    N/A DB2 CREATE DATABASE does this

    #7 Build PL/SQL packages(using catproc.sql)

    N/A DB2 CREATE DATABASE does this

    #8 Update tnsnames.ora with SID(or use other Oracle Net method)

    Optional CATALOG DATABASE in anotherinstance

    38

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    30/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Database Administration BasicsStarting/stopping instances, databases and applications comparison *

    Oracle DB2

    STARTUP 1. DB2START (or START DBM)2. ACTIVATE DATABASE (or CONNECT TO

    DATABASE)

    STARTUP NOMOUNT DB2START

    1. ALTER DATABASE MOUNT2. ALTER DATABASE OPEN

    ACTIVATE DATABASE

    SHUTDOWN (or SHUTDOWN NORMAL) DB2STOP (or STOP DBM)

    SHUTDOWN TRANSACTIONAL 1. QUIESCE INSTANCE DEFER2. DB2STOP

    SHUTDOWN IMMEDIATE DB2STOP FORCE

    SHUTDOWN ABORT DB2_KILL

    ALTER SYSTEM QUIESCE RESTRICTED QUIESCE DATABASE [IMMEDIATE / DEFER]

    ALTER SYSTEM KILL SESSION [SID, SERIAL] FORCE APPLICATION [ALL / HANDLENAME]

    * These are rough equivalents only to give you a basic idea of DB2 capability

    39

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Database Administration BasicsDB2 automating instance and database availability

    DB2 Utility orCommand

    Description AuthorityRequired

    db2iauto UNIX only. Autostarts a DB2 instance upon a UNIXsystem boot.

    In Windows, you set the service property for that instanceto "startup automatic (as an administrator).

    rootor

    SYSADM

    db2fm UNIX only. Configures the fault monitor. Once the DB2instance is up, you use the DB2 fault monitor to keep itup.

    SYSADM

    dasauto The DB2 utility that will autostart the DB2 AdministrationServer.

    DASADM

    autorestart A database configuration parameter. If you set this, theinstance that manages that database will automaticallyreactivate it in the event it abnormally ended and initiate acrash recovery of that database.

    SYSADMor

    DBADM

    sqle_activate_dbsqle_deactivate_db

    Application programming interfaces (APIs) that anapplication can use to activate or deactivate a database.You application server and applications can control thisfunctionality if desired.

    SYSADM,SYSCTRL

    or

    SYSMAINT

    40

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    31/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Database Administration BasicsOracle data dictionary vs. DB2 system catalog

    Oracle Dictionary vs. DB2 System Catalog contents *

    Oracle Data Dictionary Contents

    SYS.xxxx$ - Base Tables

    SYS.V_$ or V$ - Admin istrative viewsSYS.GV_$ or GV$ - Admin istrativ e views (RAC)

    DBA_% - System views all databaseALL_% - System views all ow nedUSER_% - System views all accessible

    Oracle 11g can have 1,600+ entries in th e dictio nary

    DB2 System Catalog Contents

    SYSIBM - Base tables

    SYSCAT - Read-only views, defined for

    catalog base tables

    SYSSTAT - Updateable views

    SYSIBMADM - Admin istrativ e views (similar to V$_)

    All Oracle di cti onar y views *

    DB2 10.1 has 415+ entries in the c atalog

    SELECT column-name FROM user_tables;

    SELECT column-name FROM user_views;

    SELECT column-name FROM syscat.tablesWHERE OWNER=user ANDTYPE=T;

    SELECT column-name FROM syscat.tablesWHERE OWNER=user ANDTYPE=V;

    * Registry variable DB2_COMPATIBILITY_VECTOR=ORA set before creation of a DB2 database will create anadditional 100+ Oracle dictionary views under SYSIBMADM. These include DICT*, ALL*, DBA*, USER*, etc.

    41

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Physical Database Storage ModelStorage structure hierarchy differences, DB2 vs. Oracle

    Oracle & DB2 share a similar physical database storage model

    Below shows the slight differences in concept & semantics

    42

    OS Block

    Logical Physical

    Oracle Block

    Extent

    Segment

    Table space

    Database

    Datafile

    Oracle

    Storage Structure Hierarchy

    OS Block

    Logical Physical

    DB2 Page

    Extent

    Object

    Table space Container

    DB2

    Storage Structure Hierarchy

    Storage Group (optional)

    Database

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    32/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Physical Database Storage ModelTable space types, DB2 vs. Oracle

    * DMS & SMS are used under the covers of an automatic storage table space

    Oracle Table Space Types System & sysaux Non-System

    Temporary

    Dictionary Managed Locally Managed (default)

    Permanent Bigfile Smallfile (default) Dictionary Managed

    Locally Managed (default)

    Transportable Undo

    DB2 Table Space Types Database Managed (DMS) *

    Regular Temporary (system & user) Large

    System Managed (SMS) * Temporary (system & user)

    Oracle table space storage settings

    INITIAL NEXT MINEXTENTS MAXEXTENTS PCTINCREASE FREELIST/GROUPS

    DB2 table space storage settings

    PAGESIZE EXTENTSIZE PREFETCHSIZE OVERHEAD TRANSFERRATE BUFFERPOOL

    43

    Storage Group Data Tag

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Physical Database Storage ModelDB2 table space creation & review

    DB2 table space creation Only SYSADM & SYSCTRL authorities can perform this Only created & active buffer pools may be used in a CREATE TABLESPACE command

    Buffer pools are dynamic & take immediate affect when added, dropped or altered DFT_PREFETCH_SZ can be set to let DB2 calculate optimal prefetching

    To review information on table spaces, use: Data Studio (data source explorer) SYSCAT.TABLESPACES catalog view LIST TABLESPACES command

    CREATE [ LARGE / REGULAR / [SYSTEM / USER] TEMPORARY ]TABLESPACE tablespace-namePAGESIZE integerMANAGED BY [ AUTOMATIC STORAGE][ SYSTEM / DATABASE ]

    [ system-container / database-container ]EXTENTSIZE [ no-pages / integer ]

    PREFETCHSIZE [ no-pages / integer ]BUFFERPOOL bufferpool-nameOVERHEAD [no-mi lli seconds / INHERIT]TRANSFERRATE [no-mi lli seconds / INHERIT]DATA TAG [ integer / INHERIT / NONE]USING STORAGE GROUP [sto-group-name]AUTORESIZE YES;

    44

    INHERIT means the tablespace will get its behavior

    from its storage group

    CREATE STOGROUP sto-gro up-nameON [path]OVERHEAD no-of-millisecondsDEVICE READ RATE no-megabytes-secon dDATA TAG [integer / NONE]

    ;

    The use of storage groups isoptional if automatic storage

    is not used

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    33/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Physical Database Storage ModelDB2 container types for DMS & SMS

    DMS is for database managed table spaces All Oracle table spaces translate to DMS type

    DMS is like an Oracle locally managed, uniform extent table space

    Recommended for user data table spaces

    UseAUTORESIZE is like OracleAUTOEXTEND

    UseALTER TABLESPACEREDUCE to reclaim all space on table space

    SMS is for system managed table spaces Recommended for the catalog and temporary table spaces

    Operating system controlled No database alterations possible to the container(s)

    More containers can be added to it only with a redirected restore

    DMS - Database Managed SMS - System Managed

    File DeviceDirectory

    /database/tablespace/prod1

    Oracle note:Oracle has no equivalent of

    an SMS table space

    45

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Physical Database Storage Model FeatureMulti-Temperature Storage Support *

    Maximize your newest and fastest storage for your most important data

    e.g. keep only the data you need for instant access on your solid state storage

    Extend the life of your older storage

    e.g. keep infrequently used data on it

    Utilize storage groups in the automatic storage pool to manage this with ease

    Administrative commands make moving data between storage systems easy

    Prioritize data by what it is and where it resides

    Integrate fully with DB2 Workload Manager and InfoSphere Optim Data Growth solutions

    46

    Sto_Grp_Hot

    SSD RAID(Very Fast)

    Fibre Channel / SAS RAID(Fast)

    SATA RAID(Medium)

    2012 Q1 2011 Q4 2011 Q3 2011 Q2 2011 Q1 2010 Q4 2010 Q1

    DB2 Range Partitioned Table

    Sto_Grp_Warm Sto_Grp_Cold

    tbspc9 tbspc8 tbspc7 tbspc6 tbspc5 tbspc4 tbspc1

    FOR MORE DETAILSSEE MISC. TOPICS

    Oracle note:Oracle ASM does nothave this capability.

    * Enterprise ServerEditions only

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    34/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Physical Database Storage Model FeatureTemporal Data Management and Time Travel Query

    Temporal Data Management gives you:

    Time Travel Query capability without the burden of changing the application

    or creating complex trigger/function/procedure solutions

    Optimized environments for meeting audit and compliance inquiries

    Standardized support for temporal INSERT, UPDATE and DELETE operations

    Reduced risks, lower costs and DBA time savings

    EMPLOYEES_TB

    EMPLOYEES_HISTORY_TB

    EmpID Dept System_start System_end

    12345 M15 05/31/2000 12/30/9999

    EmpID Dept System_start System_end

    67890 K25 11/15/1995 03/31/200012345 J13 11/15/1995 12/31/1998

    12345 M24 12/31/1998 05/31/2000

    History automaticallymaintained by DB2

    Temporal Data Management

    SELECT Dept FROM employees_tbWHERE EmpID=12345;

    SELECT Dept FROM employees_tb

    FOR SYSTEM_TIMEAS OF 01/01/1997WHERE EmpID = 12345;

    See dataas it is

    right now

    See data

    as it wasin the past

    Time Travel Query

    Oracle note:Oracle does not have

    this capability.47

    FOR MORE DETAILS

    SEE MISC. TOPICS

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Physical Database Storage Model FeatureDeep compression* feature highlights

    Dictionary based symbol for compressing or decompressing data rows

    Lempel-Ziv (LZ) based algorithm creates a static dictionary based at the table level

    A single table dictionary is stored within the table object for recurring large domain patterns

    Compression is also done adaptively at the page level

    Smaller page stored dictionaries are for the ever changing page level patterns

    Data resides compressed on pages

    On the table space disk giving significant I/O bandwidth savings

    In buffer pools giving memory savings & improvement in performance

    In recovery log disk & archive log tape

    Compression is easy to implement and use

    DBA just uses these keywords: COMPRESS YES

    Compression done during insert, update, import or load

    Table dictionary is built on the fly with Automatic Dictionary Creation after a 1 MB sample

    Page dictionaries are built adaptively any time repeating patterns are detected

    Compression done in many ways:

    48

    * Enterprise Server Editions only

    FOR MORE DETAILS SEECOMPRESSION TOPIC

    Data2 levels

    Indexes3 techniques

    XMLXDAs

    Temp tables5 usages

    Replicatedtables

    Logarchives

    InlineLOBs

    Oracle note:Oracle has significantly less ways

    to do compression than DB2

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    35/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Physical Database Storage Model FeatureRange partitioned tables *

    Partitioning column

    Must be base data types: No LOB or XML

    Can be multiple columns

    Can be generated column

    Flexible DDL options

    Short, long or mixed forms

    Direct specific table space usage

    Handy keywords: INCLUSIVE, EXCLUSIVE, MINVALUE,

    MAXVALUE, etc.

    Easy maintenance

    Roll-in and roll-out ability

    On-line SET INTEGRITY

    Supports local indexes

    Supports global indexes

    Tablespace1

    Table1.Part1

    1

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    36/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Database AdministrationDB2 REORG modes

    DB2 REORG Characteristic Classic In place (AKA online*)

    Performance Faster Slower (up to 20 times)

    Clustering Factor of data at completion GoodMay not be perfectly clustered(if activity is done during REORG)

    Concurrency (access to table)No Access or

    Read OnlyRead Only orFull Access

    Data Storage Space Requirement Significant Not Significant

    Logging Storage Space Requirement Not Significant Could Be Significant

    User Control(ability to pause & restart process)

    Less Control More Control

    RecoverabilityAll or nothing;

    it either succeeds or failsRecoverable

    Index Rebuild ** Done Not Done

    Supported for every type of table Yes No

    Specify Index (other than clustering index) Yes No

    Use of Temporary Table Space Yes No

    * Online REORG not available with DB2 Express Editions ** Index rebuilds are done separately in Oracle

    51

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Database AdministrationDB2 Materialized Query Table* (MQT) vs. Oracle Materialized View

    Oracle Materialized View DB2 Materialized Query Table (MQT)

    CREATE [1] MATERIALIZED VIEW[2] PROD.DAILYSUM

    [6] TABLESPACE TABLESPACE1 [4] BUILD IMMEDIATE [5] REFRESH FAST ON DEMAND [3] AS SELECTA.ORGUNT_SID ORGUNT_SID,

    C.DPTCHRT_SID DPTCHRT_SID,

    C.ANCDPT_SID DPT_SID,

    B.TMFRAM_SID TMFRAM_SID,

    B.STRTDT STRTDT,

    SUM(A.ONSALEFLG) ONSALEFLG,

    COUNT(A.ONSALEFLG) ONSALEFLGCNT,

    SUM(A.SALES) SALES,COUNT(A.SALES) SALESCNT,

    SUM(A.SHRINK) SHRINK,

    COUNT(A.SHRINK) SHRNKCNT,

    COUNT(*) RECORDCNT

    FROM PROD.DAYTOT A,PROD.CALDTL B,

    PROD.DPTCHR C

    WHERE B.CAL_SID = 100AND B.TMFRAM_SID != 10

    AND A.DT BETWEEN B.STRTDT AND B.ENDDT

    AND A.DPT_SID = C.RPTDPT_SIDGROUP BY A.ORGUNT_SID, C.DPTCHRT_SID,

    C.ANCDPT_SID, B.TMFRAM_SID,

    B.STRTDT ;

    CREATE [1] TABLE

    [2] PROD.DAILYSUM [3] AS(SELECTA.ORGUNT_SID AS ORGUNT_SID, C.DPTCHRT_SID AS DPTCHRT_SID, C.ANCDPT_SID AS DPT_SID, B.TMFRAM_SID AS TMFRAM_SID, B.STRTDT AS STRTDT, SUM(A.ONSALEFLG) AS ONSALEFLG, COUNT(A.ONSALEFLG) AS ONSALEFLGCNT, SUM(A.SALES) AS SALES, COUNT(A.SALES) AS SALESCNT, SUM(A.SHRINK) AS SHRINK,COUNT(A.SHRINK) AS SHRNKCNT,COUNT(*) AS RECORDCNT,

    FROM PROD.DAYTOT A, PROD.CALDTL B, PROD.DPTCHR CWHERE B.CAL_SID = 100 AND B.TMFRAM_SID 10 AND A.DT BETWEEN B.STRTDT AND B.ENDDT AND A.DPT_SID = C.RPTDPT_SIDGROUP BY A.ORGUNT_SID, C.DPTCHRT_SID,

    C.ANCDPT_SID, B.TMFRAM_SID,

    B.STRTDT)

    [4] [INTIALLY DEFERRED]

    [5] REFRESH DEFERRED

    [6] IN TABLESPACE1 INDEXES IN TABLESPACE2 ;

    * Enterprise Server Editions only

    52

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    37/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    DB2 Database Partitioning Feature (DPF) *The big data solution

    Optimized for data warehousing

    Based upon a shared nothing architecture

    Each DB2 node has its own part of the database to process

    Coordinating DB2node

    Collects results fromall other nodes

    Divide and conquer

    Each database partition runs a query on its own part of thedatabase and the final result is assembled at the coordinating node

    Scale out by addingnodes to more

    physical or logicalservers

    Part 0 Part 1 Part 2 Part 3 Part 4

    53

    Oracle note:Oracle does not havethis shared nothing

    capability.

    * Only available through Warehouse Editions

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    DB2 pureScale FeatureThe OLTP for active / active continuous availability solution

    Optimized for fast transaction processing with active failover

    Based upon IBM clustering technology CF Member with RDMA

    Modeled from a proven IBM mainframe Sysplex methodology to access shared data

    Shared storage database (e.g. GPFS)

    Standby CFmember getsupdates fromprimary CF

    member

    Primary CFmember

    maintainingglobal buffer

    pool and globallock manager

    Each DB2 member has its locki ng, buffer pool & logfiles. Note: a member is NOT a database partition.

    Interrupt free RDMA calls via network cluster interconnect

    Add / remove DB2members dynamically

    54

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    38/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    DB2 Workload Management *Overview

    FOR MORE DETAILS

    SEE WLM TOPIC

    * Enterprise Server Editions only

    55

    User requestsUser requests

    User requestsUser requests

    User requestsUser requests

    User requestsUser requests

    System requestsSystem requests

    Maintenancerequests

    Workload A

    Workload B

    Workload C

    Service Subclass A

    Service Subclass B

    Default User Class

    Default System Class

    Default MaintenanceClass

    DB2 Data Server

    Default UserWorkload

    WLM CLASS AIX2 (or Linux)

    Service Super-class 1

    AIX/Lin ux Wor klo ad Manager

    Thresholds

    Thresholds

    Thresholds

    Requests

    Initiate all work inDB2 (even systemand maintenance

    work) which will bemapped to a specific

    service class.

    Use default classes

    if not defined. Threshold

    Establish limits of use over adatabase, workload or service class

    Workload

    Is how work is routedto a DB2 service

    class.

    Serves as primarypoint of identity and

    control for submittersof work.

    Uses attributes likeapplication name,system or session

    user, clientworkstation and soon, to map to each

    connection

    Work Action Sets

    Work Action Sets

    Work Action Set

    Control specific types of activitiesover a database or service class

    Workload Manager Monitoringdb2pd, Event, SQL Functions & Procedures

    Service Class

    Is where the work for adatabase is executed.

    Is the primary point ofresource assignment,

    control and monitoring.

    Uses a 2-Tier hierarchywhich defines super-classesto provide commonattributes across

    subclasses. This provides amore complex division of

    execution.

    Service ClassOn AIX or Linux

    Each DB2 service class can

    be associated with an AIX orLinux Workload Managerservice class for tight OS

    integration.

    Thresholds

    WLM CLASS AIX1 (or Linux)

    WLM CLASS AIX3 (or Linux)

    BV

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    DB2 Geodetic and Spatial ExtendersGlobal vs. flat mapping

    DB2 Geodetic Data Management Feature * Treats the Earth as a globe

    Uses a latitude and longitude coordinate system on an ellipsoidal Earth model

    Geometric operations are precise, regardless of location

    It is built on the Hipparchus library, which is licensed from Geodyssey Limited

    Best used for global data sets and applications that cover large areas on theEarth, where a single map projection cannot provide the accuracy required bythe application

    DB2 Spatial Extender

    Treats the Earth as a flat map Uses planimetric (flat-plane) geometry, which means that it approximates the

    round surface of the Earth by projecting it onto a flat plane

    These projections do cause some distortion which is characteristic of all flat-map projection

    Built on the ESRI shape library, which is licensed from ESRI

    Best used for local and regional data sets that are well represented in projectedcoordinates, and for applications where location accuracy is not important

    For example, a medical insurance company might want to know the locations ofhospitals and clinics within a state or province

    * Enterprise Editions only with Geodetic Feature

    56

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    39/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Non-obvious Database Administration Term / Feature MappingDB2 vs. Oracle

    Oracle Term / Feature DB2 Term / Feature

    Alert LogDump files

    Administrat ion Noti ficat ion LogDB2Diag Log

    Archive Redo Log Archive Log

    Autoextend AutoresizeData Dictionary System Catalog

    Data Dictionary Cache Catalog Cache

    Data Cache Buffer Pool

    Data File Container

    Dbms_repair Inspect

    Dump datafile #block# (ALTER SYSTEM) db2dart

    Enable Restricted & Quiesce Quiesce

    Large pool Utility Heap

    Library Cache Package Cache

    Materialized View Materialized Query Table (MQT)

    pfile or spfile (init.ora) DBM Configuration

    DB ConfigurationStatement Cache Package Cache

    Transparent Appl ication Fai lover (TAF) Automatic Cl ient Reroute

    V_$ views (dynamic views) Administration Views (SYSIBMADM)

    57

    2012 IBM Corporation

    An IBM Proof of Techno logy

    IBM Data Studio

    Lab 03 DATASTUDIO

    27 slides

    Burt Vialpando

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    40/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Data StudioDatabase management and application development environment

    Database and data object management features:

    Supports DPF and pureScale databases

    Data source connections: browse data objects and their properties

    Editors and task assistants: data object create, alter or drop

    Modification of privileges: data objects & auth IDs

    Data manipulation: edit, extract & load

    Data diagrams: visualization of data object relationships

    Change impact analysis

    Compare and sync databases

    Save changes and undo them

    Appl ication development features:

    Editors & task assistants: create, test, debug & deploy stored procedures & UDFs

    SQL Query builder, SQL & XQuery editors

    Visual Explain

    Routine debugger

    Web services creation, XML & SQLJ development

    59

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Data StudioPlatforms, packaging and databases supported

    Platforms supported:

    Windows 7, Windows Vista, Windows XP Professional, Windows 2008

    Packaging opt ions

    Full client: Complete feature set, has Java IDE

    Admin client: Lighter weight, DBA oriented, lacks Java IDE

    Web Console: Separate browser based monitoring interface

    Database full object management and database support:

    DB2 for Linux, Unix and Windows 10.1, 9.8, 9.7, 9.5, 9.1

    Database simple object management support:

    DB2 for z/OS

    Informix

    Oracle

    These database sourceswill not be a focus of this

    presentation

    60

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    41/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Data StudioBuilt on the Eclipse framework

    Eclipse definition:

    Open extensible Integrated Development Environment (IDE)

    Developed by IBM, donated to the open source community, managed byeclipse.org

    Eclipse perspectives are visual containers for a set of views and editors thatare different for each context

    Eclipse tools operate on files in a workspace

    Workspace holds 1 or more top level projects

    Projects map to directories in file system

    Plug-in access via workspace and resourceAPIs

    Eclipse benefits:

    Full IDE support of: Java, C/C++/C#, PERL, PHP, HTML, JSP, EJB, etc.

    Advanced drag and drop features

    Open integration for other administrative and development tools Easy adding of new tools to existing installed products via shell sharing

    61

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Data StudioHow Eclipse based products work together

    Operating System layer

    Java VM JDBC

    Eclipse Platform

    IBM Software Development Platform

    InfoSphere Optim Plug-ins

    Eclipse (E) + IBM Software Development Platform (I) + Optim Plug-in

    E + I + Data Modeling Plug-in = InfoSphere Optim Data Architect

    E + I + Tuning Plug-in = InfoSphere Optim Query Workload Tuner

    62

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    42/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Data StudioEclipse basic terminology

    63

    Perspective

    A collection ofviews and

    editors

    View

    Data ProjectExplorer

    View

    DataSourceExplorer

    Editor

    (SQL PLexample)

    View

    SQL Results

    Editor

    Properties

    Customizable

    Open, close or resizeviews and editors inthe perspective anddrag and drop them

    anywhere.

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Password ManagementSimple one screen capability

    Manage all passwords and connections in one screen

    64

    App ly t he sam e username and password to

    any or all databaseconnection properties

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    43/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    ExplorersConnection working sets

    Create a collection o f databases that you will be working with

    65

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Explorers Data Source vs. AdministrationHierarchical vs. flat presentation styles

    66

    Hierarchical Presentation:Data Source Explorer

    Flat Presentation:Administ rat ion Explorer

    All objectsregardlessof schema

    Choosepresentation

    type

    All objectsfor a given

    schema

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    44/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Administration ExplorerObject List Editor

    Object Lists help you work with several similar objects at the same time

    With flat presentation: work with several objects that have different parents

    67

    Tables

    Listing, editing

    and exploring

    Schemas

    Listing, editingand exploring

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    ExplorersFiltering the objects

    In either hierarchical or f lat presentations, filter any object type

    68

    Filter schemasthat start with

    GO

    Filter tablesthat contain

    ORD

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    45/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Task AssistantDefinition and options

    A task assistant is analogous to a GUI wizard

    A task assistant gu ides you through the process of sett ing opt ions for aselect database adminis tration command

    Perform administration e.g.: backup, force application, grants, etc.

    Perform object maintenance e.g.: create index, alter table, etc.

    A task assistant can have these elements:

    Settings area

    Specify options and other input needed for a command to run

    Command section

    Displays the command being generated by the settings area

    Optionally allows you to edit and save the command

    Messages section

    Displays progress of the command running or completed

    69

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Task AssistantExample: backup database (administration task)

    70

    produce these

    DB2 commands

    Thesesettings

    Settings arein multiple

    screens

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    46/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Task AssistantExample: extended table alter (object task)

    Table i n alter state

    Reviewchanges

    Related

    objectsautomaticallymaintained

    Data

    preserved

    Columnsscreen

    Add att ributebutton

    Alter att ribute

    71

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Task AssistantExample: create / alter storage groups and table spaces

    72

    StorageGroups

    TableSpaces

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    47/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Task AssistantExample: Managing authorities and privileges

    73

    Objectprivilege

    management

    Database

    authoritymanagement

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Executing SQLExample

    Create, format and execute SQL from a powerful context sensitive editor

    74

    Edit / run SQL

    Intelligent contextsensitive editor

    [F5]

    Format your SQL

    One of the manyoptions

    Validate your SQL

    Use the appropriateversion

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    48/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Visual ExplainGenerate an interactive access plan diagram

    75

    Drill down intoany node to see

    more detail

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Analyze ImpactDiscover object dependencies

    Easily see how your objects relate to each other

    76

    Impacted Objects

    Diagram

    Impacted Objects

    Detail lis t

  • 7/16/2019 PoT.im.06.1.027.14 Presentation

    49/196

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Overview DiagramDiscover object relationships

    Generate simple overview diagrams of your tables

    By using defined RI or even inferred relationships through intelligent modeling

    77

    Move, change oredit any object or

    relationship inthe diagram

    2012 IBM Corporation

    IBM Software

    DB2 10.1 Administration for the Experienced Oracle DBA - Proof of Technology

    Editing Data

    Intuitive insert, update, delete interface

    78