什么时候离线备份不是真的脱机? [英] When is an offline backup not really offline?

查看:142
本文介绍了什么时候离线备份不是真的脱机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我希望这并不是全新的,但我一直在搜索网页和IBM的
docs直到烟雾消失为止。


场景:我们正试图采用原始的快照。我们的生产

数据库进入测试环境,采取(我们认为是)离线

备份生产,然后进行重定向恢复测试。


这是'我要做的步骤:


- 确保没有人连接但管理员。

$ db2stop force;

$ db2start管理员模式用户db2admin;

$ db2连接到REX;

$ db2 QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;

$ db2 CONNECT RESET;

$ db2 FORCE APPLICATION ALL;

$ db2 DEACTIVATE DB REX;


- 只需检查......

$ db2列表应用程序


$ db2 BACKUP DATABASE REX TO" / tmp"带2个缓冲器缓冲器1024

并行1无需提示;


- 确认我们可以返回

$ db2连接到REX;

$ db2 UNQUIESCE DATABASE;

$ db2 CONNECT RESET;

$ db2stop force

$ db2start

$ db2连接到rex;


现在,这应该是一个OFFLINE备份,对吗?然而,当我尝试将
恢复到测试环境中时:


$ db2 create db rex alias testrex;


$ db2从/ tmp在''yyyymmddhhmmss''上恢复db rex在/ b $ b''/ db / rextest''进入testrex newlogpath''/ translogs / rextest''redirect

没有前滚;


我得到:


SQL2537N在恢复后需要前滚。


呃,什么?我想/只有在我使用ONLINE

备份时才会发生这种情况!我假设的OFFline备份是如何变成ON行的?


我在这里缺少什么?是否还有另一个神秘的咒语我必须勉强强制执行绝对,完全,当然,肯定会确保我的备份离线以便我可以忽略日志而不是

必须做前滚吗?


谢谢

Mike

Hello,

I hope this doesn''t come across as totally newbieish, but I''ve been
searching the web and the IBM docs until smoke is coming out of my head.

Scenario: We are trying to take primitive "snapshots" of our production
database into a test environment by taking (what we thought are) offline
backups of production, then doing a redirected restore into test.

Here''s the steps I do:

-- Make absolutely sure there''s nobody connected but the admin.
$ db2stop force;
$ db2start admin mode user db2admin;
$ db2 CONNECT TO REX;
$ db2 QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
$ db2 CONNECT RESET;
$ db2 FORCE APPLICATION ALL;
$ db2 DEACTIVATE DB REX;

-- Just checking...
$ db2 list application

$ db2 BACKUP DATABASE REX TO "/tmp" WITH 2 BUFFERS BUFFER 1024
PARALLELISM 1 WITHOUT PROMPTING;

-- verify we can get back in
$ db2 CONNECT TO REX;
$ db2 UNQUIESCE DATABASE;
$ db2 CONNECT RESET;
$ db2stop force
$ db2start
$ db2 connect to rex;

Now, this should have taken an OFFLINE backup, correct? Yet, when I try
to restore it into the test environment:

$ db2 create db rex alias testrex;

$ db2 restore db rex from /tmp taken at ''yyyymmddhhmmss'' on
''/db/rextest'' into testrex newlogpath ''/translogs/rextest'' redirect
without rolling forward;

I get:

"SQL2537N Roll-forward is required following the Restore."

Err, what? I thought/read that only happens if I work with an ONLINE
backup! How did my supposed OFFline backup turn into an ONline one?

What am I missing here? Is there another mystery incantation I have to
mumble to enforce that absolutely, totally, certainly, assuredly makes
sure that my backup is offline so that I can "ignore" the logs and not
have to do a rollforward?

Thanks
Mike

推荐答案

db2stop force;
db2stop force;


db2start管理模式用户db2admin;
db2start admin mode user db2admin;


db2连接到REX;
db2 CONNECT TO REX;


这篇关于什么时候离线备份不是真的脱机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