ITPUB首页 |  论坛 | 认证专区 | 博客 登录 | 注册
  • 博客访问: 53255
  • 博文数量: 102
  • 用 户 组: 普通用户
  • 注册时间: 2016-10-11 21:42
  • 认证徽章:
文章分类

全部博文(102)

文章存档

2018年(20)

2017年(82)

我的朋友

分类: ERP

2018-01-24 08:25:53


  1. --首先是CPR账号
  2.     --授权表上的读写权限
  3.     select 'grant all on '||owner||'.'||table_name||' to hisuser;' from dba_tables
  4.     where owner = 'CPR';
  5.     
  6.     --授权视图上的读写权限
  7.     select 'grant all on '||owner||'.'||view_name||' to hisuser;' from dba_views
  8.     where owner = 'CPR';

  9.     --授权函数和存储过程的读写权限
  10.     select 'grant execute on '||owner||'.'||name||' to hisuser;' from dba_source
  11.     where owner = 'CPR' and type in ('PROCEDURE','FUNCTION','PACKAGE','PACKAGE BODY','TYPE BODY','TRIGGER','TYPE') ;

  12.     --授权序列的读写权限
  13.     select 'grant all on '||sequence_owner||'.'||sequence_name||' to hisuser;' from dba_sequences where sequence_owner = 'CPR' ;

  14.     --创建同义词
  15.     select 'create or replace public synonym '||synonym_name||' for '||table_owner||'.'||table_name||' ;' from dba_synonyms
  16.     where table_owner='CPR' ;
  17.     select 'create or replace public synonym '||view_name||' for '||owner||'.'||view_name||' ;' from dba_views
  18.     where owner = 'CPR' and (owner NOT LIKE '%$%' OR view_name NOT LIKE '%$%') ;

  19. --然后是system账号
  20.     --授权表上的读写权限
  21.     select 'grant all on '||owner||'.'||table_name||' to hisuser;' from dba_tables
  22.     where owner = 'SYSTEM' and table_name NOT LIKE '%$%';
  23.     
  24.     --授权视图上的读写权限
  25.     select 'grant all on '||owner||'.'||view_name||' to hisuser;' from dba_views
  26.     where owner = 'SYS';    

  27.     --授权函数和存储过程的读写权限
  28.     select DISTINCT 'grant execute on '||owner||'.'||name||' to hisuser;' from dba_source
  29.     where owner = 'SYS' and type in ('PROCEDURE','FUNCTION','PACKAGE','PACKAGE BODY','TYPE BODY','TRIGGER','TYPE') AND name NOT LIKE '%$%'

  30.     --授权序列的读写权限
  31.     select 'grant all on '||sequence_owner||'.'||sequence_name||' to hisuser;' from dba_sequences where sequence_owner = 'SYSTEM' AND sequence_name NOT LIKE '%$%';

  32.     --创建同义词
  33.     select 'create or replace public synonym '||synonym_name||' for '||table_owner||'.'||table_name||' ;' from dba_synonyms
  34.     where table_owner='SYS' and synonym_name NOT LIKE '%$%';
  35.     
  36.     select 'create or replace public synonym '||view_name||' for '||owner||'.'||view_name||' ;' from dba_views
  37.     where owner = 'SYS' and (owner NOT LIKE '%$%' OR view_name NOT LIKE '%$%') ;

阅读(61) | 评论(0) | 转发(0) |
0

上一篇:dba_profiles

下一篇:没有了

给主人留下些什么吧!~~
评论热议
请登录后评论。

登录 注册

友情链接:万达直属QQ  万达娱乐直属QQ  万达娱乐主管  测试  万达主管QQ  万达娱乐开户  万达娱乐招商  万达开户  万达娱乐主管