六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 67|回复: 0

starting with db2

[复制链接]

升级  60.33%

117

主题

117

主题

117

主题

举人

Rank: 3Rank: 3

积分
381
 楼主| 发表于 2013-1-13 18:36:20 | 显示全部楼层 |阅读模式
Starting working with DB2 on unix:

You have to install dbd2 client software on your unix workstation and reboot it.
You have to source a db2profile file with all necessary environment
You have to catalog properly, for example:

  db2 catalog tcpip node xxx remote somer_server server some_port
  db2 catalog db some_db at node xxx
  db2 connect to some_db
  db2 list database directory

  db2 catalog db sample at node xxx
  db2 connect to sample
  db2 "select * from syscat.tables fetch first 5 rows only"
     (note the quotes around select - to hide from shell processing)

  db2 -tvf myfile.sql    - to run many commands from a file.  Don't forget to separate SQL statments with ";"

db2 "select char(reviewed_date, ISO) from oe.OE_contact fetch first 10 rows only"
-------------------------------------------------
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表