db_ddl_grant_user script
The db_ddl_grant_user script dumps out the SQL/DDL statement that was used to grant access to a user, that is, the GRANT statement.
The db_ddl_grant_user command is part of the Db2 support tools. To run it, a database name is required following -d | -db. By default, the GRANT...TO USER statements will be produced for all objects that had such privileges granted. You can then use -schema or -tb to specify schema or table name to further narrow down the outputs.
Syntax
db_ddl_grant_user -d|-db <dbname> [-schema <schema_name>] [-tb <table_name>]
Parameters
All parameters are optional unless specified otherwise.- - db <database_name>
-
Specifies a database name. This parameter is required.
- -schema <schema_name>
-
Specifies a schema name. If specified, the SQL/DDL statements pertaining to the objects belonging only to that schema are generated.
- -tb <table_name>
-
Specifies a table name. If specified, the SQL/DDL statements pertaining to this single table are generated.
Outputs
GRANT statements are sent to standard output.