link 发表于 2016-11-12 10:00:57

starting with db2

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"
-------------------------------------------------
页: [1]
查看完整版本: starting with db2