linux下的db2

安装了数据库,登录数据库:

说明:首先登录用户,命令su etsbiz

显示所有的

[etsdbonl@localhost root]$ db2ilist

显示当前的实例
[etsdbonl@localhost root]$ db2 get instance
列出当前实例中有哪些数据库
[etsdbonl@localhost root]$ db2 list db directory
数据库的创建
[etsdbonl@localhost root]$ db2 "create database etsbiz"

连接数据库
[etsdbonl@localhost root]$ db2 connect to etsbiz

查看表的空间

db2 list tablespaces (show detail)
(db2pd -tablespaces -db <数据库名>)
表的创建
[etsdbonl@localhost root]$ db2 "create table operator(id int,name varchar(30))"
显示数据库里有那些表
[etsdbonl@localhost root]$ db2 list tables
显示当前数据库连接的有哪些应用程序
[etsdbonl@localhost root]$ db2 list application


参考:http://e066202152006.blog.163.com/blog/static/22912848201112325418947/

 

[etsdbonl@localhost root]$ su etsbiz
Password:
[etsbiz@localhost root]$ db2 "select * from biz_operator"
SQL1024N  A database connection does not exist.  SQLSTATE=08003

[etsbiz@localhost root]$ db2 connect to ETSDBONL

   Database Connection Information

 Database server        = DB2/LINUX 9.5.0
 SQL authorization ID   = ETSBIZ
 Local database alias   = ETSDBONL

[etsbiz@localhost root]$ db2 list tables

Table/View                      Schema          Type  Creation time            
------------------------------- --------------- ----- --------------------------
BIZ_AGENT                       ETSBIZ          T     2011-04-07-09.17.20.825895
BIZ_AGENT_APPLY                 ETSBIZ          T     2011-04-07-09.17.21.565381
BIZ_AGENT_FEE_RATE              ETSBIZ          T     2011-04-07-09.17.24.296892
BIZ_AGENT_FEE_RATE_APPLY        ETSBIZ          T     2011-04-07-09.17.24.642434
BIZ_BASIS_PARAM                 ETSBIZ          T     2011-04-07-09.17.19.822139
BIZ_BASIS_PARAM_APPLY           ETSBIZ          T     2011-04-07-09.17.20.458131
BIZ_CATEGORY                    ETSBIZ          T     2011-04-07-09.18.02.707419
BIZ_CODES                       ETSBIZ          T     2011-04-07-09.18.05.239763
BIZ_ERROR_LOG                   ETSBIZ          T     2011-04-07-09.17.37.823661

 

 

[etsbiz@localhost root]$ db2 "select * from biz_operator"

ID          OPERATOR_ID          PASSWORD                                           OPERATOR_NAME        AGENT_CODE      ROLE                 CUSTOMER_CODE   STATUS CREATED_DATE               UPDATED_DATE               CREATED_BY           UPDATED_BY         
----------- -------------------- -------------------------------------------------- -------------------- --------------- -------------------- --------------- ------ -------------------------- -------------------------- -------------------- --------------------
          1 admin                96e79218965eb72c92a549dd5a330112                   绠$悊鍛?              100000000000001 ADMIN                                1      2010-11-17-23.19.59.000000 2011-04-08-09.29.35.000000 system               admin              
          2 1                    96e79218965eb72c92a549dd5a330112                   1                    100000000000001 COMMON                               1      2011-04-07-09.29.37.169000 2011-04-08-09.29.35.000000 admin                admin              
          4 admin1               96e79218965eb72c92a549dd5a330112                   aaaaaaaaaaaaaaaaaaaa 100000000000001 COMMON                               1      2011-04-07-13.37.21.048000 2011-04-11-11.33.02.933000 admin                admin1             
          5 admin3               96e79218965eb72c92a549dd5a330112                   鍡栧棖鍡?              100000000000001 RE_CHECKER

 

 

友链:商标转让 www.tmtmw.com

 

阅读更多
个人分类: SQL
想对作者说点什么? 我来说一句

linux下db2安装

2011年07月07日 24KB 下载

Linux下DB2安装手册

2011年01月14日 212KB 下载

linux下DB2常用命令

2015年12月18日 80KB 下载

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