Chinaunix首页 | 论坛 | 博客
  • 博客访问: 606185
  • 博文数量: 142
  • 博客积分: 116
  • 博客等级: 入伍新兵
  • 技术积分: 1445
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-28 08:37
文章分类

全部博文(142)

文章存档

2017年(7)

2016年(57)

2015年(48)

2014年(30)

我的朋友

分类: DB2/Informix

2015-01-22 12:11:03

由于需要图像界面安装,所以使用vnc登录。
命令行执行
$ cd expc
$ ./db2setup
进入图形界面

中间图形界面步骤省略。

把db2profile复制到/etc/profile.d/db2profile.sh

使用db2inst1用户登录,查看实例
$ db2ilist
db2inst1

进入db2提示符。
$ db2

查看实例下所有数据库
db2 => list db directory
SQL1031N  The database directory cannot be found on the indicated file system.
SQLSTATE=58031

创建数据库
db2 => create database mydb1
DB20000I  The CREATE DATABASE command completed successfully.

db2 => list db directory

 System Database Directory

 Number of entries in the directory = 1

Database 1 entry:

 Database alias                       = MYDB1
 Database name                        = MYDB1
 Local database directory             = /home/db2inst1
 Database release level               = f.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =


使用db2fenc1用户,连接数据库并建表。
db2 => connect to mydb1

   Database Connection Information

 Database server        = DB2/LINUXX8664 10.1.0
 SQL authorization ID   = DB2FENC1
 Local database alias   = MYDB1

db2 => list tables

Table/View                      Schema          Type  Creation time
------------------------------- --------------- ----- --------------------------

  0 record(s) selected.

阅读(1440) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~