Oracle选择性系统授权
Selective System Grants
问题:
我只想授予XX用户alter system set user_dump_dest 权限!
I want to give users the ability to execute "alter system set user_dump_dest" only. I want to give them the ability to turn on extended tracing but write out the trace files to a different directory, such as /tmp, rather than to the default directory. Is there a way to do this easily?
Tom回答:
存储过程是绝佳方案!
Stored procedures are great for this!
存储过程,默认以定义者权限运行。你需要做的就是:
A stored procedure, by default, runs with the base privileges of the definer of the routine. As a user with the ability to use ALTER SYSTEM , all you need to do is
create or replace procedure set_udump (p_udump in varchar2)
as
begin
if ( p_udump NOT LIKE '%=%' )
then
execute immediate 'alter system set
user_dump_dest = '''||p_udump||''' scope=memory';
else
raise_application_error(-20000,'Sorry, but for safety
reasons this procedure does not allow "=" in the parameter value');
end if;
end;
/
防止SQL注入攻击!
Note: Revised content—to prevent SQL injection—for this procedure submitted by Roy Jorgensen.
The owner of the procedure needs to have ALTER SYSTEM granted directly, not via a role. Seeasktom.oracle.com/~tkyte/Misc/RolesAndProcedures.htmlfor details on that nuance. So we run
SQL> grant alter system to a;
Grant succeeded. SQL> grant execute on set_udump to scott;
Grant succeeded.
Now, connected as SCOTT , run
SQL> exec set_udump( '/tmp' );
PL/SQL procedure successfully
completed.
这种途径提供优秀的安全机制。
This approach works for any privilege you want to grant selectively like this. Stored procedures—with their ability to run as definer—provide an excellent security mechanism!
Oracle选择性系统授权的更多相关文章
- Oracle用户、授权、角色管理
创建和删除用户是Oracle用户管理中的常见操作,但这其中隐含了Oracle数据库系统的系统权限与对象权限方面的知识.掌握还Oracle用户的授权操作和原理,可以有效提升我们的工作效率. Oracle ...
- [Form Builder]Oracle Form系统变量中文版总结大全
转:http://yedward.net/?id=57 Form中的系统变量,它存在于一个Form的整个运行时期的会话之中,变量包含了有关Form相关属性的字节信息.有些变量标明了当前状态,还有些变量 ...
- Oracle财务系统常用标准报表
http://erpoperator.blog.163.com/blog/static/17899637220111181121616/ Oracle财务系统常用标准报表 总账系统 系统报表名 中文译 ...
- oracle 对系统日期sysdate进行格式化:to_date(sysdate,'yyyy-MM-dd')
oracle 对系统日期sysdate进行格式化:to_date(sysdate,'yyyy-MM-dd') CreateTime--2018年5月17日10:11:34 Author:Maryd ...
- Oracle ERP系统借贷关系表
Oracle ERP系统借贷关系表 成本核算会计信息归纳 按照事务处理的来源类型归纳. 一. 采购接收入库和退货: 1.接收: 借:材料采购 (订单价格) 贷:应计负债 (订单价格) 2.入库: ...
- MySql查询系统时间,SQLServer查询系统时间,Oracle查询系统时间
转自:https://blog.csdn.net/haleyliu123/article/details/70927668/ MySQL查询系统时间 第一种方法:select current_date ...
- Oracle 用户、授权、角色管理
Oracle 用户管理 一.创建用户的Profile文件SQL> create profile student limit // student为资源文件名FAILED_LOGIN_ATTEMP ...
- oracle给用户授权
1.在PLSQL里,用sys(oracle系统用户)登陆,登陆的时候一定要选择SYSDBA.普通用户登陆选择normal就可以了 2.创建用户 *也可以给普通用户授权为dba即数据库管理员.在导入导出 ...
- oracle用户管理, 授权与回收权限
一. 用户管理参数, 0.删除用户: drop user 用户名 [cascade] 当我们删除用户时, 如改用户已创建过数据对象, 那么删除用户时必须加cascade参数, 用来同步删除 改用户的所 ...
随机推荐
- 026.Zabbix简单调优
一 调优相关对应项 Zabbix busy trapper processes, in % StartTrappers=5 Zabbix busy poller processes, in % Sta ...
- 006.FTP用户访问控制配置
一 FTP控制文件 1.1 文件说明 /etc/vsftpd/ftpusers:黑名单,优先级高 #通常不修改此文件 /etc/vsftpd/user_list:黑名单,优先级相对低 注意:Linux ...
- HTML5本地存储localStorage、sessionStorage及IE专属UserData
By:王美建 from:http://www.cnblogs.com/wangmeijian/p/4518606.html 转载请保留署名和出处! 在客户端存储数据用的最普遍的方式非cookie莫属, ...
- 使用Vmware安装linux且配置终端可以连接虚拟机总结
首先是下载一个linux镜像,我下载的是:ubuntu-16.04.2-desktop-amd64.iso 1.使用vmware安装linux,都使用默认的配置就行了,最多改一下主机名什么的,密码最好 ...
- hdu 2710 水题
题意:判断一些数里有最大因子的数 水题,省赛即将临近,高效的代码风格需要养成,为了简化代码,以后可能会更多的使用宏定义,但是通常也只是快速拿下第一道水题,涨自信.大部分的代码还是普通的形式,实际上能简 ...
- RubyMine8 安装
在win7下面安装RubyMine8 中文 汉化 1.需要下载 RubyMine8的程序包 2.先安装好 RubyMine8 很简单 点击下一步就可以 选择安装目录这应该就不需要说了 3.汉化 ...
- word标题编号与上一级不一致的解决方法
前段时间时间就遇到了这个问题,情形如下: 1.标题内容一 1.1二级标题 1.2二级标题 2.第二个一级标题 1.3第二个一级下的二级标题 1.4.就这样乱了 当时搜索一通后很容易就解决了……于是忘记 ...
- 使用CefSharp在.Net程序中嵌入Chrome浏览器(三)——基本操作
CefSharp本身提供了WPF和WinForm两个版本的控件,这两个版本的控件使用方法大同小异,由于我WPF的版本用的较多,这里就简单的介绍下WPF版的CEFSharp控件的用法. 加载页面: Ch ...
- PE Header and Export Table for Delphi
Malware Analysis Tutorial 8: PE Header and Export Table 2. Background Information of PE HeaderAny bi ...
- flashsim配置2015最新版本
http://blog.csdn.net/Eidosper/article/details/46458469 http://www.doc88.com/p-7314277317013.html htt ...