set echo off
prompt
prompt ================================================================================
========shell 调用方法

prompt call_grant_dml.sql &1
prompt

==SQL 定义变量,以及执行的sql

set echo off pagesize 0 feedback off verify off serveroutput on size 1000000

define v_input_grantee       = &1

define v_grant_dml_work_file = ./log/grant_dml_work_file_&v_input_grantee..sql

--动态生成执行的sql到变量中

--
-- construct the work file
--
spool &v_grant_dml_work_file
begin
  if ('&v_input_grantee' = '&v_na') then
    dbms_output.put_line('-- Skipping this user ...');
  else

--开始调用gen_grant_dml,并将生成的sql 写入一个文件中。
    dbms_output.put_line('@gen_grant_dml &v_input_grantee');
  end if;
end;
/
spool off
--
-- call the work file
--开始执行这个命令
@&v_grant_dml_work_file

call_grant_dml.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. iOS开发上架之itunes connect里app信息的编辑

    sku用于我们在后台识别自己的app,所以随你怎么填写

  2. jQuery判断滚动条是上滚还是下滚,且是否到达底部或顶部

    jQuery判断滚动条是上滚还是下滚,且是否到达底部或顶部:http://www.haorooms.com/post/jquery_scroll_upanddown //滚动条滚动加载更多内容 //判 ...

  3. SPFA算法与dijkstra算法求单源最短路径的比较

    SPFA是运用队列,把所有的点遍历到没有能更新的,点可以重复入队 如题http://www.cnblogs.com/Annetree/p/5682306.html dijkstra是每次找出离源点最近 ...

  4. CF 602B Approximating a Constant Range

    (●'◡'●) #include<iostream> #include<cstdio> #include<cmath> #include<algorithm& ...

  5. web.py 学习(-)Rocket web框架

    Rocket是一个轻量级,多线程,符合WSGI规范的web框架. Rocket使用一个线程监听连接,接收到连接之后放到Queue中,有worker线程进行处理. Rocket含有以下属性: metho ...

  6. Gitlab命令行指令

    Git global setup git config --global user.name "lh" git config --global user.email "l ...

  7. LeetCode OJ 154. Find Minimum in Rotated Sorted Array II

    Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed? Would ...

  8. LeetCode OJ 55. Jump Game

    Given an array of non-negative integers, you are initially positioned at the first index of the arra ...

  9. TFS 2012使用简介

    为什么使用TFS 2012进行源代码管理——TFS 2012使用简介(一)  来源:雪雁 http://www.cnblogs.com/codelove/archive/2013/03/16/2963 ...

  10. html5学习(二)音频audio

    音频格式 当前,audio 元素支持三种音频格式:   IE 9 Firefox 3.5 Opera 10.5 Chrome 3.0 Safari 3.0 Ogg Vorbis   √ √ √   M ...