db2入門學習

imlihj2007發表於2009-05-10

instance
db2icrt
db2idrop
db2ilist
:
db2icrt fistdb
db2ilist
db2idrop fistdb

db2 get dbm cfg
:
db2 update dbm cfg using svcename 50000
database
db2start
db2stop(force)

db2 create database lihj
db2 connect to lihj (user username using password)
db2 drop database lihj
db2 connect reset
db2 connect(檢視連線)
db2stop(force)
db2start

db2 get db cfg for lihj
db2 update db cfg for lihj using locktimeout 30

db2 connect on daabase from
db2 catalog tcpip node fnode remote ipaddress server 50000
db2 catalog database lihj as db2 at node fnode

db2 connect to db2 user usnem using password

db2 list application
db2 list application show detail
db2 get monitor switches

db2 backup database toolsdb
db2 restore database toolsdb

db2 create table lihj(id char(2))
db2 insert into lihj values('1')
db2 select * from lihj
db2 export to lihj.sql of del select * from lihj
db2 import from lihj.sql of del insert into lihj
db2 import from lihj.sql of del replace into li(快速清空表)

DB2 LIST TABLES FOR SYSTEM(表)
db2 list tablespaces(表空間)
db2 list tablespace containers for 4(容器)

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9879835/viewspace-1021927/,如需轉載,請註明出處,否則將追究法律責任。