常用命令--不断更新中

db2 list tablespaces show detail;

db2 list tablesapce containers number;

db2 list history backup since timestamp for database sample;

db2 list history backup dropped table all for database sample;

db2 backup database sample online/offline to datapath,datapath with number buffers without prompting;

db2 restore database sample from datapath taken at timestamp into newdatabase

db2 restore database sample from datapath redirect generate script. sample.clp(原来表空间的设备不存在)

db2 rollforward database sample to end of logs and complete(不能在进行roll forward)

db2 rollforward database sample to end of logs(不能再进行roll froward 到时间点,只能到 end of logs )

db2 rollforward database sample to timestamp using UTC(格林威治时间,默认的就是)

db2 rollforward database sample to end of logs and stop recover dropped table backup Id to datapath;

db2  select current timezone from sysibm.sysdummy1(查出timezone)

db2 "values(current timezone)"(查出timezone)

UTC(格林威治时间)=本地时间-timezone

db2 rollforward database sample to timestamp using local time

timestamp这个时间要比备份文件最末时间之后。

db2 get monitor switches(查看监控开关的情况)

db2 get connetion state ;db2 connect(都是获得当前的连接信息)

db2 set current schema schemename;

db2 select current schema from sysibm.sysdummy1;

db2 get dbm cfg | grep -ip dftdbpath;

db2 load client from absolute path/filename.ixf /del of ixf/del insert into tablename nonrecoverable(归档);

db2 export to filepath filename.ixf/del of ixf/del select * from table name;

db2 import from filename.ixf of ixf insert into tablename;

db2 terminate;

db2 connect reset;

db2 grant load on database to user/group username/groupname;

 db2 list command options;

db2 SET INTEGRITY for tablename_MQT IMMEDIATE CHECKED

db2 alter table tabschema.tabname data capture none;

db2 "declare mycursor cursor database dbname user username using passwd for select * from source table"
db2 "load from mycursor of cursor insert into targettable nonrecoverable"

db2 declare mycursor cursor for select * from tabschema.tabname
db2 load from mycursor of cursor insert into targettable nonrecoverable

 db2 list applications show detail可以查看连接的状态。

db2 create index db2admin.indx1 on db2admin.department(depanme) colect statistics;

db2 create index db2admin.indx1 on db2admin.department(depname) collect detailed statistics;

db2 create index db2admin.indx1 on db2admin.department(depname) collect sampled detailed statistics;

db2tbst 状态码.

我发现这个db2命令的缩写好像都是停留在这个重度音节上。

db2 update dbm cfg using MAX_COORDAGENTS 400 AUTOMATIC

db2 alter table tablename data capture none;

db2 alter table tablename data capture changes;

ps -emo THREAD -p 线程ID 可以查看进程下的所有线程

db2level 可以查看安装的版本路径,还有其他的一些信息。

db2 alter table alter cloumn name set not null

db2 alter table add primary key(column name)


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24177460/viewspace-696741/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24177460/viewspace-696741/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值