Home  >  Article  >  Database  >  Oracle新建用户、角色、授权

Oracle新建用户、角色、授权

WBOY
WBOYOriginal
2016-06-07 15:19:521108browse

使用管理员用户登录Oracle: sqlplus/nolog conn/as sysdba 创建用户: create user 用户名 identified by 密码 quota 空间 on uses; 或者 create user 用户名 identified by 密码 ; 删除用户: drop user 用户名; drop user 用户名 cascade; ------删除用户

使用管理员用户登录Oracle:

        

         sqlplus/nolog


         conn/as sysdba


创建用户:


         create user identified by quota on uses;

     或者

         create user identified by ;


删除用户:


         drop user ;


         drop user cascade;          ------删除用户及对象


授权用户:


         Oracle有三种标准角色可以直接方便的授权给用户:

        1、connect  role(连接角色)

                 只赋予connectrole。connect是使用oracle的简单权限,包括select、insert、update和delete等。拥有connect role的用户还能够创建             表、视图、序列(sequence)、簇(cluster)、同义词(synonym )、会话(session)和与其他数据库的链(link)。

           2、resoure  role(资源角色)

                 resource提供给用户另外的权限以创建他们自己的表、序列、过程(procedure)、触发器(trigger)、索引(index)和簇(cluster)。

        3、dba role(数据库管理员角色)

                dba role拥有所有的系统权限----包括无限制的空间限额和给其他用户授予各种权限的能力。system由dba用户拥有。

        

         Oracle可自定义角色:

      create role student;                   -----创建角色

      grant select on class to student;      -----授权角色

       drop role student;                     -----删除角色


      Oracle给用户授权角色:

       

       grant connect,resource to ;

       revoke connect, resource from ;



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn