ITPub博客

首页 > 数据库 > Oracle > 【用户管理】之创建角色

【用户管理】之创建角色

原创 Oracle 作者:不一样的天空w 时间:2016-10-23 07:21:20 0 删除 编辑

创建角色

1)创建角色sse_role,授予create session 权限

2)创建角色tblo_role,授予CREATE PROCEDURE, CREATE SEQUENCE, CREATE SYNONYM

答:

SQL> create role sse_role;

 

Role created.

 

SQL> grant create session to sse_role;

 

Grant succeeded.

 

SQL> create role tblo_role;

 

Role created.

 

SQL> grant create procedure,create sequence,create synonym,create table,create trigger,create type,create view to tblo_role;

 

Grant succeeded.

 

任务2:创建用户:

1)创建用户siebel,密码oracle

2)授予sse_role,tblo_role角色

3)siebel用户没有对system,sysaux的使用权限

4)默认表空间ts_users,无限制使用此表空间

5)默认临时表空间TMP_GRP

6)使用默认的profile

答:

——查看表空间:

SQL> select TABLESPACE_NAME,CONTENTS from dba_tablespaces;

 

TABLESPACE_NAME                CONTENTS

------------------------------ ---------

SYSTEM                         PERMANENT

SYSAUX                         PERMANENT

UNDOTBS1                       UNDO

TEMP                           TEMPORARY

USERS                          PERMANENT

EXAMPLE                        PERMANENT

 

6 rows selected.

 

SQL> select PROPERTY_NAME,PROPERTY_VALUE from database_properties;

 

PROPERTY_NAME                  PROPERTY_VALUE

------------------------------ ----------------------------------------

DICT.BASE                      2

DEFAULT_TEMP_TABLESPACE        TEMP

DEFAULT_PERMANENT_TABLESPACE   USERS

DEFAULT_EDITION                ORA$BASE

 

——创建表空间:

SQL> create temporary tablespace TMP_GRP tempfile '/u01/app/oracle/oradata/ORA11GR2/tmp_grp01.dbf' size 10m;

 

Tablespace created.

 

SQL> create tablespace ts_users datafile '/u01/app/oracle/oradata/ORA11GR2/ts_users01.dbf' size 100M autoextend on maxsize 4G;

 

Tablespace created.

 

——创建用户:

SQL> create user siebel identified by oracle default tablespace

  2  ts_users temporary tablespace tmp_grp quota 0 on system

  3  quota 0 on sysaux

  4  quota unlimited on ts_users;

 

User created.

 

——授予角色给用户:

SQL> grant sse_role,tblo_role to siebel;

 

Grant succeeded.

 

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

请登录后发表评论 登录
全部评论

注册时间:2016-09-22

  • 博文量
    916
  • 访问量
    1400392