IBM Support

[Db2] How to restore the different instance name backup image when receive SQL0551N

Question & Answer


Question

When you restore a database backup image, which was taken at different instance name, it is restored without any error.  But, when we execute a select statement, it returns SQL0551N.  Why get the error?  How to restore it?

Answer

If the backup taken instance name is db2inst1 and restores it on db2inst2 instance where is not the same instance name, a select statement returns an error as:
SQL0551N  The statement failed because the authorization ID does not have the
required authorization or privilege to perform the operation.  Authorization
ID: "DB2INST2".  Operation: "SELECT". Object: "S1.T1".  SQLSTATE=42501
Because the backup image does not have any db2inst2 information.
In this situation, drop the restored database once, run db2set DB2_RESTORE_GRANT_ADMIN_AUTHORITIES=ON.  Then, execute restore again to run the select statement without the error.

If DB2_RESTORE_GRANT_ADMIN_AUTHORITIES is set to ON, and you are restoring to a new or existing database, then you are granted SECADM, DBADM, DATAACCESS, and ACCESSCTRL authorities.
Note:
This behavior might be changed without notice in the future. We can confirm whether this technote is valid or not by following the commands.  Contact your Sales Rep to submit a potential design change toward a future release.  Or open a ticket by reviewing:
How can I submit a suggestion, Document Change Request (DCR) or Request For 
Enhancement (RFE) for DB2 LUW?
https://www.ibm.com/support/pages/node/285337
 

Related Information

[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m500000008PkuAAE","label":"Security and Plug-Ins"}],"ARM Case Number":"TS010968023","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
04 November 2022

UID

ibm16837499