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选择性系统授权的更多相关文章

  1. Oracle用户、授权、角色管理

    创建和删除用户是Oracle用户管理中的常见操作,但这其中隐含了Oracle数据库系统的系统权限与对象权限方面的知识.掌握还Oracle用户的授权操作和原理,可以有效提升我们的工作效率. Oracle ...

  2. [Form Builder]Oracle Form系统变量中文版总结大全

    转:http://yedward.net/?id=57 Form中的系统变量,它存在于一个Form的整个运行时期的会话之中,变量包含了有关Form相关属性的字节信息.有些变量标明了当前状态,还有些变量 ...

  3. Oracle财务系统常用标准报表

    http://erpoperator.blog.163.com/blog/static/17899637220111181121616/ Oracle财务系统常用标准报表 总账系统 系统报表名 中文译 ...

  4. 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 ...

  5. Oracle ERP系统借贷关系表

    Oracle ERP系统借贷关系表 成本核算会计信息归纳 按照事务处理的来源类型归纳. 一. 采购接收入库和退货: 1.接收:   借:材料采购 (订单价格) 贷:应计负债 (订单价格) 2.入库: ...

  6. MySql查询系统时间,SQLServer查询系统时间,Oracle查询系统时间

    转自:https://blog.csdn.net/haleyliu123/article/details/70927668/ MySQL查询系统时间 第一种方法:select current_date ...

  7. Oracle 用户、授权、角色管理

    Oracle 用户管理 一.创建用户的Profile文件SQL> create profile student limit // student为资源文件名FAILED_LOGIN_ATTEMP ...

  8. oracle给用户授权

    1.在PLSQL里,用sys(oracle系统用户)登陆,登陆的时候一定要选择SYSDBA.普通用户登陆选择normal就可以了 2.创建用户 *也可以给普通用户授权为dba即数据库管理员.在导入导出 ...

  9. oracle用户管理, 授权与回收权限

    一. 用户管理参数, 0.删除用户: drop user 用户名 [cascade] 当我们删除用户时, 如改用户已创建过数据对象, 那么删除用户时必须加cascade参数, 用来同步删除 改用户的所 ...

随机推荐

  1. Kernel 4.9的BBR拥塞控制算法与锐速

    重要的事情说三遍! BBR并不能突破带宽限制!!! BBR并不能突破带宽限制!!! BBR并不能突破带宽限制!!! 它的功能如下: 1.在高丢包率与低速率的网络中提升传输效果,充分利用带宽. 2.降低 ...

  2. Spring使用注解方式注入多例的方式

    目前Spring+Netty的开发方式这么火热,想把Netty注册成Spring组件就一定得用多例的方式,我不由得想吐槽明明这么常见的需求网上相关博客都少的很,这里给出Spring使用注解注入多例的方 ...

  3. ICE::Handle 使用崩溃问题

    简单例子如下: #include "Ice/Ice.h" #include "IceUtil/IceUtil.h" #include "Printer ...

  4. Anaconda、Miniconda、Conda、pip的相互关系_我是刘振岗_新浪博客

    Anaconda.Miniconda.Conda.pip的相互关系_我是刘振岗_新浪博客 http://blog.sina.com.cn/s/blog_8a122dcf0102x9vn.html

  5. CF 222 (DIV 1)

    A: 我是bfs出一颗树,然后删掉树后面的k个结点. 其实也可以直接bfs出一块连通的s - k个点,其余的.打X就可以了. 很水的题目. /* *************************** ...

  6. HDU 4436 str2int (后缀自动机SAM,多串建立)

    str2int Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total S ...

  7. LPC18xx/43xx OTP Controller driver

    LPC18xx/43xx OTP Controller driver /* * @brief LPC18xx/43xx OTP Controller driver * * @note * Copyri ...

  8. STM32 F4 SPI Accelerometer

    STM32 F4 SPI Accelerometer

  9. 使用filezilla server搭建FTP服务器

    参考文献 http://www.pc6.com/infoview/Article_51961_all.html 背景 需要在内网环境下搭建一个FTP服务器,查阅相关资料发现使用filezilla se ...

  10. oracle 删除字段中空格

    update  sales_report set region =  REGEXP_REPLACE(region,  '( ){1,}', '')