Grant all privileges to user on Oracle schema

前端 未结 2 1019
忘掉有多难
忘掉有多难 2021-02-06 09:14

Is there a way to grant all privileges to a user on Oracle schema? I tried the following command but it only grants permission on specific tables in a schema. What I want is to

2条回答
  •  盖世英雄少女心
    2021-02-06 10:09

    If you want to grant privileges to all tables in a specific schema:

        BEGIN
        FOR x IN (select *from all_tables where OWNER = 'schema name')
        LOOP   
         EXECUTE IMMEDIATE 'GRANT SELECT ON '||x.OWNER||'.'|| x.table_name || TO 'user name'; 
        END LOOP;
        END;
    

提交回复
热议问题