ITPUB??ì3
订阅ITPUB精粹播报,社区精彩内容不错过
ITPUB论坛 » Oracle数据库管理 » 关于用户授权的问题!


您有 1 条公共消息
  • 来自: 公共消息 标题: ITPUB国庆假期数 ... 内容: 全新编排的Oracle数据库课程,第一线数据库工程师传授亲身经验,完全摆 ...

    标题: 关于用户授权的问题!
    在线/呼叫 rollingpig
    版主


    精华贴数 6
    个人空间 103
    技术积分 30961 (38)
    社区积分 2568 (685)
    注册日期 2001-10-18
    论坛徽章:46
    现任管理团队成员ITPUB年度最佳版主2006年度最佳技术回答2010数据库技术大会纪念徽章ITPUB北京2009年会纪念徽章ITPUB北京九华山庄2008年会纪念徽章
    ITPUB北京香山2007年会纪念徽章管理团队2006纪念徽章2010年世界杯参赛球队:日本2010新春纪念徽章2010新春纪念徽章生肖徽章2007版:鼠

    发表于 2005-5-6 17:27 
    Sorry for mislead of the previos scripts.
    There's a right way to do this
    PHP code:


    1.su_and_grant
    .sql



    set 
    echo off feedback off pagesize 0 linesize 131 heading off termout on verify off

    conn 
    / as sysdba

    column password new_value pwd noprint

    select password from dba_users where username 
    upper('&1');

    alter user &1 identified by &1;

    conn &1/&1

    alter user 
    &1 identified by values '&pwd';

    spo grant.sql

    select

    'grant all on '||object_name||' to apps with grant option;'

    from user_objects

    where object_type in 
    ('TABLE','VIEW','PROCEDURE','PACKAGE','FUNCTION');

    spo off

    @grant





    2. all_user_grant
    .sql



    set 
    echo off feedback off pagesize 0 linesize 131 heading off termout on verify off

    spo su_list
    .sql

     select 
    '@su_and_grant.sql '||username

     from dba_users

     where username not in 
    ('SYS','SYSTEM');

    spo off

    @su_list



    ..

    Create the files above and run the second file in sqlplus.
    You can modify the scripts to where username not in ('SYS','SYSTEM');
    to include or exclude cerntain user.


    __________________

    欢迎访问乐恒的空间
    9/12隆重推出周岁照

    提问的智慧 for Oracle[展开版]
    提问的智慧Oracle版
    0。尝试在google,论坛,metalink,online document里搜索。
    1。写清楚你的执行log,报错信息,写清楚DB version , OS
    2。Instance 方面的问题,请贴出alertlog
    3。network的问题,贴出server的listener.ora , sqlnet.ora 并运行lsnrctl service, 贴出client的tnsnames.ora , sqlnet.ora ,并运行tnsping
    4。DB总体性能问题,请于peak time做statspack,并上传statspack report。同时附上CPU/MEM配置,以及CPU IDLE/free menory的情况
    5。SQL性能问题,列出当前SQL,以及PLAN。同时应提供表结构,index情况,Table的record数。CBO/RBO,table是否analyze等信息。
    6。确保你的问题是Oracle相关。
    欢迎访问乐恒的空间
    只看该作者    顶部
    离线 eygle
    天下有雪


    精华贴数 66
    个人空间 0
    技术积分 208184 (2)
    社区积分 6464 (333)
    注册日期 2001-10-8
    论坛徽章:86
    现任管理团队成员2007年度ITPUB杰出贡献年度精华徽章ITPUB元老ITPUB维基人2010系统架构师大会纪念
    2010数据库技术大会纪念徽章2009架构师大会纪念徽章参与2009年中国云计算大会纪念ITPUB北京2009年会纪念徽章八级虎吧徽章2010新春纪念徽章

    发表于 2005-5-7 09:49 
    在我的留言板里已经回复你了,可以通过dbms_sys_sql.parse_as_user来实现你的需求,通过sys用户运行以下脚本(如果是9i就简单了):
    PHP code:


    declare 

    sqltext     varchar2(200); 

    c         integer

    begin 

    for userlist in (select user_id,username from all_users where username not in ('SYS','SYSTEM','EYGLE')) loop

    for tablelist in (select owner,table_name from dba_tables where owner userlist.usernameloop 

    sqltext 
    := 'grant all on '||tablelist.owner||'.'||tablelist.table_name ||' to eygle with grant option'

    := sys.dbms_sys_sql.open_cursor(); 

    sys.dbms_sys_sql.parse_as_userc,sqltext,dbms_sql.native,userlist.user_id); 

    sys.dbms_sys_sql.close_cursor(c); 

    end loop

    end loop;

    end

    /




    __________________
    只看该作者    顶部
    相关内容


    CopyRight 1999-2006 itpub.net All Right Reserved.
    北京皓辰网域网络信息技术有限公司. 版权所有
    网站律师 隐私政策 知识产权声明
    广播电视节目制作经营许可证:编号(京)字第1149号
    京ICP证:060528号 联系我们

    北京市公安局海淀分局网监中心备案编号:1101082001