ITPub博客

首页 > Linux操作系统 > Linux操作系统 > DB2学习笔记(3)

DB2学习笔记(3)

原创 Linux操作系统 作者:db-guru 时间:2010-12-31 21:22:34 0 删除 编辑

 

 

今天在新建的数据库实例db2inst下创建了两个数据库,sshdb1和sshdb2,自己采用人工存储管理的方式,指定catalog、user和temp表空间的数据文件。这次是采用db2cc(control

Center)来做了,这里指出db2一个不太人性化的地方,明确的知道catalog表空间不可能太小,否则数据库创建不成功,但是db2cc所有的container默认都是20m,害的我一路next下去,最终以报错结束,修改这个catalog表空间的container到300m,数据库正常建立起来了。

 

在不停的折腾中大致对DB2的模型有了一定的感性认识,安装完软件后,实例用户名下是不会有任何文件,只有使用db2icrt创建实例后,才会出现一个名字叫做sqllib的目录,这里面包含了大量的文件和信息,比如dba最关心的db2diag.log就在db2dump目录下,当然db2的log机制比oracle有些复杂,这是后话。

 

然后我在这个实例的用户家目录下创建了一个目录database,在这个目录下,创建了sshdb1和sshdb2,然后所有的数据文件,也就是ibm宣称的container放到相关的目录下

 

发现IBM在建立空间数据文件外,还会在目录下创建一个名字和实例名相同的目录,在我的系统下就是db2inst了,这个目录下有一个子目录,叫做NODE0000,据说和分区数据库相关,因为我这个数据库不是分区数据库,所以恒定为0000,当然还有两个子目录SQL00001和sqldbdir,特别是sqldbdir其实里面就是三个数据文件,db2dbbak这个不知道是否和db2备份相关,刚开始学习,本着不求甚解的方式,待到系统的学习完成,再回首一下,应该其义自见了,还有个文件叫做sqldbdir,好像就是这个db2实例的路径,还有一个文件是sqldbins,好像是安装目录,指向之前的那个SQL0001的路径,呵呵,先理解到这里,后面再说吧:)

 

然后对照资料看了点DB2的底层组件介绍,简单记录一下

2010-12-31-15.29.54.184781+480 I129805E456         LEVEL: Warning

PID     : 1582                 TID  : 47372562327872PROC : db2wdog 0

INSTANCE: db2inst              NODE : 000

EDUID   : 2                    EDUNAME: db2wdog 0

FUNCTION: DB2 UDB, routine_infrastructure, sqlerKillAllFmps, probe:5

MESSAGE : Bringing down all db2fmp processes as part of db2stop

DATA #1 : Hexdump, 4 bytes

0x00002B15C8BFC470 : 0000 0000                         

 

FUNCTION: DB2 UDB, routine_infrastructure, sqlerKillAllFmps, probe:5 这句话的日志格式一般为

Function: product,component,function and probe number

 

sqlerKillAllFmps 对于这类function需要特别注意第4个字符,这个的e表示database engine,数据库引擎,其他厂家的如下

 

b     buffer pool management

c     communications between clients

d     data management

e     database engine process

o     opeartion system calls

p     data protection such as locking and logging

r     relational database services

x     indexing opeartions

 

 

OSS组件

 

Operating System Services,对应的DB2内部组件为component = SQLO,负责db2和操作系统之间的工作交互

       内存管理

              对外提供三种抽象的内存资源

                     Memory sets

                     Memory pools

                     Memory blocks

       IO管理

                     RAW devices

                     Filesystem

       进程和线程管理

                     多线程

                     多进程

       信号量管理

                     IPC

       安全认证  DB2数据库的用户管理与Informix类似,采用操作系统认证的方式

       错误日志输出  OSS组件通过db2syslog将日志输出到操作系统的日志文件,需要配置syslog.conf启用该进程

相关错误可以从Linux如下位置找到错误信息的定义

/usr/include/asm-generic/errno.h

 

#include

 

#define EDEADLK         35      /* Resource deadlock would occur */

