免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6467 | 回复: 6
打印 上一主题 下一主题

[Veritas NBU] nbu 重定向恢复DB2数据库失败。。。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-10-29 16:37 |只看该作者 |倒序浏览
源服务器名:  db2test  实例名:amyinst 库名:gaga
目标服务器名:linux    实例名:db2isnt2
master server: centerbk
media server : r3baksvr
源数据库备份策略名: test_db

已经将源服务器的gaga数据库通过nbu 备份到IBM3584带库

现在想测试数据库重定向恢复到linux 服务器的dbinst2实例下,请教一下bp.conf和db2.conf 定义是否有错,或者有没有其他地方也需要配置的。
bp.conf:
server = centerbk
server = r3baksvr
client_name = db2test


db2.conf:
#以下示例显示了指定备用还原所需的关键字行:
OBJECTTYPE ALTERNATE
SRCINST amyinst
SRCALIAS GAGA
DESTINST db2inst2
DESTALIAS GAGA
ENDOPER

#以下示例显示了定义新数据库所需的关键字:
DATABASE GAGA
OBJECTTYPE DATABASE
POLICY test_db
SCHEDULE Default-Application-Backup
CLIENT_NAME linux
ENDOPER

#以下示例显示了定义旧数据库所需的关键字:
DATABASE GAGA
OBJECTTYPE DATABASE
POLICY test_db
SCHEDULE Default-Application-Backup
CLIENT_NAME linux
ENDOPER


目前恢复报错权限问题。  SQL2062N  An error occurred while accessing media
"/usr/openv/netbackup/bin/nbdb2.so64".  Reason code: "516".

并且在目标服务器的实例用户db2inst2 下使用bplist 无法列出源数据库的备份。。

现在请教:
1: db2重定向恢复时需要配置那些脚本,并且该怎么配置
2: db2重定向恢复时目标端的实例用户使用bplist 无法列出源数据库备份,是不是就不能恢复。难道别的实例用户就不能列出吗?
3: 想请教大侠们你们的DB2 数据库归档日志都是怎么备份的?
4: 想请教懂存储的大侠们 LTO3 LTO4 LTO5 的驱动器速度最大对少和兼容的磁带分别有什么要求,还有LTO3 LTO4  LTO5 的磁带容量都有多大。

好不容易发次贴,限于时间关系先请教四个问题。 希望大侠们帮帮忙。   

论坛徽章:
0
2 [报告]
发表于 2012-10-29 16:41 |只看该作者
一些是bpdb2 日志信息

16:39:46.984 [26139] <8> dbc_GetServerClientConfig: WARNING - NBU's client name= <db2test> differs from gethostname()= <linux>
16:39:47.029 [26139] <2> vnet_vnetd_service_socket: vnet_vnetd.c.2048: VN_REQUEST_SERVICE_SOCKET: 6 0x00000006
16:39:47.029 [26139] <2> vnet_vnetd_service_socket: vnet_vnetd.c.2062: service: bprd
16:39:47.196 [26139] <2> logconnections: BPRD CONNECT FROM 10.19.250.3.40701 TO 192.168.130.176.13724
16:39:47.405 [26139] <8> dbc_GetServerClientConfig: WARNING - NBU's client name= <db2test> differs from gethostname()= <linux>
16:39:47.442 [26139] <2> vnet_vnetd_service_socket: vnet_vnetd.c.2048: VN_REQUEST_SERVICE_SOCKET: 6 0x00000006
16:39:47.443 [26139] <2> vnet_vnetd_service_socket: vnet_vnetd.c.2062: service: bprd
16:39:47.614 [26139] <2> logconnections: BPRD CONNECT FROM 10.19.250.3.19066 TO 192.168.130.176.13724
16:39:48.688 [26139] <2> vnet_vnetd_service_socket: vnet_vnetd.c.2048: VN_REQUEST_SERVICE_SOCKET: 6 0x00000006
16:39:48.688 [26139] <2> vnet_vnetd_service_socket: vnet_vnetd.c.2062: service: bprd
16:39:48.863 [26139] <2> logconnections: BPRD CONNECT FROM 10.19.250.3.12419 TO 192.168.130.176.13724
16:39:49.454 [26139] <4> VxBSAQueryObject: INF - No match was found for query
16:39:49.454 [26139] <4> db2_findImages: No object matched the specified predicate.
16:39:49.454 [26139] <4> db2_findImages: ERR - VxBSAQueryObject failed with bsa_status=<17>
16:39:49.454 [26139] <16> db2_findImages: ERR - VxBSAQueryObject() returned an empty list

论坛徽章:
0
3 [报告]
发表于 2012-10-29 17:33 |只看该作者
在线等啊,难道没人做过nbu 的DB2重定向恢复。。

论坛徽章:
0
4 [报告]
发表于 2012-10-29 18:30 |只看该作者
请参考!

1.Make sure that the backup is taken in the correct way.
It is essential to follow the instructions as said out in: http://www.symantec.com/business ... nt&id=TECH77284
2.When preparing the db2.conf file for the restore you need to give the folling infomation
OBJECTTYPE ALTERNATE # Specifies an alternate restore

