DB2如何安装实例数据库和TOLLSDB数据库

数据库 数据库运维
本文将讨论的是DB2如何安装实例数据库和TOLLSDB数据库,包括一些错误信息,希望对广大DBA有所帮助。

安装完成后,欲登陆sample数据库和toolsdb,发现出错:

  1. db2 => connect to sample  
  2. SQL1031N The database directory cannot be found on the indicated file system.  
  3. db2 => connect to toolsdb  
  4. SQL1031N The database directory cannot be found on the indicated file system. 

1、 猜想数据库未安装,查看/hom/db2inst1目录下的,仅有sqllib文件夹:

  1. [db2inst1@localhost ~]$ ls  
  2. sqllib 

对比下其他学员的情况,发现本人的服务器上少了一个db2inst1目录:

  1. [db2inst1@localhost ~]$ ls  
  2. b2inst1 sqllib 

2、下面手动对两个数据库进行创建:

2.1、创建示例数据库:

  1. [db2inst1@localhost ~]$ db2sampl  
  2.  Creating database "SAMPLE"...  
  3.  Connecting to database "SAMPLE"...  
  4.  Creating tables and data in schema "DB2INST1"...  
  5.  Creating tables with XML columns and XML data in schema "DB2INST1"...  
  6.  'db2sampl' processing complete. 

2.2、创建toolsbd数据库:

  1. [db2inst1@localhost NODE0000]$ db2 create tools catalog systools create new database toolsdb  
  2. DB20000I The CREATE TOOLS CATALOG command completed successfully. 

2.3、确认相应数据库文件创建的情况:

  1.  [db2inst1@localhost NODE0000]$ cd  
  2. [db2inst1@localhost ~]$ ls  
  3. db2inst1 sqllib  
  4. [db2inst1@localhost ~]$ cd db2inst1/  
  5. [db2inst1@localhost db2inst1]$ ls  
  6. NODE0000  
  7. [db2inst1@localhost db2inst1]$ cd NODE0000/  
  8. [db2inst1@localhost NODE0000]$ ls  
  9. SAMPLE SQL00001 SQL00002 sqldbdir TOOLSDB 

2.4、登陆数据库。首先登陆到sample,然后断开与该数据库的连接,再连接到toolsdb:

 
  1. [db2inst1@localhost NODE0000]$ db2  
  2. (c) Copyright IBM Corporation 1993,2007  
  3. Command Line Processor for DB2 Client 9.7.1  
  4.    
  5. You can issue database manager commands and SQL statements from the command  
  6. prompt. For example:  
  7.    db2 => connect to sample  
  8.    db2 => bind sample.bnd  
  9.    
  10. For general help, type: ?.  
  11. For command help, type: ? command, where command can be  
  12. the first few keywords of a database manager command. For example:  
  13.  ? CATALOG DATABASE for help on the CATALOG DATABASE command  
  14.  ? CATALOG         for help on all of the CATALOG commands.  
  15.    
  16. To exit db2 interactive mode, type QUIT at the command prompt. Outside  
  17. interactive mode, all commands must be prefixed with 'db2'.  
  18. To list the current command option settings, type LIST COMMAND OPTIONS.  
  19.    
  20. For more detailed help, refer to the Online Reference Manual.  
  21.    
  22. db2 => connect to sample  
  23.    
  24.   Database Connection Information  
  25.    
  26.  Database server       = DB2/LINUX 9.7.1  
  27.  SQL authorization ID  = DB2INST1  
  28.  Local database alias  = SAMPLE  
  29.    
  30. db2 => disconnect sample  
  31. DB20000I The SQL DISCONNECT command completed successfully.  
  32. db2 => connect to toolsdb  
  33.   Database Connection Information  
  34.    
  35.  Database server       = DB2/LINUX 9.7.1  
  36.  SQL authorization ID  = DB2INST1  
  37.  Local database alias  = TOOLSDB 

 

 

【编辑推荐】

  1. 在DB2中正确导出LOB数据
  2. DB2外部文件格式浅析
  3. DB2数据库设计的三个建议
  4. 解析DB2与非DB2数据库之间远程复制
  5. DB2数据库基本操作指令30条
责任编辑:杨鹏飞 来源: ITPUB空间
相关推荐

2010-08-18 13:49:01

DB2数据库

2011-03-11 16:02:03

DB2数据库安装

2010-08-26 16:15:25

DB2数据库管理

2010-08-31 14:24:25

DB2联合数据库

2010-08-25 10:50:48

DB2数据库

2010-08-16 13:45:27

安装DB2数据库

2010-09-30 11:49:21

DB2数据库权限

2010-11-01 11:30:41

DB2数据库权限

2010-11-03 16:21:18

DB2数据库授权

2010-07-30 09:30:14

DB2数据库

2010-09-01 13:38:41

DB2数据复制

2010-08-03 14:40:05

DB2数据库

2010-08-27 11:08:59

DB2安装目录

2010-11-03 16:32:10

DB2创建数据库

2010-08-31 11:26:59

DB2数据库

2010-08-31 13:06:49

DB2数据库

2010-11-02 11:49:18

SQL SERVER连

2010-08-27 10:06:23

DB2安装双机

2010-11-01 13:34:20

DB2数据库安装

2010-08-26 16:00:31

DB2数据库安装
点赞
收藏

51CTO技术栈公众号