ITPub博客

首页 > 数据库 > 数据库开发技术 > DB2 创建授权脚本 grantread.sh

DB2 创建授权脚本 grantread.sh

原创 数据库开发技术 作者:fjzcau 时间:2015-03-28 20:29:17 0 删除 编辑
--创建授权脚本 grantread.sh
DB=$1
DB_USER=$2
DB_PWD=$3

db2 connect to $DB user $DB_USER using $DB_PWD
db2 "select 'grant select on table ' || rtrim(tabschema) || '.' || tabname || ' to testuser_1; '
from syscat.tables
where tabschema='$DB_USER' " > readauthdb.sql

grep grant readauthdb.sql > read_auth.sql
db2 -tvf read_auth.sql

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22661144/viewspace-1477192/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: DB2 public权限相关
请登录后发表评论 登录
全部评论

注册时间:2011-04-03

  • 博文量
    208
  • 访问量
    547142