set echo off feedback off verify off pagesize 0 linesize 120

define v_grantee                 = &1

define v_grant_exec_command_file = ./log/grant_exec_&v_grantee..sql

define v_grant_exec_log_file     = ./log/grant_exec_&v_grantee..log

spool &v_grant_exec_command_file. prompt

spool &v_grant_exec_log_file.

prompt set echo on feedback on

prompt show user

select
  'grant execute on ' || o.object_name || ' to &v_grantee;' from     user_objects o
where object_type in ('PACKAGE')
and   not exists
  (select null
   from   user_tab_privs p
   where  p.owner      = user
   and    p.table_name = o.object_name
   and    p.grantee    = upper('&v_grantee'))
and user != upper('&v_grantee')
order by o.object_name
/

prompt set echo off feedback off

prompt spool off

spool off

@&v_grant_exec_command_file.

call_grant_exec.sql的更多相关文章

  1. 01_change_schema.sql

    set echo on feedback on spool ./log/01_change_schema.log -- -- schema change to v_idocdata_un -- -- ...

  2. 最近帮客户实施的基于SQL Server AlwaysOn跨机房切换项目

    最近帮客户实施的基于SQL Server AlwaysOn跨机房切换项目 最近一个来自重庆的客户找到走起君,客户的业务是做移动互联网支付,是微信支付收单渠道合作伙伴,数据库里存储的是支付流水和交易流水 ...

  3. SQL Server 大数据搬迁之文件组备份还原实战

    一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 解决方案(Solution) 搬迁步骤(Procedure) 搬迁脚本(SQL Codes) ...

  4. Sql Server系列:分区表操作

    1. 分区表简介 分区表在逻辑上是一个表,而物理上是多个表.从用户角度来看,分区表和普通表是一样的.使用分区表的主要目的是为改善大型表以及具有多个访问模式的表的可伸缩性和可管理性. 分区表是把数据按设 ...

  5. SQL Server中的高可用性(2)----文件与文件组

        在谈到SQL Server的高可用性之前,我们首先要谈一谈单实例的高可用性.在单实例的高可用性中,不可忽略的就是文件和文件组的高可用性.SQL Server允许在某些文件损坏或离线的情况下,允 ...

  6. EntityFramework Core Raw SQL

    前言 本节我们来讲讲EF Core中的原始查询,目前在项目中对于简单的查询直接通过EF就可以解决,但是涉及到多表查询时为了一步到位就采用了原始查询的方式进行.下面我们一起来看看. EntityFram ...

  7. 从0开始搭建SQL Server AlwaysOn 第一篇(配置域控)

    从0开始搭建SQL Server AlwaysOn 第一篇(配置域控) 第一篇http://www.cnblogs.com/lyhabc/p/4678330.html第二篇http://www.cnb ...

  8. 从0开始搭建SQL Server AlwaysOn 第二篇(配置故障转移集群)

    从0开始搭建SQL Server AlwaysOn 第二篇(配置故障转移集群) 第一篇http://www.cnblogs.com/lyhabc/p/4678330.html第二篇http://www ...

  9. 从0开始搭建SQL Server AlwaysOn 第三篇(配置AlwaysOn)

    从0开始搭建SQL Server AlwaysOn 第三篇(配置AlwaysOn) 第一篇http://www.cnblogs.com/lyhabc/p/4678330.html第二篇http://w ...

随机推荐

  1. 自定义UICollectionView

    1.创建一个UICollectionView工程,点击鼠标右侧按钮选择New File->Cocoa Class->点击Next,Class选项填写一个合理的名称,如:MyCollecti ...

  2. 关于C++数组的几点讨论

    数组名为何物? int main() { , , , , }; int *pnumber = number; cout << sizeof(number) << endl; c ...

  3. 在C#中使用反射调用internal的方法

    MSDN上解释Internal如下: The internal keyword is an access modifier for types and type members. Internal t ...

  4. org.hibernate.exception.JDBCConnectionException: could not execute query

    最近在做一个项目,测试的时候是没有问题的,但是放到服务器上以后,第二天就会出现下面的异常.重启Tomcat服务器后就正常了,但是下一天还是会出现同样的异常..... 我就查了一些资料最终把问题给解决了 ...

  5. window.open弹出窗口调用controller

    前台图片调用js函数 <img src='${pageContext.request.contextPath}/FlatUI/img/link.png' id='report' alt='&qu ...

  6. JS调用OC方法

    - (void)myMethod:(CDVInvokedUrlCommand*)command { NSString* echo = [command.arguments objectAtIndex: ...

  7. QProcess 进程类—调用外部程序

    http://blog.csdn.net/newbee520/article/details/8279101   启动一个新的进程的操作非常简单,只需要将待启动的程序名称和启动参数传递给start() ...

  8. myeclipse 之 快捷键

    简单记录一下,新装了个机器,win7系统,想设置一下自己习惯的快捷键 如:ctrl+alt+方向键,复制行,发现设置不上,原先的自带的也失效,设置一下ctrl+alt+其它键,ok可以使用,这说明某些 ...

  9. iptables查看、添加、删除规则

    1.查看iptables -nvL –line-number -L 查看当前表的所有规则,默认查看的是filter表,如果要查看NAT表,可以加上-t NAT参数-n 不对ip地址进行反查,加上这个参 ...

  10. find tar 压缩第一层目录,用于资料备份。

    find *.tar.gz -exec tar zxvf '{}' \;//查找当前目录下的.tar.gz 的文件的 并发送给后面的命令执行find . -maxdepth 1 //查找当前目录下的文 ...