Oracle的几条常用命令
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://yuanxf.blog.51cto.com/15066/31656 |
++创建用户hillary,密码为window的用户,默认的表空间是users,临时表空间是temp
create user hillary identified by window default tablespace users temporary tablespace temp; ++删除用户
drop user user_name [cascade]; #如果被删除的用户拥有对象,则需要使用cascade关键字 ++修改口令
alter user user_name identified by new_password; password; #仅能修改当前用户的口令 ++锁定/解锁用户 alter user user_name account [lock|unlock]; ++修改默认表空间 alter user user_name default tablespace new_def_tablespace [temporary tablespace new_temp_tablespace]; ++给用户相应权限 grant system_prifvilege[,system_privilege] to user_name [with admin option]; #with admin option表示将要授予系统权限的用户 grant create session to hillary; #授予create session privilege ++查看当前系统用户信息 select username,password from dba_users; ++查看用户的系统权限 connect user/password; select * from user_sys_privs; ++回收系统权限 revoke system_privilege [,system_privilege] from user_name ++为用户授予对象权限 grant object_privilege [(column_name)] on object_name to user_name [with grant option] #object_privilege表示对象权限,column_name表示对象中的列名称,object_name表示指定的对象名称,with grant option 允许该用户将当前的对象权限转授予其他用户. 例:(1)为hillary用户授予对scott.authors表的select/insert/delete的对象权限.命令如下 connect scott/password; grant select,insert,delete on scott.authors to hillary [with grant option]; (2)为hillary授予对scott.authors表中first_name和phone列的更新权限. connect scott/password; grant update (first_name,,phone) on scott.authors to hillary; ++回收授予的对象权限 revoke object_privilege on object_name from user_name connect scott/password; revoke select,insert on scott.authors from hillary; ++角色创建 / 查看角色信息 create role role_name [identified by role_password]; select * from user_role_privs; 本文出自 “分享阳光” 博客,请务必保留此出处http://yuanxf.blog.51cto.com/15066/31656 本文出自 51CTO.COM技术博客 |



yuanxf168
博客统计信息
热门文章
最新评论
友情链接