orcle管理权限_第1页
orcle管理权限_第2页
orcle管理权限_第3页
orcle管理权限_第4页
orcle管理权限_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

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

文档简介

1、oracle 用户权限管理系统的默认用户# sys;/ 系统管理员,拥有最高权限# system;/ 本地管理员,次高权限# scott;/ 普通用户,密码默认为 tiger, 默认未解锁登陆# sqlplus / as sysdba;/ 登陆 sys 帐户# sqlplus sys as sysdba;/ 同上# sqlplus scott/tiger;/ 登陆普通用户 scott管理用户# create user zhangsan;/ 在管理员帐户下,创建用户zhangsan修改密码# alert user scott identified by tiger;/授予权限1 、 默认的普通用

2、户 scott 默认未解锁, 不能进行那个使用,新建的用户也没有任何权限,必须授予权限# grant create session to zhangsan;/ 授 予zhangsan 用户创建 session 的权限,即登陆权限# grant unlimited session to zhangsan;/ 授 予zhangsan 用户使用表空间的权限# grant create table to zhangsan;/授予创建表的权限# grante drop table to zhangsan;/授予删除表的权限# grant insert table to zhangsan;/ 插入表的权限

3、# grant update table to zhangsan;/修改表的权限# grant update(id) on tablename to zhangsan;/授给所有用户 (public)2 、 oralce 对权限管理比较严谨,普通用户之间也是默认不能互相访问的,需要互相授权# grant select on tablename to zhangsan;/ 授予zhangsan 用户查看指定表的权限# grant drop on tablename to zhangsan;/授予删除表的权限# grant insert on tablename to zhangsan;/授予插入

4、的权限# grant update on tablename to zhangsan;/授予修改表的权限# grant insert(id) on tablename to zhangsan;予对指定表特定字段的插入和修改权限,注意,只能是insert 和 update# grant alert all table to zhangsan;/授予 zhangsan用户 alert 任意表的权限撤销权限基本语法同 grant, 关键字为 revoke查看权限查看当前用户所有查看所用用户对表1. select * from user_sys_privs;/权限2. select * from us

5、er_tab_privs;/的权限操作表的用户的表# select * from zhangsan.tablename权限传递即用户 a 将权限授予b , b 可以将操作的权限再授予 c ,命令如下:# grant alert table on tablename to zhangsan withadmin option;/ 关键字 with admin option# grant alert table on tablename to zhangsan withgrant option;/ 关键字 with grant option效果和admin 类似角色角色即权限的集合,可以把一个角色授

6、予给用户# create role myrole;/ 创建角色# grant create session to myrole;/ 将创建 session 的权限授予 myrole# grant myrole to zhangsan;/ 授予 zhangsan 用户myrole 的角色# drop role myrole; 删除角色给用户解锁alter user scott account unlock;给用户改密码alter user scott identified by scott;用户操作的例子create user dltest4 profile defaultidentified

7、by dltest4 default tablespace dltestaccount unlock ;grant connect to dltest4;grant dba to dltest;grant alter any table to dltest;grant create any index to dltest;grant create any procedure to dltest;grant create any table to dltest;grant create any trigger to dltest;grant delete any table to dltest;

8、grant drop any index to dltest;grant drop any procedure to dltest;grant drop any table to dltest;grant drop any trigger to dltest;grant execute any procedure to dltest;grant insert any table to dltest;grant select any table to dltest;grant update any table to dltest;grant execute on dbms_pipeto publ

9、ic ;grant execute on dbms_lock to public ;sqlplus直接链接远程oracle数据库conn sys/12345610.10.10.210:1521/orcl as sysdba(指定端口)conn sys/12345610.10.10.210/orcl as sysdba(默认端口 1521 )限制链接远程oracle数据库通过使用触发器限制ip段链接oracle数据库create or replace trigger chk_ipafter logon on scott.schemadeclareipaddr varchar2 (30);beginselect sys_context( userenv , ip_address ) into ipaddr from dual;if ipaddr like (10.10.10.% ) thenraise_application_error( -20001 ,

温馨提示

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

评论

0/150

提交评论