简体   繁体   English

DB2:还原具有TSM作为日志归档方法的联机备份映像

[英]DB2: restore an online backup image that has TSM as log archiving method

I am trying to locally restore a DB2 online backup image from a remote server. 我正在尝试从远程服务器本地还原DB2联机备份映像。 I can restore it successfully, but when I try to roll the db forward I get this error: 我可以成功还原它,但是当我尝试前滚数据库时,出现此错误:

SQL2071N An error occurred while accessing the shared library "/home/db2inst1/sqllib/adsm/libtsm.a". Reason code: "2".

I realized, by looking at the db configuration, that LOGARCHMETH1 is set to TSM , meaning TSM was the log archiving method on the original DB2 installation. 通过查看数据库配置,我意识到LOGARCHMETH1设置为TSM ,这意味着TSM是原始DB2安装上的日志归档方法。 I set the value to disk:/path and ran the roll forward operation again. 我将该值设置为disk:/path并再次运行前滚操作。 This is the status: 状态为:

                                 Rollforward Status

 Input database alias                   = devcldx
 Number of members have returned status = 1

 Member ID                              = 0
 Rollforward status                     = DB  pending
 Next log file to be read               = S0000645.LOG
 Log files processed                    =  -
 Last committed transaction             = 2016-08-30-19.48.31.000000 UTC

And this is what I get when I try rolling forward to the end of logs: 这是我尝试前滚到日志末尾时得到的:

SQL1273N  
An operation reading the logs on database "DEVCLDX" cannot continue 
because of a missing log file "S0000645.LOG" on database partition "0" and log 
stream "0".

Obviously that log file doesn't exist on my local machine. 显然,该日志文件在我的本地计算机上不存在。

Is there any way I can complete the roll forward? 有什么办法可以完成前滚?

The proper way to do this would be to either: 正确的方法是:

  1. Use the db2adutl utility to extract the log files from the TSM server on the source machine and then copy them to the target machine. 使用db2adutl实用程序从源计算机上的TSM服务器提取日志文件,然后将它们复制到目标计算机。

  2. Install the TSM client on the machine and configure it to act as the primary server so it can retrieve the log files. 在机器上安装TSM客户机并将其配置为充当主服务器,以便它可以检索日志文件。 (This is somewhat complicated). (这有点复杂)。

Either of these options would allow you to restore to any point in time. 这些选项中的任何一个都可以使您还原到任何时间点。

If neither of these is an option, and if restoring the database only to the point in time that the backup completed is acceptable, you have one more option: 如果这两种方法都不是一种选择,并且仅将数据库还原到可以完成备份的时间点,那么您还有一个选择:

  1. The database backup image has a copy of the active transaction log file from when the backup was running. 数据库备份映像具有备份运行时的活动事务日志文件的副本。 You can extract these to disk. 您可以将它们提取到磁盘。

In your RESTORE DATABASE command, you include the logtarget /path/to/write/files option: DB2 will extract the included log files from the backup image into the specified directory as it performs the restore. RESTORE DATABASE命令中,包括logtarget /path/to/write/files选项:DB2在执行还原时,会将包含的日志文件从备份映像提取到指定目录中。

You can then perform the roll forward to the end of the backup using the path: 然后,您可以使用以下路径执行前滚到备份结尾

rollforward database X 
    to end of backup and complete
    overflow log path (/path/to/write/files)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM