Oracle学习(一)--用户、权限

用户

用户创建:

create user username identified by password;

修改密码:

alter user username identified by newpassword;

或:password new password;

删除用户:

drop user username [cascade];cascade表示级联删除,删除所有用户拥有的对象

配置用户表空间使用配额:

alter user username quota 20m on tablespacename;配置在某个表空间的配额为20m

关于用户的数据字典:(非常有用啊)

dba_users    数据库用户基本信息表

扫描二维码关注公众号,回复: 1729091 查看本文章

dba_sys_privs        已授予用户或角色的系统权限

dba_tab_privs        数据库对象上的所有权限

user_sys_privs        登录用户的系统权限

role_sys_privs        登录用户的角色

all_tables                用户可以查询的基表信息

user_tab_privs       该用户的表的权限分配

all_tab_privs            所有表的权限分配


配置文件

创建配置文件:create profile profilename limit  failed_login_attempts 3 password_lock_time 2;

指定用户配置文件:alter user username profile profilename;



权限

权限分为系统权限和对象权限:

系统权限:针对数据库系统级的存取和使用机制,比如是否能够连接数据库的session权限等,可以方便的使用connect角色直接赋予权限给用户(connect权限包含7项基本的权限)。

例子:grant connect to username;

           revoke connect from username;

对象权限:指针对用户的权限,如其他用户的表、视图、序列、存储过程、函数、包等操作权限。

例子:grant select on scott.emp to username;

            revoke select on scott.emp from username;

with grant option 与 with admin option 的区别:

    with grant option使用于对象权限,with admin option 用于系统权限。

    with grant option的权限被收回时,其赋出的权限也会被收回。 with admin option则不会。

例子:grant connect to username with admin option;

猜你喜欢

转载自blog.csdn.net/astar3/article/details/80314128