2009-11-10 DB2 SQL1205N错误&提取备份镜像中的日志文件

一、RESTORE恢复时报错

昨晚做数据库迁移测试,用的是备份恢复的方法,在RESTORE时报SQL1205N错误。DB2版本为8.2,在信息中心中查询,结果如下:

SQL1205N

The code page code-page and/or territory code territory that has been specified is not valid.

Explanation:

This version of DB2 does not support the active code page or territory code or both, as specified by the Create Database command.

The command cannot be processed.
User Response:

Refer to the Create Database command in the Command Reference for details of valid code page and territory code pairs supported by DB2/2.

[@more@]在网上查到解决方法,修改Profile Registry参数DB2CODEPAGE,将其值从1386改为819,恢复完成后再将其改回原值。


二、提取备份镜像中的日志文件

使用backup database命令的include logs参数,可以将恢复所需的日志文件包含在备份镜像内。在恢复时,需要使用restore database命令的logs参数和logtarget参数提取日志文件。这两个参数的作用如下:

logs:指定仅还原备份镜像中的日志文件。指定该选项,则必须指定logtarget选项。
logtarget:指定释放日志文件的目标目录。

下面的示例中先RESTORE恢复数据库,再将日志文件从备份镜像中还原出来。其实,两个操作可以同时完成,将两条命令合并为“db2 restore db ggyy from /data/backup taken at 20091110145515 to /data/dbdir logtarget /data/palog/db2inst1/GGYY/NODE0000/C0000003”即可,注意没有logs参数。

db2inst1@suse-db:/data/palog/db2inst1/GGYY/NODE0000/C0000003> db2 restore db ggyy from /data/backup taken at 20091110145515 to /data/dbdir
DB20000I The RESTORE DATABASE command completed successfully.
db2inst1@suse-db:/data/palog/db2inst1/GGYY/NODE0000/C0000003> db2 restore db ggyy logs from /data/backup taken at 20091110145515 logtarget /data/palog/db2inst1/GGYY/NODE0000/C0000003
SQL2580W Warning! Restoring logs to a path which contains existing log files.
Attempting to overwrite an existing log file during restore will cause the
restore operation to fail.
Do you want to continue ? (y/n) y
DB20000I The RESTORE DATABASE command completed successfully.
db2inst1@suse-db:/data/palog/db2inst1/GGYY/NODE0000/C0000003> db2 rollforward db ggyy to end of logs

Rollforward Status

Input database alias = ggyy
Number of nodes have returned status = 1

Node number = 0
Rollforward status = DB working
Next log file to be read = S0000022.LOG
Log files processed = S0000022.LOG - S0000022.LOG
Last committed transaction = 2009-11-10-06.55.30.000000 UTC

DB20000I The ROLLFORWARD command completed successfully.
db2inst1@suse-db:/data/palog/db2inst1/GGYY/NODE0000/C0000003> db2 rollforward db ggyy to end of logs and stop

Rollforward Status

Input database alias = ggyy
Number of nodes have returned status = 1

Node number = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0000022.LOG - S0000022.LOG
Last committed transaction = 2009-11-10-06.55.30.000000 UTC

DB20000I The ROLLFORWARD command completed successfully.
db2inst1@suse-db:/data/dbdir/db2inst1/NODE0000/SQL00001/SQLOGDIR> db2 connect to ggyy

Database Connection Information

Database server = DB2/LINUX 9.7.0
SQL authorization ID = DB2INST1
Local database alias = GGYY

db2inst1@suse-db:/data/dbdir/db2inst1/NODE0000/SQL00001/SQLOGDIR> db2 list tablespaces

Tablespaces for Current Database

Tablespace ID = 0
Name = SYSCATSPACE
Type = Database managed space
Contents = All permanent data. Regular table space.
State = 0x0000
Detailed explanation:
Normal

Tablespace ID = 1
Name = TEMPSPACE1
Type = System managed space
Contents = System Temporary data
State = 0x0000
Detailed explanation:
Normal

Tablespace ID = 2
Name = USERSPACE1
Type = Database managed space
Contents = All permanent data. Large table space.
State = 0x0000
Detailed explanation:
Normal

Tablespace ID = 3
Name = SYSTOOLSPACE
Type = Database managed space
Contents = All permanent data. Large table space.
State = 0x0000
Detailed explanation:
Normal

Tablespace ID = 4
Name = SYSTOOLSTMPSPACE
Type = System managed space
Contents = User Temporary data
State = 0x0000
Detailed explanation:
Normal

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

转载于:http://blog.itpub.net/11662464/viewspace-1028764/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值