Remember the user permissions issues encountered during DB2 backup \ Restore

Source: Internet
Author: User
Tags db2 db2 connect db2 connect to dba

The following command is used today to back up DB2 data on Windows (the original DB2 DBA user is a)
DB2 Backup DB Db2demo
Successful execution
And then execute it on another machine with the environment.
DB2 Create DB Db2demo
Success
DB2 Connect to Db2demo
Success
DB2 CREATE schema Db2rcs
Success
DB2 Grant DBADM on database to user B (because the Restore computer user name differs from the backup machine user name)
Successful, (at which point User B has full administrative privileges on Db2demo)
Then perform database recovery, command
DB2 Restore DB Db2demo from e:\ taken at 20180531132230
Success
Then the problem occurs and User B loses any permissions except for connect in the database Db2demo!
When you execute a command that has just been executed successfully
DB2 Grant DBADM on database to user B
, there is still an error, there is no grant permission.
Any user can then use the grant command, prompting for unauthorized or even non-executable select View tables.

After repeated trials (omitted here: joy:), the cause of the problem was found: When a backup is made, a valid DBA user of the database is a, and after another computer executes the DB2 restore command to recover the database Db2demo, Db2demo only User A has DBA authority.

Workaround: On the recovery computer, create User A, and join the Administrators group (some WIN10 system does not have users and groups this management menu, but is replaced by account management in the Control Panel, but after I tested, the Control Panel account management did not find the management user and group functions--! Someone knows how to get it back to us.)
Then delete the currently out-of-control library
DB2 Drop DB Db2demo
Success
To re-build this library, the steps are the same, but before restoring the backup, Grant Dbadm permissions to the a user. After the recovery is complete, only a user has DBA authority for the library.

The key to discovering this problem is that during the testing process, when you just created the Db2demo library, the permissions are no problem until the backup is restored. Therefore, the problem of permissions caused by restoring the backup file is suspected.

Looking for clues in the trace, the process is very painful, the result is very moving.

Remember the user permissions issues encountered during DB2 backup \ Restore

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.