31
DB2 UDB Components and Concepts Introduction 2-2 Control Center 2-3 Replication Center 2-7 Satellite Administration Center 2-11 Command Center 2-12 Task Center 2-13 Health Center 2-14 Journal Center 2-15 Development Center 2-17 License Center 2-18 Information Center 2-19 Memory Areas 2-20 Run-time Components 2-22 System commands 2-23 Contacts and Contact Groups 2-27 Data Link Managers 2-29 Configuration Commands 2-30 Parallel Architecture 2-31

DB2 UDB Components and Concepts - SYS-ED courses, · PDF file · 2010-11-15DB2 UDB Components and Concepts Introduction 2-2 Control Center 2-3 Replication Center 2-7 Satellite Administration

Embed Size (px)

Citation preview

DB2 UDB Components and Concepts Introduction 2-2

Control Center 2-3

Replication Center 2-7

Satellite Administration Center 2-11

Command Center 2-12

Task Center 2-13

Health Center 2-14

Journal Center 2-15

Development Center 2-17

License Center 2-18

Information Center 2-19

Memory Areas 2-20

Run-time Components 2-22

System commands 2-23

Contacts and Contact Groups 2-27

Data Link Managers 2-29

Configuration Commands 2-30

Parallel Architecture 2-31

DB2 UDB Components and Concepts

Introduction DB2 UDB has many GUI Utilities. You can easily move from one to another as the toolbars contain icons which transfer control to another window. Before we examine the GUI Utilities, we need to consider the range of DB2 objects which we will be managing.

DSA-10

System

DB2 object hierarchy

Instance(s)Database(s)

Database Partition Group(s)

Tables

Indexes

LOB data

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-2 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

The Control Center

We start with the Control Center. First, you select which System you want to work with. Next, you select the appropriate instance. Then you select which database you want to manage. The right hand window displays the object types for this database.

The Control Center has the usual style of menu bar. You can use this to control your activities . . .

. . . or you can opt to use the icons on the toolbar.

At the bottom of the objects window is the status bar. This contains options for sorting, filtering, and other processing.

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-3 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Here we have selected the tables belonging to the SAMPLE database.

You can administer many DB2 objects from the Control Center. These include: • Systems • Instances • Databases • Table spaces • Tables • Views • Indexes • Schemas • Triggers • Stored procedures • User-defined types • User-defined functions • User-defined methods • Packages • Aliases • Event monitors • Buffer pools • Users and groups

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-4 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

If you right-click an object, a pop-up menu provides you with a list of the actions you can perform on that object. In this example, we have right-clicked an instance.

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-5 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Control Center toolbar options

Replication Center

Satellite Administration Center

Data Warehouse Center (with the Data Warehousing option)

Command Center

Task Center

Information Catalog Center (with the Data Warehousing option)

Health Center

Journal

License Center

Development Center

Information Center

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-6 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Replication Center

The Replication Center is useful if you intend to have duplicate copiestables on other servers in your system.

of

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-7 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-8 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-9 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-10 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Satellite Administration Center

nction.

The Satellite Administration Center is used to set up and administer a group of DB2 servers (satellites) that perform the same business fu These servers run the same application and have the same DB2 configuration(database definition).

Details of the satellite environment are stored in the satellite control database (SATCTLDB). The DB2 server that contains this database is known as the satellite control server. You control the satellites from the Satellite Administration Center by creating batches (scripts) which maintain the database definitions. Satellites download batch scripts, execute them, and report the results in a process known as synchronization. Each satellite synchronizes to maintain its consistency with the other satellites that belong to its group. Before you can use the Satellite Administration Center, you must:

• install the satellite control server • create the satellite control database • catalog the satellite control database in the Control Center, if it is not already

catalogued

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-11 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Command Center

(DSA1

ts. You can use the Command Center to execute DB2 commands and SQL statemen

You can also work with command scripts and examine a graphical view of the access plan for explained SQL statements.

/1;2003.09) © Oakwood Computing Ltd Page 2-12 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Task Center

The Task Center enables you to run tasks (scripts). For each task, you can:

