oracle角色及用户.doc_第1页
oracle角色及用户.doc_第2页
oracle角色及用户.doc_第3页
oracle角色及用户.doc_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

oracle角色及用户ORACLE用户数据库系统权限(DataBase System Privilege)数据库对象权限(DataBase System Privilege)Oracle内部用户Sys和System创建用户:create user user01 identified by u01;修改用户:alter user user01 identified by usr01;删除用户:drop user user01;删除用户与其对象:drop user user01 CASCADE;用户授权连接:grant connect,resource to user01;Oracle 3种标准角色:1.Connect Role(连接角色):临时用户,不需要建表的用户。2.Resource Role(资源角色):更可靠和正式的数据库用户。3.Dba Role(数据库管理员角色):拥有所有的系统权限。操作:grant(授权)命令:grant connect,resource to user01; revoke(撤销)命令:revoke connect,resource to user01;创建角色:除了系统自带的3种标准角色外用户可以创建自己的role. create role student;角色授权: grant select on CLASS to student; 注:拥有student角色的用户都具有对CLASS表的select权限。删除角色:drop role student;查看用户有哪些角色:select grant_role from dba_role_privs where grantee=scott;查看用户有哪些权限:select privilege from dba_sys_privs where grantee=scott; select privilege from dba_sys_privs where grantee=CONNECT;默认用户:Sys:oralce中的超级用户,主要用来维护系统信息和管理实例。 System:oracle中默认的系统管理员,拥有dba权限。通常管理oracle数据库的用户、权限和存储等。 Scott:oracle数据库的一个示范账户,在数据库安装时创建。用户授权:grant 权限 on 对象名 to 用户名 with grant option; grant select on scott.emp to user01 with grant option; grant creat session to user01;授予user01用户查看emp表数据的权限1.验证user01对scott用户的emp表进行查询的权限。SQLselect * from scott.emp;2.为用户user01授予scott用户的emp表的查询权限。SQLconn scott/scotttest;SQLgrant select on scott.emp to user01;3.使用user01账户登录并查询scott用户的表emp信息。SQLconn user01/u01test;SQLselect * from scott.emp;收回权限: revoke 权限 on 对象名 from 用户名SQLrevoke select on scott.emp from user01;修改用户密码:alter user 用户名 identified by 新密码;与权限相关的表:1.dba_sys_privs(所有系统权限)2.user_sys_privs(用户拥有的系统权限)3.user_col_privs(用户拥有的对象权限)常用的系统权限赋值语句:SQLgrant create session to user01;SQLgrant create table to user01;SQLgrant unlimited tablespace to user01;SQLgrant create session to public;对象权限的赋予与撤销语句:SQLgrant select on mytable to user01;SQLgrant all on mytable to user01;SQLrevoke select on mytable from user01;SQLrevoke all on mytable from user01;Oracle中除了能在表对象上赋予相应的权限,还能将权限控制到表的列上:SQLgrant update(name) on mytable to user01;SQLgrant insert(id) on mytable to user01;口令管理使用profile管理用户口令profile是口令限制,资源管理的命令集合,当建立数据库时,Oracle会自动建立名词为default的profile。当建立用户没有指定profile选项,那Oroacle就会将default分配给用户。关键字列表:SQLcreate profile 配置文件名称 limit failed_login_attempts 尝试次数 password_lock_time 锁定天数;SQLalter user 用户名 profile 配置文件名称; 例:指定tea用户最多只能尝试3次登陆,锁定时间为2天,下面可以实现。SQLcreate profile lock_account limit failed_login_attempts 3 password_lock_time 2;SQLalter user tea profile lock_account;给账号解锁SQLalter user user01 account unlock;例:为了让用户定期修改密码可使用终止口令完成。SQLcreate profile myprofile limit

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论