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','FUNCTION','PROCEDURE')
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.

gen_grant_exec.sql的更多相关文章

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

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

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

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

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

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

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

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

  5. EntityFramework Core Raw SQL

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

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

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

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

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

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

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

  9. 从0开始搭建SQL Server AlwaysOn 第四篇(配置异地机房节点)

    从0开始搭建SQL Server AlwaysOn 第四篇(配置异地机房节点) 第一篇http://www.cnblogs.com/lyhabc/p/4678330.html第二篇http://www ...

随机推荐

  1. CSS3--阴影,渐变,背景图片

    文字阴影.element{ text-shadow:1px 1px 1px #cccccc;}先右再下第一个值:右侧阴影的大小第二个值:下方阴影的大小第三个值:模糊距离(阴影从开始变淡到完全消失的距离 ...

  2. git容易被忽略的准备工作命令

    安装git命令 $ apt-get install git-core 配置用户信息 $ git config --global user.name "wxw" $ git conf ...

  3. RIDE的使用

    在RIDE中,CTRL + R 自动打开report.html , CTRL + L 自动打开 log.html

  4. Kmeans算法与KNN算法的区别

    最近研究数据挖掘的相关知识,总是搞混一些算法之间的关联,俗话说好记性不如烂笔头,还是记下了以备不时之需. 首先明确一点KNN与Kmeans的算法的区别: 1.KNN算法是分类算法,分类算法肯定是需要有 ...

  5. ios电话拨打进行监听电话状态

    #import "ViewController.h" #import <CoreTelephony/CTCallCenter.h> #import <CoreTe ...

  6. XBOX360 硬盘玩游戏

    首先PC端需要到flashFXP这个软件,因为级别不够上传不了就发个下载网站各位自己下一下吧.http://www.oyksoft.com/soft/14875.html#oyksoftdown 好了 ...

  7. C# 16位的GUDI

    引用:  http://www.cnblogs.com/lcwzj/archive/2009/04/16/1436992.html 当我们想要获得一个唯一的key的时候,通常会想到GUID.这个key ...

  8. QTP连接MySQL

    1.首先安装mysql数据驱动,qtp在windows系统下操作连接mysql,所以下载mysql-connector-odbc-   5.1.8-win32.msi 下载地址:http://mysq ...

  9. selenium C#下的zencart自动化测试(WFloginUrlPayment)环境4.0

    using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using Sy ...

  10. Chapter 1 First Sight——34

    "Was that the boy I sat next to in Biology?" I asked artlessly. 你是生物课坐在我旁边的男生吗?我天真烂漫的问道. & ...