How do I add a user in DB2?

How do I add a user in DB2?

Procedure

  1. Create an operating system user. You must have root authority to create a user.
  2. Set the password for the user. You can try to connect to the server by using the user ID to verify that the user can connect to the server.
  3. Set a new password for the user.

How do I grant select privileges to user for all tables in DB2?

How to grant select privileges on all tables for DB2

  1. MYDB=””
  2. MYSCHEMA=””
  3. MYUSER=””
  4. db2 “CONNECT TO $MYDB”
  5. DBTABLES=`db2 -x “SELECT tabname FROM syscat.tables WHERE tabschema=UPPER(‘$MYSCHEMA’)”`
  6. for TABLENAME in $DBTABLES;
  7. do db2 “GRANT SELECT ON $MYSCHEMA.$TABLENAME TO USER $MYUSER”
  8. done.

What is a DB2 schema?

DB2 Schema is a collection of named objects classify logically in the database. You can create multiple schemas in a database as well as multiple database objects with same name, with different schema groups. A schema can contain tables, functions, indices, tablespaces, procedures, triggers etc.

How do I create a DB2 instance in Linux?

To create an instance using db2icrt:

  1. Log in with proper authority.
  2. Run the db2icrt command. For example, on Linux or UNIX operating systems: DB2DIR /instance/db2icrt -a AuthType -u FencedID InstName where: DB2DIR. is the Db2 installation directory.

How to grant read only privileges in DB2?

There is no read only privilege on a database in DB2. You will need to grant SELECT privileges on specific tables, preferably via a role to avoid doing this multiple times. Create a new database role, e.g. create role readonly. Grant SELECT privileges on the required tables to that role: grant select on myschema.mytable to role readonly.

How to create a user in DB2 server?

Create a user at the operating system level. Create an operating system user. You must have root authority to create a user. If you do not have root authority to create a user, contact your DB2® server administrator for help. Set the password for the user.

How to grant permissions to a database user?

Create a database user pim and grant the permissions by using the instance owner login (the default instance owner login is db2inst1). Grant user permissions to use space on all the InfoSphere Master Data Management Collaboration Server – Collaborative Edition specific table spaces.