如何修改db2数据库备份参数LOGARCHMETH1和FAILARCHPATH

如何修改db2数据库备份参数LOGARCHMETH1和FAILARCHPATH,第1张

使用以下命令:

db2=> update db cfg for 数据库名称 using LOGARCHMETH1 参数

db2=> update db cfg for 数据库名称 using FAILARCHPATH 参数值

DB2数据库命令简介 1.启动数据库 DB2start 2.停止数据库 DB2stop DB2数据库在linux相关指令之3.连接数据库 DB2 connect to o_yd user DB2 using pwd 4.读数据库管理程序配置 DB2 get dbm cfg 5.写数据库管理程序配置 DB2 update dbm cfg using 参数名 参数值 6.读数据库的配置 DB2 connect to o_yd user DB2 using pwd DB2 get db cfg for o_yd 7.写数据库的配置 DB2 connect to o_yd user DB2 using pwd DB2 update db cfg for o_yd using 参数名 参数值 8.关闭所有应用连接 DB2 force application all DB2 force application ID1,ID2,,,Idn MODE ASYNC (DB2 list application for db o_yd show detail) 9.备份数据库 DB2 force application all DB2 backup db o_yd to d: (DB2 initialize tape on \tape0) (DB2 rewind tape on \tape0) DB2 backup db o_yd to \tape0 10.恢复数据库 DB2 restore db o_yd from d: to d: DB2 restore db o_yd from \tape0 to d: DB2数据库在linux相关指令之11.绑定存储过程 DB2 connect to o_yd user DB2 using pwd DB2 bind c:dfplusbnd 拷贝存储过程到服务器上的C:sqllibfunction目录中 12.整理表 DB2 connect to o_yd user DB2 using pwd DB2 reorg table ydd DB2 runstats on table ydd with distribution and indexes all 13.导出表数据 DB2 export to c:dftztxt of del select from dftz DB2 export to c:dftzixf of ixf select from dftz 14.导入表数据 import from c:123txt of del insert into ylbxczyxx DB2 import to c:dftztxt of del commitcount 5000 messages c:dftzmsg insert into dftz DB2 import to c:dftzixf of ixf commitcount 5000 messages c:dftzmsg insert into dftz DB2 import to c:dftzixf of ixf commitcount 5000 insert into dftz DB2 import to c:dftzixf of ixf commitcount 5000 insert_update into dftz DB2 import to c:dftzixf of ixf commitcount 5000 replace into dftz DB2 import to c:dftzixf of ixf commitcount 5000 create into dftz (仅IXF) DB2 import to c:dftzixf of ixf commitcount 5000 replace_create into dftz (仅IXF) 15.执行一个批处理文件 DB2 -tf 批处理文件名 (文件中每一条命令用 ;结束) 16.自动生成批处理文件 建文本文件:tempsql select 'runstats on table DB2' || tabname || ' with distribution and detailed indexes all;' from syscattables where tabschema='DB2' and type='T'; DB2 -tf tempsql>runstatssql 17.自动生成建表(视图)语句 在服务器上:C:sqllibmisc目录中 DB2 connect to o_yd user DB2 using pwd DB2look -d o_yd -u DB2 -e -p -c c:o_ydtxt DB2数据库在linux相关指令之18.其他命令 grant dbadm on database to user bb 19select from czyxx fetch first 1 rows only 20DB2look -d ylbx -u DB2admin -w -asd -a -e -o atxt21 显示当前用户所有表 list tables 22列出所有的系统表 list tables for system 23查看表结构 DB2 describe select from usertables (实习编辑:HJ)

你好的!

你要备份的就是几张表的数据么?

那样你只需要将需要的数据弄成插入语句最好了!

给你介绍个工具:rapidsql~!这个工具能快速的备份单表数据!

欢迎追问!

希望被采纳!

db2数据库恢复

RESTORE DATABASE sample FROM C:\DBBACKUP TAKEN AT 20030314131259 WITHOUT ROLLING FORWARD WITHOUT PROMPTING

注意你的库名、备份文件存放路径、时间戳记

报错很明确,是磁盘空余空间不够。

如果问具体哪里不够,目前贴出来的信息不够得到该答案。

如果再次确认过d:下的空闲空间是足够的,请试试命令

RESTORE DATABASE SALESOA FROM "E:\PRM" TAKEN AT 20120114161555 on "E:" INTO SALESOA

如果仍旧报sql968,请用“重定向恢复”做吧(搜索下,就会知道大概的步骤滴)。这样可以先看看表空间的结构,对该数据库的结构有个了解,然后再去判断是哪里出了问题。

只能用

db2look

+db2move

进行迁移。

1提取DDL

用如下命令

db2look

-d

yn

-e

-l

-o

db2look_ynddl

//提取出

yn(云南)

这个数据库

所有用户对象,包括表空间等。

2用db2move

导出数据

如下

如你在

db2inist1

用户目录下

建立一个

data

目录

然后执行

db2move

yn

export

在data

目录下

会有好多

后缀名为ixf

和msg

的文件,其中ixf为数据表文件,msg后缀的为消息文件,其中最重要的

是db2movelst

存放导出表和消息文件的对应关系。

3去windows

下建立一个数据库

db2

create

db

yn

pagesize

8

k”

//这里的pagesize需要和

ddl的统一

然后修改

ynddl

文件下

Linux下面

的路径

替换为Windows

的路径然后执行db2

-tvf

ynddl

4导入数据库

db2move

yn

load

其中会生成

一个loadout的文件

记录错误信息或者

导入失败的表

,如加载了多少行,拒绝多少行

等。

5查看loadout

找到那些导入不成功的进行

处理,然后倒入。然后进行完整性约束

这些检查。如有问题

Q

我吧。

以上就是关于如何修改db2数据库备份参数LOGARCHMETH1和FAILARCHPATH全部的内容,包括:如何修改db2数据库备份参数LOGARCHMETH1和FAILARCHPATH、DB2数据库在linux *** 作系统的指令有哪些、DB2里如何备份表等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/9400127.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-28
下一篇 2023-04-28

发表评论

登录后才能评论

评论列表(0条)

保存