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






  • 相关阅读:
    MVC学习
    Net开源网络爬虫
    js调用wcf 的SOA
    Redis 上实现的分布式锁
    dojo/request
    Python,PyCharm
    如何解决卸载McAfee时出现“处于托管模式时无法删除”问题(转)
    糗事⊙︿⊙
    Oracle exp,imp
    java 生产者消费者问题 并发问题的解决(转)
  • 原文地址:https://www.cnblogs.com/yangzhi/p/3576548.html
Copyright © 2011-2022 走看看