3.
SRCINST db2v832d # Names the source instance that was backed up

4.
To get the SRCINST you can as the db2user on the source instance enter the following: “db2ilist”
SRCALIAS SAMPLE # Names the source database that was backed up

5.
To get the SRCALIAS enter db2 list database directory show detail The line Database name = XXX is the correct one.
DESTINST db2v832t # Names the destination instance name

6.
To get the DESTINST you can as the db2user on the destination instance enter the following: “db2ilist”
DESTALIAS NEWSAMPL # Names the destination database alias name

7.
To get the DESTALIAS enter db2 list database directory show detail The line Database name = XXX is the correct one. ENDOPER # Ends the object identifier

8.Start the restore with eg. db2 restore db QBI load /usr/openv/netbackup/bin/nbdb2.sl64 into QBI redirect
9.
The restore will now start and and the process will give a message like :

10.
temp:db2qbi 2> db2 restore db QBI load /usr/openv/netbackup/bin/nbdb2.sl64 into QBI redirect
SQL2539W Warning! Restoring to an existing database that is the same as the
backup image database. The database files will be deleted Do you want to continue ? (y/n) y
SQL1277W A redirected restore operation is being performed. Table space
configuration can now be viewed and table spaces that do not use automatic
storage can have their containers reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.

11.When you get this message you will see that the restore process is still running. To get the datafiles back you need to enter the following
12.db2 restore db QBI continue.
13.You will notice that the next file in the backup is now being restored.
14.If you do not enter this in the required time, the restore will fail on a return code 5.
15.However I find that if you enter db2 restore db QBI continue even after it failed it starts a new process and continue.
16.There is a lot of other parameters for specific time, user passwd etc. This can be find in some of the links originally post.

论坛徽章:
0
5 [报告]
发表于 2012-10-29 18:33 |只看该作者
检查用户id、group id 都和原主机匹配。

论坛徽章:
0
6 [报告]
发表于 2012-10-29 18:57 |只看该作者
回复 5# huanglao2002  我在nbu的官方文档里没看到说要求用户ID和组ID 一值,而且你那个连接打不开。


   

论坛徽章:
0
7 [报告]
发表于 2012-11-01 22:37 |只看该作者
全文如下:
Problem



Redirected DB2 restores error out with 'SQL2062N an error occurred while accessing media "/usr/openv/netbackup/bin/nbdb2.sl64". Reason code: "516"' when the users on the destination client are in different groups from the original backup.



Error



SQL2062N An error occurred while accessing media "/usr/openv/netbackup/bin/nbdb2.sl64"



Solution




Details:
Attempting to do a redirected restore of a DB2 database, fails  if the user_name/UID  on the destination server  different from the user_name/UID on the original server where the backup was created.

The default permissions on a backup image is that only the "owner" or "group" has read access to the image.



Resolution:


Starting in 6.5.4  there is a configurable option to allow others to read the backup images.


New keyword (BKUP_IMAGE_PERM) and values (USER, GROUP, ANY)have been defined to allow the user at backup time to set the permission on a backup image.


These keywords/variables need to be set in the db2.conf file, for each stanza


BKUP_IMAGE_PERM USER


BKUP_IMAGE_PERM GROUP


BKUP_IMAGE_PERM ANY


Example:


DATABASE SAMPLE


OBJECTTYPE DATABASE


POLICY db2-backup


BKUP_IMAGE_PERM USER


SCHEDULE Default-Application-Backup


ENDOPER





The keywords can also be specified in the "options" directive from the db2 backup command.


Example:


db2 backup db sample load /usr/openv/netbackup/bin/nbdb2.so OPTIONS BKUP_IMAGE_PERM=ANY





These keywords will modify the values as follows:


A value of USER will set the permission to 600. This only allows the original user who backed up the data access to the backup images.


A value of GROUP will set the permissions to 660. This allows anyone from the same group as the original user who backed up the data access to the backup images.


A value of ANY will set the permissions to 664. This allows anyone access to the backup images.


NOTE: If this keyword is not specified the permissions will default to 660.








NOTE on DB2 logs: If use the userexit program, no configuration parameter is available and normal file system permission are used. If you use the stream method (LOGARCHMETH1 VENDOR:/usr/openv/netbackup/bin....) the new keyword can be used in the db2.conf or by specifying the keyword in the LOGARCHOPT1 parameter in the database configuration.


Example:


DATABASE SAMPLE


OBJECTTYPE ARCHIVE


SCHEDULE Default-Application-Backup


BKUP_IMAGE_PERM USER


POLICY db2_logs


ARCFUNC SAVE


#ARCFUNC COPY


#ARCDIR /vxdb2/db2/v8/db2v832d/templogs


#RETDIR /vxdb2/db2/v8/db2v832d/templogs


ENDOPER





Example: configuring the LOGARCHOPT1:


db2 update db cfg for sample using LOGARCHOPT1 BKUP_IMAGE_PERM=USER





NOTE: these values will only  only impacts backups going forward.   Backup done prior to this change will still experience the error.

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP