DB2 日常维护技巧,第 2 部分:实例和常用备份策略
2010-04-15 00:00:00 来源:WEB开发网正确的做法是在当前 DB2CLP 窗口中,发出 “ FORCE APPLICATIONS ALL ”命令,断开所有的数据库连接,再发出 “ db2dart sample /db ”命令,具体如清单 01-36 所示:
清单 5. 展示 DB2DART 命令如何使用
C:\> db2 force applications all
DB20000I FORCE APPLICATION 命令成功完成。
DB21024I 此命令为异步的,可能未能立即生效。
C:\> db2 list applications
SQL1611W “数据库系统监视器”没有返回任何数据。
C:\> db2dart sample /db The requested DB2DART processing has completed successfully!
Complete DB2DART report found in:
C:\DOCUME~1\ALLUSE~1\APPLIC~1\IBM\DB2\DB2COPY1\DB2\DART0000\SAMPLE.RPT
命令成功完成。 DB2DART 执行结果显示正常,如果有错误,会提示有 ERROR 存在,所有的结果都会存储在 SAMPLE.RPT 中。打开 SAMPLE.RPT 文件,可以看到数据库诊断的详细的信息,由于篇幅有限,本书只列示了部分信息,具体如清单 01-37 所示:
清单 6 . SAMPLE.RPT 文件部分输出结果
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - DART - - - - - - - - - - -
D a t a b a s e A n a l y s i s a n d R e p o r t i n g T o o l
IBM DB2 NT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DART ( V9.1 ) Report :
2008-04-02-23.28.24.531000
Database Name : SAMPLE
Report name : SAMPLE.RPT
Old report back-up : SAMPLE.BAK
Database Subdirectory : C:\DB2\NODE0000\SQL00002
Operational Mode : Database Inspection Only ( INSPECT )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Action option : DB
Connecting to Buffer Pool Services . . .
Database inspection phase start .
Tablespace file inspection phase start .
Loading tablespace files .
Inspecting next tablespace and associated containers .
Inspecting next tablespace and associated containers .
Inspecting next tablespace and associated containers .
Inspecting next tablespace and associated containers .
Inspecting next tablespace and associated containers .
Inspecting next tablespace and associated containers .
Inspecting next tablespace and associated containers .
7 tablespaces were identified and their containers checked .
Tablespace file inspection phase end .
SYSBOOT inspection phase start .
Data inspection phase start . Data obj : 1 In pool : 0
Data inspection phase end .
SYSBOOT inspection phase end .
SYSTABLES inspection phase start .
Data inspection phase start . Data obj : 5 In pool : 0
Data inspection phase end .
SYSTABLES inspection phase end .
Bufferpool file report phase start .
1 bufferpools were identified .
Bufferpool file report phase end .
Tablespace inspection phase start . Pool : 0
Tablespace-info inspection phase start .
Checking Table space ID : 0
Name = SYSCATSPACE
Extent size = 4
# of containers = 1
Container names :
C:\DB2\NODE0000\SAMPLE\T0000000\C0000000.CAT
Traversing extent map for object type : 0
Data inspection phase start . Data obj : 65535 In pool : 0
Data inspection phase end .
Traversing extent map for :
OTR ID : 4
Parent object ID = 1 pool ID = 0
For all table objects in tablespace : 0
DAT extent anchor : 12 , in pool : 0
Traversing extent map for object type : 0
Extent Map traversal complete .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
Table inspection end .
Tablespace inspection phase end .
Tablespace inspection phase start . Pool : 6
This is a temporary table space . Nothing to inspect .
Tablespace inspection phase end .
Database inspection phase end .
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The requested DB2DART processing has completed successfully !
All operation completed without error ;
no problems were detected in the database .
- - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - -
Complete DB2DART report found in :
C:\DOCUME~1\ALLUSE~1\APPLIC~1\IBM\DB2\DB2COPY1\DB2\DART0000\SAMPLE.RPT
- - - - - D A R T P R O C E S S I N G C O M P L E T E - - - - -
我们在日常维护数据库过程中,经常使用的 DB2DART 命令的选项主要有:
/DB ( 默认值 ) 检查整个数据库。
/T 检查单个表。
/TSF 只检查表空间文件和容器。
/TSC 检查一个表空间的结构,但不包含它所属的那些表。
/TS 检查一个单独的表空间和它所属的那些表。
而 INSPECT 命令类似于 DB2DART 命令,INSPECT 命令同样可以用来检查数据库、表空间和表。 INSPECT 命令和 DB2DART 命令的主要区别是,INSPECT 命令需要与数据库连接,并且可以在该数据库上同时有多个活动的数据库连接时执行,而 DB2DART 命令需要在执行之前取消激活数据库,数据库上不能有活动的数据库连接。关于这两个命令的具体区别,大家请参见 IBM 白皮书或查看 DB2 信息中心。
- ››db2 对float类型取char后显示科学计数法
- ››DB2中出现SQL1032N错误现象时的解决办法
- ››DB2 锁升级示例
- ››db2诊断系列之---定位锁等待问题
- ››db2 命令选项解释
- ››DB2 最佳实践: 使用 DB2 pureXML 管理 XML 数据的...
- ››DB2 9.5 SQL Procedure Developer 认证考试 735 准...
- ››DB2 9.5 SQL Procedure Developer 认证考试 735 准...
- ››DB2 9.5 SQL Procedure Developer 认证考试 735 准...
- ››DB2 基础: 表空间和缓冲池
- ››DB2 XML 编程,第 1 部分: 理解 XML 数据模型
- ››DB2 pureScale 实战
更多精彩
赞助商链接