#define ENAMETOOLONG    36      /* File name too long */

#define ENOLCK          37      /* No record locks available */

#define ENOSYS          38      /* Function not implemented */

#define ENOTEMPTY       39      /* Directory not empty */

#define ELOOP           40      /* Too many symbolic links encountered */

#define EWOULDBLOCK     EAGAIN  /* Operation would block */

#define ENOMSG          42      /* No message of desired type */

#define EIDRM           43      /* Identifier removed */

#define ECHRNG          44      /* Channel number out of range */

#define EL2NSYNC        45      /* Level 2 not synchronized */

#define EL3HLT          46      /* Level 3 halted */

#define EL3RST          47      /* Level 3 reset */

 

Memory Optimizer组件

       Component = SQMO

       根据实例的共享内存 instance_memory、数据库全局内存database_memory和应用全局内存appl_memory参数设置和内存使用情况自动在内存之间进行内存平衡

 

BSU组件

       Base Services Utilities  component=SQLE,整个DB2的进程模型是由BSU控制的,BSU为实例和数据库分配内存,拦截和处理信号,并处理发送到db2的异常。

       数据库引擎,在db2启动的时候启动所有相关的进程、线程和其他相关的EDU

[db2inst@db2host asm-generic]$ db2 ? sql1225

 

 

SQL1225N  The request failed because an operating system process,

      thread, or swap space limit was reached.

 

Explanation:

 

An operating system process, thread, or swap space limit was reached.

You can find more information about the problem in the administration

notification log. On AIX systems, the maxuproc value might be too low.

 

User response:

 

Check the administration notification log to determine which limit was

reached and increase that limit.

 

 sqlcode: -1225

 

 sqlstate: 57049

 

 

CCI组件  Commen Client

       Component = SQLC 主要处理通信协议,通过DRDA实现。主要包含以下几类

       C运行时组件:主要为ODBC,CLI和OLE优化,对应的组件为SQLAC

       TYPE4的java驱动组件:对应的组件为SQLJC

       TYPE2的java驱动组件

 

RDS组件

       关系数据服务组件Relation Data Services RDS  component=SQLR

       这样的组件通常被CCI客户端函数唤醒

              用于优化和处理SQL语句

              构造查询访问计划

DMS组件

       数据管理服务DMS  component = SQLD 主要用于处理并返回数据,DMS从RDS获得查询计划并按照查询计划获得相应的数据集,DMS组件也会使用索引管理器来处理索引扫描,使用排序列表服务组件SLS(Sort List Services)来处理排序,使用文件管理器来处理数据连接

[db2inst@db2host asm-generic]$ db2diag -rc 0xFFFF8957

 

Input ECF string '0xFFFF8957' parsed as 0xFFFF8957 (-30377).

NOTE: /view/db2_cobra_linuxamd64_s090521/vbs/engn/pd/../sqz/sqlzwhatisrc.C:

        V7 input ZRC 0xFFFF8957 (-30377) may translate to V8 ZRC value of 0x80090057 (-2146893737)

 

ZRC value to map: 0x80090057 (-2146893737)

        V7 Equivalent ZRC value: 0xFFFF8957 (-30377)

 

ZRC class :

        SQL Error, User Error,... (Class Index: 0)

Component:

        SQLI ; index manager (Component Index: 9)

Reason Code:

        87 (0x0057)

 

Identifer:

        SQLI_CRI_DUPKEY

Identifer (without component):

        SQLZ_RC_CRI_DUPKEY

 

Description:

        Duplicate key in index create

 

Associated information:

        Sqlcode -603

SQL0603N  A unique index cannot be created because the table contains data that

would result in duplicate index entries.

 

        Number of sqlca tokens : 0

        Diaglog message number: 1

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25037908/viewspace-683091/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: db2学习笔记(2)
下一篇: DB2学习笔记(4)
请登录后发表评论 登录
全部评论

注册时间:2010-12-05

  • 博文量
    8
  • 访问量
    19396