db2 ddddddddd

create table cnghss_mks(pdtkey varchar(30) not null,ghss varchar(100) not null,pdt varchar(100) not null,mks varchar(100) not null,ytmth varchar(20) not null,value int, primary key(pdtkey,ghss,pdt,mks,ytmth))
create table cnghss_mks(pdtkey varchar(30) not null,ghss varchar(100) not null,pdt varchar(100) not null,mks varchar(100) not null,ytmth varchar(20) not null,value int, primary key(pdtkey,ghss,pdt,mks,ytmth)) organize  by (ytmth)
create table cnghss_mks(pdtkey varchar(30),ghss varchar(100),pdt varchar(100),mks varchar(100),ytmth varchar(20),value int)

echo %time%
db2 load from E:\db2test\cnghss_mks200.cma of del MESSAGES E:\db2test\cnghss_mks200.msg insert into cnghss_mks NONRECOVERABLE
echo %time%


echo %time%
db2 load from E:\db2test\cnghss_mks.cma of del MESSAGES E:\db2test\cnghss_mks.msg insert into cnghss_mks NONRECOVERABLE
echo %time%


ALTER TABLE cnghss_mks activate NOT LOGGED initially WITH EMPTY TABLE

select sum(a.BLOCK_SIZE*a.BLOCKS)/1024/1024 from jackie.$archived_log a where a.DELETED='NO'


1.db2日志类型.
2.主键索引与唯一约束区别.
3.如何查看db2日志(recovery expert)
4.java 如何利用2进制文件?
5.db2 查询分析.
6.db2 索引文件放在哪里?

db2 create table tab2 like tab1

db2 insert into tab2 select * from tab1

load from jackie.cnghss_mks1 of del terminate into cnghss_mks



echo %time%
db2 load from E:\db2test\test1.cma of del MESSAGES E:\db2test\test1.msg insert into test1 NONRECOVERABLE
echo %time%

Alter table cnghss_mks drop primary key

db2look -d 数据库名 -i 用户名-w 密码 -e -o ./文件名.txt

######################################################################
1.没主键,load数时会写log,不过不多.
2.有主键,log中会写所有导入的数据并且排序.

你可能感兴趣的:(db2)