美文网首页
DB2问题整理(持续更新)

DB2问题整理(持续更新)

作者: berry是浆果 | 来源:发表于2020-10-28 17:00 被阅读0次

字符串转日期类型
date(yyyy-mm-dd)
timestamp(yyyy-mm-dd hh24:mi:ss)

db2不记录日志操作

--建表
create table tablename not logged initially;
--修改表(只在当前事务中生效)
alter table tablename not logged initially;
insert into tablename()select from tablename1;--举插入数据的例子
commit;
--清空表
alter table tablename not logged initially with empty table;

未能在表空间中分配新页面
SQL0289N Unable to allocate new pages in table space "USERSPACE1".SQLSTATE=57011
解决:db2 list tablespaces show detail
SMS需增加磁盘 DMS需扩展表空间大小
db2 alter tablespace USERSPACE1 extend(all 100) 此处为100M

db2 command not found
Linux初始化后db2 command not found
解决:配置环境变量
在.bashrc中增加如下脚本

if [ -f /home/db2inst/sqllib/db2profile ]; then
  . /home/db2inst/sqllib/db2profile
fi
--注意:db2inst按实际情况填写

相关文章

网友评论

      本文标题:DB2问题整理(持续更新)

      本文链接:https://www.haomeiwen.com/subject/gflcvktx.html