[DB2 学习记录]2. DB2 工具

来源:互联网 发布:淘宝app改评价 编辑:程序博客网 时间:2024/04/28 04:10
DB2 工具
两大类:
Control Center(CC),    主要用来管理 DB2 服务器。
Configuration Assistant(CA),    用来设置客户机/服务器通信和维护注册表变量等等。   
   
任何 DB2 工具中都应该能够找到 6 种基本特性:
Wizards
Generate DDL 
Show SQL/Show Command
Show Related
Filter
Help

两个主要Advisor
Configuration Advisor , 创建DB时可以给出参数建议。
Design Advisor 结合 Self Tuning Memory Manager(STMM)可以诊断调优。

数据转移进新的数据库对象,可以使用传统的 LOAD 或 IMPORT 实用程序,或 db2move 命令。
db2move 查询特定数据库的系统编目表并编译所有用户表的列表,然后以 PC/IXF 格式导出这些表。

DB2 Command Line Processor(DB2 CLP)是所有 DB2 产品中都有的,
可以用来运行DB2 命令、操作系统命令或 SQL 语句.
DB2 Command Windows(DB2 CW)
对于除 Windows 之外的所有操作系统,DB2 CW 是在操作系统的本机 CLP 中内置的。
在 Windows 环境中,需要命令提示中输入db2cmd 命令来启动 DB2 CW,然后才能跑db2命令。

DB2 CLP 的命令行选项, 会影响输入的语句和命令的行为方式,包括一下几点:
>db2 list command options
     Command Line Processor Option Settings
 Backend process wait time (seconds)        (DB2BQTIME) = 1
 No. of retries to connect to backend        (DB2BQTRY) = 60
 Request queue wait time (seconds)          (DB2RQTIME) = 5
 Input queue wait time (seconds)            (DB2IQTIME) = 5
 Command options                           (DB2OPTIONS) =
 Option  Description                               Current Setting
 ------  ----------------------------------------  ---------------
   -a    Display SQLCA                             OFF
   -c    Auto-Commit                               ON
   -d    Retrieve and display XML declarations     OFF
   -e    Display SQLCODE/SQLSTATE                  OFF
   -f    Read from input file                      OFF
   -i    Display XML data with indentation         OFF
   -l    Log commands in history file              OFF
   -m    Display the number of rows affected       OFF
   -n    Remove new line character                 OFF
   -o    Display output                            ON
   -p    Display interactive input prompt          ON
   -q    Preserve whitespaces & linefeeds          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 messages     ON
   -x    Suppress printing of column headings      OFF
   -z    Save all output to output file            OFF

-代表开,- - 或+ 代表关,如:
db2 -c command or statement...  开Auto-Commit
db2 -c- command or statement... 关Auto-Commit
db2 +c command or statement...  关Auto-Commit

续行字符是(/)
如果有特殊字符,需要加双引号。
db2 CW中,
db2 "select * from staff where dept > 10"
db2 select * from staff where dept > 10
当然在db2 clp里就不用了。

db2ca  启动Configuration Assistant
操作现有的数据库、添加新数据库、绑定应用程序、设置客户机配置和注册表参数(如上所示)以及导入和导出配置文件

db2cc  启动Control Center,里面还可以选取到其他一些工具,通常的就不列了。
DB2 Satellite Administration Center
使用 Satellite Administration Center(DB2 SAC)来设置和管理执行同样业务功能的 DB2 服务器组。
这些服务器称为卫星,它们都运行同一个应用程序并采用同样的 DB2 配置(数据库定义)来支持这个应用程序。
可以使用 DB2 SAC 让几个 DB2 数据服务器利用一个主服务器来同步和维护它们的配置和数据

db2hc  启动DB2 Health Center , 健康性检查。
DB2 Journal显示关于任务、数据库活动和操作、Control Center 操作、消息、出现的健康状态警报等等的历史信息

SnapshotEvent Monitor, 监控系统.
DB2 Governor 可以监视针对数据库运行的应用程序的行为
DB2 Developer Workbench DB2 9 一个集成开发环境(IDE)(DB2 DWB).
Memory Visualizer
这个工具监视的高层内存成分包括:数据库管理程序共享的内存、数据库全局内存、应用程序全局内存、代理/应用程序共享的内存和代理私有内存。每个高层成分划分为低层成分,这些成分决定内存如何分配和释放。
db2indbt启动 In-doubt Transaction Monitor 帮助 DBA 处理处于 in-doubt 状态的全局事务。 
Activity Monitor可以帮助监视应用程序性能、应用程序并发性、资源消耗和 SQL 语句的使用情况,对LOCK应该有帮助。
原创粉丝点击