Home > Database > Mysql Tutorial > body text

Oracle 权限管理入门

WBOY
Release: 2016-06-07 16:56:11
Original
838 people have browsed it

1.启动监听:lsnrctl start 2.启动oracle实例:oradim -startup -sid orcl(oracle实例名) 3.用户登录到oracle数据库:sq

  1.启动监听:lsnrctl start

  2.启动Oracle实例:oradim -startup -sid orcl(oracle实例名)

  3.用户登录到oracle数据库:sqlplus username/password

  4.dba(默认是sys)登录到数据库:sqlplus username/password as sysdba  ,,默认的dba账号和密码可以是 sqlplus / as sysdba

  5.创建用户:create user username identified by password(此时用户已经创建,但是不能登录到oracle数据库)

  6.授予用户create session的权限:grant create session to username (此时用户可以登录数据库,但是不能创建表)

  7.授予用户创建table的权限:grant create table to username (此时的用户理论上是可以创建表的,但是没有权限使用表空间,所有依然不能成功创建表)

  8.授予用户无限制的使用表空间的权限:grant unlimited tablespace to username

  9.撤销权限:revoke 权限名 from username

  10.查询当前用户所拥有的权限:select * from user_sys_privs

  11.查询当前用户所拥有表的权限:select * from user_tab_privs

  12.查询当前用户所拥有列的权限:select * from user_col_privs

  13.对象权限的授权: grant 操作权限 on username.table to anotherusername(谁拥有这个对象权限就能授权给别人)

  14.对象权限的赊销: revoke 操作权限 on username.table from anotherusername

  15.把某个权限(不分对象还是系统权限)授予给所有的用户: grant 权限 to public

  16.把权限精确到列上面:grant 权限(columnName) on tableName to username ,注意查询和删除不能精确到列上面

linux

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template