【用户管理】之创建角色

创建角色

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角色

3siebel用户没有对systemsysaux的使用权限

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.

 

请使用浏览器的分享功能分享到微信等