由于需要图像界面安装,所以使用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.
阅读(1499) | 评论(0) | 转发(0) |