zoukankan      html  css  js  c++  java
  • oracle之路(一)user管理;

    1 oracle用户

    Oracle安装会自动的生成sys用户和system用户:

    (1)  sys用户是超级用户,具有最高权限,具有sysdba角色,有createdatabase的权限,该用户默认的密码是change_on_install

    (2)  system用户是管理操作员,权限也很大。具有sysoper角色,没有create database的权限,默认的密码是manager

    (3)  一般讲,对数据库维护,使用system用户登录就可以拉

    也就是说sys和system这两个用户最大的区别是在于有没有create database的权限。

    2 创建用户

    	create user emp
    	identified by a123456;
    当然你可以指定的默认的表空间和临时表空间

    	create uses emp
    	identified by a123456
    	default tablespace users
    	temporary tablespace temp;
    (似乎给定了User表空间 空间中新建有用户就有了DBA的权限。至少在我的本机了是这样的。)

    如果没有去指定表空间,那么如要去链接数据库就要去授权。

    	grant connect to emp;
    	grant create table to emp;//创建表权限
    	grant select on student to emp;//查询表权限
    	grant update on student to emp;//更新表权限
    	grant all on emp to emp;//授权编辑/删除/查询的权限
    


    收回权限:

    	revoke select on student from emp;
    
    如果希望用户能够将权限下放:

    如果是对象权限:

    	grant select on student to emp with grant option
    如果是系统权限:

    	grant select on student to emp with admin option






  • 相关阅读:
    ASP.NET MVC中你必须知道的13个扩展点
    ASP.NET MVC扩展库
    AutoFac简介
    中小型研发团队架构实践十:应用监控怎么做?
    IDEA+Mybatis-generator代码生成工具
    IDEA+EasyCode实现代码生成
    myeclipse中导入的js文件报错(出现红叉叉,提示语法错误)
    Ibatis中常见错误解决方案
    注解
    structs常见错误
  • 原文地址:https://www.cnblogs.com/yangzhi/p/3576548.html
Copyright © 2011-2022 走看看