DB2数据库中安装sample数据库与TOLLSDB的步骤描述

数据库
下面的文章主要介绍的是在DB2数据库中安装sample数据库与TOLLSDB数据库的正确操作流程,以下就是文章的主要内容的介绍。

此文章主要讲述的是在DB2数据库中安装sample数据库与TOLLSDB数据库的正确操作步骤,以及对安装sample数据库与TOLLSDB数据库是我的小的细节操作的介绍,以下就是文章的主要内容讲述。

数据库, sample, TOLLSDB数据库, sample, TOLLSDB

 

安装示例数据库和TOOLSDB数据库:

 

安装完成后,欲登陆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、 猜想DB2数据库未安装,查看/hom/db2inst1目录下的,仅有sqllib文件夹:

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

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

  1. [db2inst1@localhost ~]$ ls  
  2. db2inst1 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、确认相应DB2数据库文件创建的情况:

  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. You can issue database manager commands and SQL statements from the command  
  5. prompt. For example:  
  6. db2 => connect to sample  
  7. db2 => bind sample.bnd  
  8. For general help, type: ?.  
  9. For command help, type: ? command, where command can be  
  10. the first few keywords of a database manager command. For example:  
  11. ? CATALOG DATABASE for help on the CATALOG DATABASE command  
  12. ? CATALOG for help on all of the CATALOG commands.  
  13. To exit db2 interactive mode, type QUIT at the command prompt. Outside  
  14. interactive mode, all commands must be prefixed with 'db2'.  
  15. To list the current command option settings, type LIST COMMAND OPTIONS.  
  16. For more detailed help, refer to the Online Reference Manual.  
  17. db2 => connect to sample  
  18. Database Connection Information  
  19. Database server = DB2/LINUX 9.7.1  
  20. SQL authorization ID = DB2INST1 
  21. Local database alias = SAMPLE 
  22. db2 => disconnect sample  
  23. DB20000I The SQL DISCONNECT command completed successfully.  
  24. db2 => connect to toolsdb  
  25. Database Connection Information  
  26. Database server = DB2/LINUX 9.7.1  
  27. SQL authorization ID = DB2INST1 
  28. Local database alias = TOOLSDB   

 

以上的相关内容就是对DB2数据库中安装sample数据库和TOLLSDB数据库的介绍,望你能有所收获。

 

责任编辑:佚名 来源: 互联网
相关推荐

2010-07-23 08:42:00

TOLLSDBDB2

2011-03-11 16:02:03

DB2数据库安装

2010-08-26 16:00:31

DB2数据库安装

2010-08-18 17:32:34

DB2数据库

2010-08-04 13:37:43

2010-08-17 16:24:32

IBM DB2数据库

2010-08-13 15:42:22

DB2数据库分区

2010-08-04 15:59:29

2010-08-11 12:43:45

DB2数据库调优

2010-08-11 14:32:55

DB2数据库调优

2010-08-04 13:30:49

2010-08-12 10:27:21

DB2数据库备份

2010-08-18 15:42:33

2010-08-02 08:40:43

DB2数据库性能

2010-08-03 14:40:05

DB2数据库

2010-08-12 15:43:24

DB2数据库备份

2010-08-16 14:45:15

DB2数据库

2011-03-15 11:19:45

DB2数据库catalog

2010-09-01 10:17:14

DB2日志

2010-08-06 09:39:27

DB2数据库分区
点赞
收藏

51CTO技术栈公众号