IBM Innovation Center
DB2 基础
IBM Innovation Center
© 2008 IBM Corporation
IBM Innovation Center
DB2 家族
Full exploitation of ALL available resources
– Within a single query – Across separate queries
Regardless of resource class/amount
– I/O bandwidth, Main memory, Cache, – CPUs, Comm. bandwidth
Regardless of architecture
– Uni, SMP, NUMA, SMP Cluster, MPP
With Seamless Scalability
PC Server 320
PC Server 320
Massively Parallel Processor (MPP) and NUMA
PC Server 320
– Application transparency – No migration
PC Server 320
Cluster DB2 Enterprise with PDF DB2 Data Warehouse Base DB2 Warehouse Enterprise
SQL
Parallel Transaction
DB2 Everyplace (Mobility on Demand)
Uniprocessor DB2 Personal Edition DB2 Express DB2 ExpressC
Symmetric Multiprocessor (SMP) DB2 Workgroup DB2 Enterprise
CPU CPU CPU CPU
Parallel SQL
SQL CPU SQL CPU SQL CPU SQL CPU
© 2003 IBM Corporation
2
IBM Innovation Center
DB2 版本
– DB2 Everyplace
– DB2 Personal Edition (PE)
– DB2 Express-C – DB2 Express – DB2 Workgroup Edition (limited and unlimited) – DB2 Enterprise Edition – Data Enterprise Developer Edition (DEDE)
DB2 Clients
– DB2 Run Time Client – DB2 Client – Java Common Client (JCC) – DB2 Client Lite
3
© 2003 IBM Corporation
IBM Innovation Center
DB2版本
DB2 Everyplace
– Small footprint (less than 200 KB) for small devices – Allows mobile workers to access DB2 data sources through handheld devices and a synchronization server to replicate data in both directions – Application development tool to build handheld apps with drag-and-drop ease
DB2 Personal Edition (PE)
– A fully functional database for personal computers on Linux and Windows – Has all features of DB2 Express, but does not support connectivity to act as database server for remote clients but provides client for other DB2 servers – Audio, Image, Spatial and Video Extenders (single user) – For example, you can use DB2 PE to develop DB2 applications and rolling them out into a production environment on DB2 ESE V9, e.g. on AIX.
4 © 2003 IBM Corporation
IBM Innovation Center
DB2版本(continued)
DB2 Express Edition (DB2 Express)
– Priced for small & medium business – supports up to 2 CPUs – Linux and Windows only – Same functions as DB2 Workgroup Edition, but different by the amount and value unit (which equate to the power of a server‘s processor cores) you can have on a server. E.g.
• • • • Automates administration adaptive memory allocation, automatic storage management Keeps data protected and available 24/7 Cuts costs with unique workload management capabilities Powers the next generation of agile SOA applications with pureXML™
DB2 Express-C
– Freely licensed version for developers and community – 64-bit enabled – Minus some extended features of EE:
• • •
5
HADR Replication Data Capture 24x7 Passport Advantage support model
© 2003 IBM Corporation
IBM Innovation Center
DB2版本(continued)
DB2 Workgroup Server Edition (WSE)
– Authorized User (Min. 5 per Server), or Per Processor – Net Search & Spatial Extender (5 user limit) – For low user departmental machines using up to 4 CPUs
DB2 Workgroup Server Unlimited Edition (WSUE)
– – – – – Per Processor Licensing Ideal for high user or web use Up to 4 CPUs Audio, Image, and Video Extenders Net Search and Spatial Extenders are optional
DB2 Workgroup Highlights
– Powers the next generation of agile SOA applications with pureXML™ – Minimizes costs with adaptive memory allocation, automatic storage management and more – Maximizes data availability by reducing planned and unplanned downtime – Cuts costs with unique workload management capabilities – Speeds performance of complex query workloads
6 © 2003 IBM Corporation
IBM Innovation Center
DB2版本(continued)
DB2 Enterprise Server Edition (ESE)
– Authorized User (Min. 25 per CPU) or Per Processor – Ideal for enterprise environments
• CRM, ERP, SCM, Data Warehouses
– Includes Host Database Connectivity – Informix Integration
– Options Available:
• • • • • • • • Database Partitioning Feature (DPF) Reduces storage needs by up to 80% using industry unique data compression capabilities Powers the next generation of agile SOA applications with pureXML™ Reduces risk of unauthorized access with an innovative label based security model Avoids unexpected performance problems with proactive query management and predictive analysis Minimizes costs with adaptive memory allocation, automatic storage management and more Scales with your preferred architecture: single-server, clusters of servers, or both with database partitioning and table partitioning Maximizes data availability by reducing planned and unplanned downtime
7
© 2003 IBM Corporation
IBM Innovation Center
哪个 DB2 9 data server 适合你?
DB2 Express
Customizable
Expandable with pureXML and optional enterprise class features to preserve improve performance, workload management, and high availability
DB2 Workgroup
Expandable with pureXML and optional enterprise class features to preserve improve performance, workload management, and high availability 4 CPUs / 16 GB RAM maximum
DB2 Enterprise
Expandable with pureXML and advanced features like storage optimization, performance optimization, advanced access control, scale-out clustering, geodetic data, and more
Scalable
2 CPUs / 4 GB RAM max. (may run on machines with more than 4 GB) Linux®, Solaris x86 and Windows®
Unlimited
Platforms
Linux, UNIX® and Windows
Linux, UNIX and Windows
Pricing Metrics
Authorized User (Min 5 per server), or Per Processor
Authorized User (Min. 5 per Server), or Per Processor
(Authorized User (Min. 25 per CPU) or Per Processor
8
© 2003 IBM Corporation
IBM Innovation Center
DB2 家族平台支持
ESE
ESE + DPF
Enterprise Server Edition
Personal Edition
Personal & Express
ƒ Windows ƒ Linux ƒ Solaris
Workgroup
ƒ ƒ ƒ ƒ ƒ AIX HP-UX Solaris Windows Linux
ƒ ƒ ƒ ƒ ƒ
AIX HP-UX Solaris Windows Linux
Everyplace
ƒ ƒ ƒ ƒ ƒ Pocket PC Linux PalmOS QNX Neutrino Symbian EPOC
Hosts
ƒ DB2 for i5/OS ƒ DB2 z/OS ƒ DB2 VM/VSE
9
© 2003 IBM Corporation
IBM Innovation Center
DB2 客户端软件
DB2 Run-Time Client
– Best option if your only requirements are to enable applications to access DB2 9 data servers. They provide the APIs necessary to perform this task, including Java Common Client – Comes with no management tools
DB2 Client
– Includes runtime client – Provides tools to administer DB2 servers and libraries to develop applications that access DB2 servers
Java Common Client
– 2 MB fully redistributable client – provides JDBC and SQLJ applications access to DB2 data servers without installing and maintaining DB2 client code – Use the DB2 Connect product for connecting to a DB2 for System i or DB2 for System z data server
DB2 Client Lite
– Small footprint – Provides similar functions as the JCC client and is used for CLI/ODBC applications. – Especially well suited for ISVs that want to embed connectivity in their applications without redistributing and maintaining DB2 client code.
10 © 2003 IBM Corporation
IBM Innovation Center
Getting Started
Product Installation
DB2 Instances
DB2 Environment Tools System Catalog
11
© 2003 IBM Corporation
IBM Innovation Center
DB2 UDB for Linux, UNIX, and Windows的安装
12
© 2003 IBM Corporation
IBM Innovation Center
保存安装设置在响应文件
13
© 2003 IBM Corporation
IBM Innovation Center
Userid for DB2 Administration Server
14
© 2003 IBM Corporation
IBM Innovation Center
DB2 工具目录
REGULAR SYSTEM TEMPORARY
CREATE TOOLS CATALOG
15
© 2003 IBM Corporation
IBM Innovation Center
联系人列表和通知
16
© 2003 IBM Corporation
IBM Innovation Center
.NET支持,必须先安装Visual Studio 2005
17
© 2003 IBM Corporation
IBM Innovation Center
Getting Started : SAMPLE 数据库 (db2sampl)
18
© 2003 IBM Corporation
IBM Innovation Center
Getting Started
Product Installation
DB2 Instances
DB2 Environment Tools System Catalog
19
© 2003 IBM Corporation
IBM Innovation Center
DB2 实例 instance
DB2 instance是DB2命令和函数执行的环境 也是DB2 database manager
一个以上的实例可以安装在一个服务器上,每个实例可 以独立的运作
启动一个 instance
–db2start
终止所有的数据库连接停止一个instance
–db2stop [force]
20
© 2003 IBM Corporation
IBM Innovation Center
创建和删除 DB2 Instances
安装时默认创建一个实例
– db2inst1 (UNIX and Linux) – DB2 (Windows)
创建其他的实例
– db2icrt -u
• 必须创建特殊的“fenced” user id for UNIX and Linux platforms
– db2icrt
• for Windows platforms
终止所有的数据库连接删除一个instance
– db2idrop -f
列出服务器上安装的实例
– db2ilist
21 © 2003 IBM Corporation
IBM Innovation Center
更新DB2 Instances
在安装或移除一些产品项目或补丁包之后需要更新DB2实例
– db2iupdt
在创建、删除、更新和移植DB2实例时需要root或管理员的权限
22
© 2003 IBM Corporation
IBM Innovation Center
Getting Started
Product Installation
DB2 Instances
DB2 Environment Tools System Catalog
23
© 2003 IBM Corporation
IBM Innovation Center
DB2 环境
配置 DB2 环境:
– DB2 注册表 DB2 profile registry – 操作系统环境变量 – DB2 Database Manager 配置参数 – DB2 Database 配置参数
Server machine
OS environment variables
Instance
database manager configuration file
dbm cfg
Database
db2 registry
new features, platform dependent optimizations special optimizations database configuration file
db cfg
24
© 2003 IBM Corporation
IBM Innovation Center
DB2注册表(1)
DB2注册表与windows注册表无关 DB2注册表集中控制存储大部分DB2环境设置项 平台特性通常记录在DB2注册表中 在更改DB2注册表项目值之后不必重启操作系统,但是 需要停止并重启实例
在不同的级别控制DB2 UDB environment的许多属性
25
© 2003 IBM Corporation
IBM Innovation Center
DB2注册表(2)
列表出DB2注册变量当前值
– db2set -all
列表出全局注册变量
– db2set -g
列表出实例注册变量
– db2set -i
列表出所有注册变量
– db2set -lr
设置DB2注册变量值
– db2set =
• e.g. db2set DB2COMM=TCPIP
– Restart实例应用改变
26 © 2003 IBM Corporation
IBM Innovation Center
用DB2配置助手显示DB2注册表变量
27
© 2003 IBM Corporation
IBM Innovation Center
DB2配置助手 db2ca
28
© 2003 IBM Corporation
IBM Innovation Center
操作系统环境变量
多数的环境变量由DB2注册表控制并存储,没有存在DB2注册表 的作为系统变量,在本地系统存储和设置: – Windows-控制面板-> 系统 -> 环境 变量 – UNIX - .profile or .kshrc or .cshrc, 他们被整合到 db2profile (Bourne or Korn shell) or db2cshrc (C shell) 在实例owner的 home/instname/ SQLLIB路径下 Examples: – Windows - set DB2INSTANCE=PROD – UNIX - export DB2INSTANCE=PROD
29
© 2003 IBM Corporation
IBM Innovation Center
设置 DB2 环境变量
Environment Variables
Windows UNIX LINUX
Platform Specific
用 db2set 命令改变设置.
Instance-Level Registry Variables
一些注册信息需要重启 实例为了安全起见建议 在更改注册信息后重启 实例
Global-Level Registry Variables
30 © 2003 IBM Corporation
IBM Innovation Center
DB2数据库和数据库管理器配置参数
Get/Set/Reset the Database Manager Configuration
– GET DBM CFG [SHOW DETAIL]
• show detail displays current and delayed values
– UPDATE DBM CFG USING
– RESET DBM CFG
Get/Set/Reset the Database Configuration
– GET DB CFG FOR [SHOW DETAIL]
• show detail displays current and delayed values
– UPDATE DB CFG FOR USING – RESET DB CFG FOR
DB2 Control Center can be used to display, update, and reset the DBM and DB configuration parameters
31
© 2003 IBM Corporation
IBM Innovation Center
Display DBM Configuration Parameters with DB2CC
32
© 2003 IBM Corporation
IBM Innovation Center
Getting Started
Product Installation
DB2 Instances
DB2 Environment Tools System Catalog
33
© 2003 IBM Corporation
IBM Innovation Center
DB2 Command Window (Windows Only)
DB2 命令行窗口 (Windows Only) – 从菜单中的:命令行工具-命令行窗口进入 – 在db2命令和SQL语句前加上'db2'
• e.g. db2 connect to sample • e.g. db2 "select * from employee" • e.g. db2 -tvf createtab.db2
– 结束命令行模式和后台处理输入db2 terminate – DB2 命令行窗口可以延用所有OS本来拥有的命令
34
© 2003 IBM Corporation
IBM Innovation Center
DB2命令行处理器(CLP)
从菜单中的:命令行工具-命令行处理器或者在DB2命令行窗口输 入 db2命令进入命令行处理器 Db2交互方式显示为:
– db2 =>
不必在命令前上前缀 'db2'
– e.g. db2 => connect to sample
结束交互方式输入 quit
结束命令行模式和后台处理输入db2 terminate
执行操作系统命令,输入 !
35
© 2003 IBM Corporation
IBM Innovation Center
Command Line Options
db2 list command options UPDATE COMMAND OPTIONS USING z ON
36
© 2003 IBM Corporation
IBM Innovation Center
Getting Help
获取DB2命令的语法和信息 – db2 ? – db2 ? – db2 ? Sqlnnnn – db2 ? db2nnnn For example: – db2 ? catalog tcpip
CATALOG [ADMIN] TCPIP NODE node-name REMOTE hostname [SERVER service-name] [SECURITY {SOCKS}] [REMOTE_INSTANCE instance-name] [SYSTEM system-name] [OSTYPE os-type] [WITH "comment string"]
list of all DB2 commands get syntax help for a specific command get message and brief description of a specific SQLCODE get message and brief description of a DB2 error code
37
© 2003 IBM Corporation
IBM Innovation Center
DB2 GUI Tools
控制中心 – Central point of administration
任务中心
– Central point for scheduling database jobs 运行状况中心 – Central point for DB2 Health Monitoring – Memory Visualizer 配置助手 – Tool to configure the client
命令编辑器
– GUI wrapper for command line processor (CLP) 日志 – Central point for logging DB2 Activities 许可证中心 – Central point of DB2 license management DB2 Developer Workbench – Central point for developing
– A light-weight version of the Control Center
复制中心 – A GUI tool to set up and administer a replication environment and to run the Capture and Apply programs
© 2003 IBM Corporation
38
IBM Innovation Center
DB2 Administration Server (DAS)
管理实例的后台处理机制
– db2as on UNIX and Linux (default)
– DB2DAS service on Windows (default) 支持DB2工具例如:控制中心、配置助手、运行状况中心、开发 中心的服务 一些 DAS 命令: – db2admin create – db2admin (to obtain the name of the DAS on the machine) – db2admin start
– db2admin stop
– db2 get admin cfg – db2 update admin cfg using
39 © 2003 IBM Corporation
IBM Innovation Center
Getting Started
Product Installation
DB2 Instances
DB2 Environment Tools System Catalog
40
© 2003 IBM Corporation
IBM Innovation Center
Roadmap to Catalog Tables (1)
Schema:
TABLE
SYSDBAUTH SYSCHECKS SYSCOLUMNS SYSCOLCHECKS SYSCOLDIST SYSKEYCOLUSE SYSCONSTDEP SYSDATATYPES SYSEVENTMONITORS SYSEVENTS SYSFUNCPARMS SYSFUNCTIONS SYSINDEXAUTH SYSINDEXES
Table = SYSIBM
VIEW
DBAUTH CHECKS COLUMNS COLCHECKS COLDIST KEYCOLUSE CONSTDEP DATATYPES EVENTMONITORS EVENTS FUNCPARMS FUNCTIONS INDEXAUTH INDEXES
View = SYSCAT
DESCRIPTION
Authorities on database Check constraints Column definitions Columns referenced by check constraints Detailed columns statistics Columns used in keys Constraint dependencies Datatype definitions (built-in & UDT) Event Monitor Definitions Events currently monitored Definitions of Parameters/Results of UDFs UDF definitions Index privileges Index definitions
41
© 2003 IBM Corporation
IBM Innovation Center
Roadmap to Catalog Tables (2)
Schema: Table = SYSIBM View = SYSCAT
TABLE
SYSPACKAGEAUTH SYSPACKAGEDEP SYSPACKAGES SYSREFERENCES SYSSTATEMENTS SYSTABAUTH SYSTABCONST SYSTABLES SYSTABLESPACES SYSTRIGDEP SYSTRIGGERS SYSVIEWDEP SYSVIEWS
VIEW
PACKAGEAUTH PACKAGEDEP PACKAGES REFERENCES STATEMENTS TABAUTH TABCONST TABLES TABLESPACES TRIGDEPEVENTS TRIGGERS VIEWDEP VIEWS
DESCRIPTION
Authorities on packages Package dependencies Package definitions Referential constraints definitions Details of package SQL Statements Table Authorities Table constraint definitions Table definitions Table Space Definitions Trigger dependencies Definitions of triggers View dependencies View definitions
42
© 2003 IBM Corporation
IBM Innovation Center
Getting Connected
客户端连接性和目录编制
实例的附加和数据库连接
43
© 2003 IBM Corporation
IBM Innovation Center
DB2 Client / Server Environment
DB2 Runtime Client DB2 Client
TCPIP or NPIPE
DB2 Server Local Client DB2 Connect for Host Connectivity
DB2 data
UNIX, Windows, or Linux
DB2/MVS
AS/400
DRDA
DB2/VSE & VM
DRDA DB2 Connect
DB2 Connect
S/390
Non-IBM RDBMS
DB2/400 RDBMS
44
© 2003 IBM Corporation
IBM Innovation Center
Preparing the Server for DB2 Remote Connections
DBA 必须确保服务器端通讯设置正确 Step 1: – 开启实例通讯支持,设置 DB2 注册表变量
• db2set DB2COMM=TCPIP,NPIPE
Step 2: – Set the protocol information in database manager configuration, for TCPIP:
• db2 update dbm cfg using svcename 50000 or • db2 update dbm cfg using svcename db2icdb2 • Update /etc/services with the service name and port number
– db2icdb2 50000/tcp
Step 3: – db2stop and db2start instance after changes to database manager configuration
45
© 2003 IBM Corporation
IBM Innovation Center
DB2 发现
Search and locate DB2 servers on the network
Two methods: Known and Search
Requires DAS running and enabled to be discovered on the DB2 servers Can prevent or "hide" a server / database from being discovered
46
© 2003 IBM Corporation
IBM Innovation Center
Discovery Example
DB UDB Clien 2 t
D co e M s g is v ry e sa e
DB UDB S 2 erve r D B2 A dm istra n S rve L el in tio e r ev D C V R= S A C IS O E E R H
DISCOVER=DISABLE does not allow the machine to be seen during a client search
In nce Le l sta ve D C V R IN T = D A L IS O E _ S IS B E D C V R IN T = E A L IS O E _ S N BE
D ata se Le l ba ve D C V R D =D A L IS O E _ B IS B E D C V R D =E A L IS O E _ B NB E
47
© 2003 IBM Corporation
IBM Innovation Center
用 DB2 配置助手 (1)
48
© 2003 IBM Corporation
IBM Innovation Center
用 DB2 配置助手(2)
49
© 2003 IBM Corporation
IBM Innovation Center
使用Access Profiles概要文件
帮助客户端自动进行配置
Access profiles包含客户端需要从DB2 server中获取数据库目录 的信息
两种类型的 Access Profiles:
– Server Access Profile generated on a UDB server
• 含有所有在server上的实例和数据库的信息
– Client Access Profile generated on a client
• 用于拷贝客户端的目录编制信息到其他多个客户端
50
© 2003 IBM Corporation
IBM Innovation Center
导出 Access Profile
51
© 2003 IBM Corporation
IBM Innovation Center
Example of Access Profile
[FILE_DESCRIPTION] APPLICATION=DB2/NT 8.1.0 FILE_CONTENT=DB2 CCA Exported Data Sources FILE_TYPE=CommonServer FILE_FORMAT_VERSION=2.0 Platform=5 [INST>DB2] DB2SYSTEM=CLARALIU instance_name=DB2 Instance=DB2 NodeType=4 ServerType=DB2NT [REGISTRY_GLOBAL] Authentication=SERVER DB2_GRP_LOOKUP=LOCAL DB2COMM=TCPIP DB2INSTDEF=DB2
[REGISTRY_LOCAL] DB2ACCOUNTNAME=CLARALIU\db2admin DB2INSTOWNER=CLARALIU DB2PORTRANGE=60000:60003 DB2_GRP_LOOKUP=LOCAL DB2COMM=TCPIP [DB>!LOCAL:SAMPLE] Dir_entry_type=INDIRECT Drive=C:\DB2 DBName=SAMPLE
52
© 2003 IBM Corporation
IBM Innovation Center
Importing Access Profile
53
© 2003 IBM Corporation
IBM Innovation Center
Manual Client/Server Configuration
54
© 2003 IBM Corporation
IBM Innovation Center
Configure Client Connectivity via Commands
Catalog NODE
– Catalog each instance on DB2 UDB Server
– Specific command for each supported communication protocol
– Examples:
CATALOG TCPIP NODE mynode REMOTE server1 SERVER 50000
Catalog DATABASE
– Catalogs each database on DB2 UDB Server and instance – Works for local and remote databases – Example:
CATALOG DATABASE sample AS mysamp AT NODE mynode
55
© 2003 IBM Corporation
IBM Innovation Center
The Node Directory
LIST NODE DIRECTORY
56
© 2003 IBM Corporation
IBM Innovation Center
The Database Directory
LIST DATABASE DIRECTORY
57
© 2003 IBM Corporation
IBM Innovation Center
The Local Database Directory
Obtain list of local databases created on a drive or mount point
LIST DB DIRECTORY ON c:
58
© 2003 IBM Corporation
IBM Innovation Center
DB2 Client Connectivity
All databases appear LOCAL to applications
Node and DB directories abstract away real location of database Each remote database points to a node Each node points to an remote instance
Platform transparent
app1
DB2 Client Machine
db directory node directory
host2 (nt)
hr ops
db2instx db2inst1 db2inst3
hr
app2 app3
network
db2instx
mkt sales
host1 (AIX)
operations
marketing
sales
db2inst1
db2inst3
59
© 2003 IBM Corporation
IBM Innovation Center
This Chapter’s Agenda
Client Connectivity and Cataloging
Instance Attachment and Database Connection
60
© 2003 IBM Corporation
IBM Innovation Center
Instance Attachment vs. Database Connection
INSTANCE ATTACHMENT
– create/drop databases – get/update/reset database manager and database configuration file or show detail option – database monitor – backup/restore/roll forward database – force application DATABASE CONNECTION – DML, DDL, DCL
– precompile/bind applications
– load/export/import – show detail option of db2 get cfg
61
© 2003 IBM Corporation
IBM Innovation Center
ATTACH and CONNECT Commands
INSTANCE ATTACHMENT – Implicit (for local instances only):
• DB2INSTANCE= • Environment Variable
– Explicit (for local and remote instances):
• ATTACH TO nodename [USER ... USING...] • Nodename is important
DATABASE CONNECTION – Implicit:
• DB2 Profile variable set with db2set command • db2set DB2DBDFT=
– Explicit:
• CONNECT TO db-alias [USER ... USING... ] NEW CONFIRM
62
© 2003 IBM Corporation
IBM Innovation Center
Remote Administration - ATTACH
Attach to a node that has been cataloged in the DB2 node directory
For example: – ATTACH TO db2instx USER db2admin USING passwd – RESTORE DATABASE hr FROM /db2/backup REPLACE EXISTING – DETACH User ID and password are required if the node is a remote node
DB2 Client Machine
db directory node directory
host2 (nt)
app1
hr ops
db2instx db2inst1 db2inst3
hr
app2 app3
network
db2instx
mkt sales
host1 (AIX)
operations
marketing
sales
db2inst1
db2inst3
63
© 2003 IBM Corporation
IBM Innovation Center
Attach to an instance using DB2 Control Center
64
© 2003 IBM Corporation
IBM Innovation Center
Connect to a Database
Connect to a database that has been cataloged in the DB2 database directory Example:
– CONNECT TO sample USER db2admin USING passwd – INSERT INTO testtab VALUES (1, 'DB2') – CONNECT RESET
User ID and password are required if database is on a remote server
To find out currently connected database, use one of the following commands:
– GET CONNECTION STATE Database Connection State Connection state Connection mode Database name 1 -----------------TOOLSDB 1 record(s) selected.
65 © 2003 IBM Corporation
= Connectable and Connected = SHARE = SAMPLE = SAMPLE
Local database alias – VALUES CURRENT SERVER
Special Register
IBM Innovation Center
Some Useful Commands
LIST APPLICATIONS [SHOW DETAIL]
– Shows all current connections made to any databases defined within an instance
Auth Id Application Appl. Application Id DB # of Name Handle Name Agents -------- ---------------------------- ---------- --------------------------------------------- -------------- ---------CLARALIU db2bp.exe 7 *LOCAL.DB2.00E000150926 SAMPLE 1 CLARALIU db2bp.exe 6 *LOCAL.DB2.00F1C0150335 SAMPLE 1 DB2ADMIN db2dasstm.exe 5 *LOCAL.DB2.005A40134734 TOOLSDB 1 DB2ADMIN db2dasstm.exe 4 *LOCAL.DB2.005A40134733 TOOLSDB 1
FORCE APPLICATION ALL
– Disconnect all connections made to any databases defined within an instance
FORCE APPLICATION (h1 [,h2,..hn])
– Selectively disconnect applications by the application handle identifier
GET INSTANCE
– retrieve your current instance context
The current database manager instance is: DB2
66
© 2003 IBM Corporation