SoFunction
Updated on 2025-04-14

How to view the current user mode and switch users

1. Switch user mode: setcurrentschematoms

2. Query the current user mode: selectcurrentschemafromsysibm.sysdummy1 or selectcurrentschemafromsysibm.dual

3. Connect to database: db2connecttostudy

4. Check the permissions of the current user: db2getauthorizations

5. Switch user: db2connecttocpsdbuserAdministratorusing111111

6. Authorize other users: db2grantdbadmondatabasetouserodsuser