- 论坛徽章:
- 0
|
全文如下:
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.
|
|