• Schedule the task • Specify success and failure conditions • Specify actions that should be performed when this task

completes successfully or when it fails • Specify e-mail addresses that should be notified when this

task completes successfully or when it fails

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-13 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Health Center

You can set up the Health Center to view: • Alarms • plus warnings • plus attentions (as currently

selected) • All alerts

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-14 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Journal

The Messages page shows messages that were issued from the Control Center and other GUI tools. The Task History page shows the results of tasks that have been executed. For each completed execution of a task, you can perform the following:

• View the execution results • View the task that was executed • Edit the task that was executed • View the task execution statistics • Remove the task execution object from the Journal.

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-15 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Use the Notification Log page to show information from the administration notification log. The list can be filtered. For example, you can show only alerts from the health monitor. Database History shows information from the recovery history file. This file is updated when you perform operations such as:

• Backup • Restore • Roll forward • Load • Reorg

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-16 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Development Center

With the Development Center you can develop:

• stored procedures • user-defined functions (UDFs) • structured types

The Development Center includes the old Stored Procedure Builder in previous versions.

There is a set of wizards which makes it easy to perform development tasks.

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-17 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

License Center

Use the License page to display the following:

• Product name • Version information • Expiry date • Registered user policy • Number of entitled DB2 Connect users • Current number of DB2 Connect users • Enforcement policy • Number of processors and number of licensed processors (for DB2 Universal

Database Enterprise Server Edition)

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-18 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Information Center

This provides you with a comprehensive set of DB2 documentation. Take time to explore it.

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-19 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Memory areas DB2 uses many memory areas. The Database Manager includes a Shared Memory area.

DSB-130

Database ManagerShared Memory

Database global memory

1 (numdb)

Database global memory

For each database there will be a global memory area which is available to all applications running on that database.

DSB-140

Database ManagerShared Memory

Database global memory

Applicationglobalmemory

Applicationglobalmemory

Applicationglobalmemory

1

1

(numdb)

(maxappls)

Database global memory

Each application has a global area of memory which will be accessible to each task executing within that application.

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-20 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Within an application, and agent manages the execution of that application on behalf of a client user:

DSB-150

Database ManagerShared Memory

Database global memory

Applicationglobalmemory

Agentprivatememory

Agentprivatememory

Agentprivatememory

Agentprivatememory

Agentprivatememory

Applicationglobalmemory

Applicationglobalmemory

1

1

1

(numdb)

(maxappls)

(maxagents)

Database global memory

The memory areas include:

• Buffer pools • Lock list • Database heap • Log buffer • Catalog cache • Utility heap • Package cache

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-21 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Run time components The run time components which make use of DB2 memory include:

• Logical agents • Coordinator agents • Subagents • Logger • Locking mechanism • Deadlock detector • Prefetchers • Page cleaners

DUF-10

clientsClient ApplicationDB2 UDB Client Library

Shared Memory + Semaphore, APPC, TCP/IP, IPX/SPX, Named Pipe, NetBIOS

log

Bufferpool(s)

Log buffer

Logger

subagents

CoordinatorAgent

CoordinatorAgent

subagents

Page Cleaners

Prefetchers

Common prefetchrequest queue

Async I/O PrefetchRequests

Write LogRequests

Parallel, Big-Block,read requests

Parallel, Pagewrite requests

Deadlockdetector

scatter/gatherI/Os

Victimnotifications

disks

DB2 UDB Server

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-22 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

System Commands: db2admin This utility manages the DB2 Administration Server. >>-db2admin-----------------------------------------------------> >--+-----------------------------------------------------------------+->< +-START-----------------------------------------------------------+ +-STOP--+--------+------------------------------------------------+ | '-/FORCE-' | +-CREATE--+----------------------+--+---------------------------+-+ | '-/USER:--user-account-' '-/PASSWORD:--user-password-' | +-DROP------------------------------------------------------------+ +-SETID--user-account--user-password------------------------------+ +-SETSCHEDID--sched-user--sched-password--------------------------+ +--?--------------------------------------------------------------+ '--q--------------------------------------------------------------' On UNIX systems, the executable file for the db2admin command can be found in:

home/DASuser/das/bin For Windows, db2admin is found in:

sqllib/bin

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-23 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

db2cc This command starts the Control Center. >>-db2cc--+------+--+----+--+---------+-------------------------> +--wc--+ '--t-' '--tcomms-' +--rc--+ +--tc--+ +--j---+ +--hc--+ +--mv--+ +--tm--+ '--icc-' >--+----------------------+--+--------------------+--+-----+----> | .-+------. | '--ccf--+----------+-' '--ic-' | V | | '-filename-' '--tfilter----filter-+-' >--+---------------+--------------------------------------------> '--ict--seconds-' >--+---------------------------------------------------------------------+->< '--h--system--+--------------------------------+--+-----------------+-' '--i--instance--+--------------+-' '--sub--subsystem-' '--d--database-' Command parameters -wc Opens the Warehouse Center. -rc Opens the Replication Center. -hc Opens the Health Center. -tc Opens the Task Center. -j Opens the Journal. -mv Opens the Memory Visualizer. -tm Opens the Identify Indoubt Transaction Manager. -icc Opens the Information Catalog Manager. -t Turns on Control Center Trace for an initialization code. -tcomms Limits tracing to communications events. -tfilter filter Limits tracing to entries containing the specified filter or filters. -ccf filename Opens the Command Center. If a (absolute path) filename is specified, the

contents of this file are loaded into the Command Center's Script page. -ic Opens the Information Center. -ict seconds Idle Connection Timer. Closes any idle connections in the pools; default 30 mins. -h system Opens the Control Center in the context of a system. -i instance Opens the Control Center in the context of an instance. -d database Opens the Control Center in the context of a database. -sub subsystem Opens the Control Center in the context of a subsystem.

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-24 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

db2cli This command launches the interactive Call Level Interface environment for design and prototyping in CLI. >>-db2cli------------------------------------------------------>< The DB2 Interactive CLI contains a set of commands that can be used to design, prototype, and test CLI function calls. It is a programming testing tool and is not intended for end users. There are no extensive error-checking capabilities. There are two types of supported commands:

• CLI commands Commands that are equivalent of the IBM CLI function calls

• Support commands Commands that do not have an equivalent CLI function.

You can issue commands interactively, or from within a file. The command output can be displayed on the terminal, or written to a file. You can also capture all commands that are entered during a session and to write them to a file; this creates a command script that can be rerun at a later time. db2cmd

This (Windows-only) command opens the CLP-enabled DB2 window, and initializes the DB2 command line environment.

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-25 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

db2licm If you are not using the Control Center, you can use this command to add, remove, list, and modify licenses and policies installed on your local system.

>>-db2licm------------------------------------------------------> >--+-----------------------------------------------------------------+->< +--a--filename----------------------------------------------------+ +--l--------------------------------------------------------------+ +--p--prod-password--+------------+--+------------+--+----------+-+ | '-REGISTERED-' '-CONCURRENT-' +-INTERNET-+ | | '-MEASURED-' | +--r--prod-password-----------------------------------------------+ +--u--prod-password--num-users------------------------------------+ +--n--prod-password--num-processors-------------------------------+ +--e--prod-password--+-HARD-+-------------------------------------+ | '-SOFT-' | +--v--------------------------------------------------------------+ '-+--h-+----------------------------------------------------------' '--?-'

-a filename Adds a license for a product. -l Lists all the products with available license information. -p prod-password keyword

Updates the license policy type to use on the system. -r prod-password Removes the license for a product. After this, the product functions in "Try &

Buy" mode. You must invoke the db2licm command with the -l option to get the password for a specific product

-u prod-password num-users Updates the number of user licenses for a product.

-n prod-password num-processors Updates the number of processors for which DB2 is licensed.

-e prod-password Updates the enforcement policy on the system. HARD - unlicensed requests will not be allowed. SOFT - unlicensed requests will be logged but not restricted.

-v Displays version information. -h/-? Displays help information (all other options are ignored). Examples db2licm -a db2ese.lic db2licm -p db2wse registered concurrent db2licm -r db2ese db2licm -u db2wse 10 db2licm -n db2ese 8

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-26 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Contacts and Contact Groups Contacts are users who receive messages sent from processes such as the Scheduler and Health Monitor. You can create groups of users who will receive such messages.

DB2

Contacts and Contact Groups DSA-110 ADD CONTACT This command adds a contact to the contact list which can be either defined locally on the system or in a global list. The Database Administration Server (DAS) contact_host configuration parameter determines whether the list is local or global. >>-ADD CONTACT--name--TYPE--------------------------------------> >--+-EMAIL----------------------------------------+-------------> '-PAGE--+------------------------------------+-' '-+-MAXIMUM PAGE LENGTH-+--pg-length-' '-MAX LEN-------------' >--ADDRESS--recipients address--+----------------------------------+->< '-DESCRIPTION--contact description-'

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-27 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

ADD CONTACT GROUP This adds a new contact group to the list of groups defined on the local system. .-,-----------------. V | >>-ADD CONTACTGROUP--name----+-CONTACT-+--name-+----------------> '-GROUP---' >--+--------------------------------+-------------------------->< '-DESCRIPTION--group description-' DROP CONTACT >>-DROP CONTACT--name------------------------------------------><

DROP CONTACTGROUP >>-DROP CONTACTGROUP--name-------------------------------------><

DB2

Contacts and Contact Groups DSA-110

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-28 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Accessing external files: Data Links Manager The DATALINK data type enables columns in tables to access external files. A host DB2 system can access files on up to 16 different systems, each of which is controlled by a Data Links Manager.

DB2 host

Data LinkManager

Data LinkServers

linked files

DLFM_DB

logging manager

Table withDATALINKdata type(URL)

Referencing external files DSA-130

Add an entry to the list of registered DB2 Data Links Managers for a database:

>>-ADD DATALINKS MANAGER FOR--+-DATABASE-+--dbname--USING-------> '-DB-------' >----NODE--hostname--PORT--port-number-------------------------><

This command lists the DB2 Data Links Managers that are registered to a database:

>>-LIST DATALINKS MANAGERS FOR--+-DATABASE-+--dbname----------->< '-DB-------'

Drop an entry from the list of registered DB2 Data Links Managers for a database:

>>-DROP DATALINKS MANAGER FOR--+-DATABASE-+--dbname--USING------> '-DB-------' >--name--------------------------------------------------------><

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-29 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

Configuration commands GET ADMIN CONFIGURATION This command displays the values of DB2 Administration Server (DAS) configuration parameters on the administration node of the system. The DAS is a special administrative tool that enables you to carry out remote administration of DB2 servers. >>-GET ADMIN--+-CONFIGURATION-+---------------------------------> +-CONFIG--------+ '-CFG-----------' >--+----------------------------------------------------------+->< '-FOR NODE--node-name--+---------------------------------+-' '-USER--username--USING--password-' UPDATE CLI CONFIGURATION This command updates the contents of a specified section in the db2cli.ini file.

The file is divided into sections with each section corresponding to a database alias name.

>>-UPDATE CLI--+-CONFIGURATION-+--+-----------------------+-----> +-CONFIG--------+ '-AT--+-GLOBAL-+--LEVEL-' '-CFG-----------' '-USER---' .---------------. V | >--FOR SECTION--section-name--USING----keyword value-+---------><

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-30 A Computer Education Techniques, Inc. Instructor-led course.

DB2 UDB Components and Concepts

(DSA1/1;2003.09) © Oakwood Computing Ltd Page 2-31 A Computer Education Techniques, Inc. Instructor-led course.

Parallel Architecture DB2 supports the following types of parallelism:

• I/O • Query • Utility

SET RUNTIME DEGREE This command sets the maximum run time degree of intra-partition parallelism for SQL statements for specified active applications.

This command affects all database partitions that are listed in the file: $HOME/sqllib/db2nodes.cfg >>-SET RUNTIME DEGREE FOR--+-ALL--------------------------+-----> | .-,------------------. | | V | | '-(----application-handle-+--)-' >--TO--degree--------------------------------------------------><

processors

SQLstatement

Parallel processing DSA-120