set echo off pagesize 0 feedback off

define v_input_un       = &1
define v_input_pw       = &2
define v_input_conn_str = &3

connect &v_input_un/&v_input_pw@&v_input_conn_str

define v_compile_command_file = .\log\compile_&v_input_un..sql

define v_compile_log_file     = .\log\compile_&v_input_un..log

spool &v_compile_command_file
prompt spool &v_compile_log_file
prompt show user
prompt set echo on feedback on pagesize 999

select   'alter ' || o.object_type ||  ' "'
         || o.object_name || '" compile;'
from     user_objects o
where    o.object_type not like '% BODY'
and      o.object_type not in ('UNDEFINED', 'JAVA CLASS')
and      o.status = 'INVALID'
order by decode(o.object_type
              , 'VIEW',      1
              , 'TYPE',      2
              , 'FUNCTION',  3
              , 'PROCEDURE', 4
              , 'PACKAGE',   5
              , 999)
       , o.object_name
/

select   'alter ' ||
         substr(o.object_type, 1, instr(o.object_type, ' ') - 1)
         ||  ' "'
         || o.object_name || '" compile body;'
from     user_objects o
where    o.object_type like '% BODY'
and      o.object_type not in ('UNDEFINED', 'JAVA CLASS')
and      o.status = 'INVALID'
order by decode(o.object_type
              , 'VIEW',      1
              , 'TYPE',      2
              , 'FUNCTION',  3
              , 'PROCEDURE', 4
              , 'PACKAGE',   5
              , 999)
       , o.object_name
/

prompt

prompt select * from user_errors order by 1, 2, 3

prompt /

prompt spool off spool off

@&v_compile_command_file

gen_compile.sql的更多相关文章

  1. call_compile.sql

    set echo off prompt prompt ========================================================================= ...

  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. 还原openstack配置文件的方法

    cp -a /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bakcp -a /etc/neutron/plugins/ml2/ml2_conf ...

  2. HDU 3081 Marriage Match II

    二分图的最大匹配+并查集 每次匹配完之后,删除当前匹配到的边. #include<cstdio> #include<cstring> #include<cmath> ...

  3. webform在页面生成的代码与事件回传

    <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['form1'] ...

  4. VBS基础篇 - 对象(1) - Class对象

    VBS基础篇 - 对象(1) - Class对象   相信对JAVA有一定了解的朋友一定对类这个名词不陌生,但是大家可能没有想过在VBS中使用Class类吧,其实Class类在自动化测试中是相当常用的 ...

  5. 在Dll中创建对话框并调用

    1.第一步创建一“MFC AppWizard (dll)”工程,接下来选择“Regular Dll using shared MFC DLL”,点击“Finish”. 2.添加一对话框资源到工程中,从 ...

  6. JavaScript shift() 方法

    http://www.w3school.com.cn/jsref/jsref_shift.asp 定义和用法 shift() 方法用于把数组的第一个元素从其中删除,并返回第一个元素的值. 语法 arr ...

  7. hdu_2899_Strange fuction(三分查找)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2899 题意:让你解方程 题解:对于只有一个凸或者没有凸的图像,可以直接上三分解决. #include& ...

  8. org.springframework.transaction.CannotCreateTransactionException

    HTTP Status 500 - Request processing failed; nested exception is org.springframework.transaction.Can ...

  9. IBM Mq Spring JMS 的xml配置

    <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...

  10. php 获取地址栏参数

    javascript实现: top.location.href 顶级窗口的地址this.location.href 当前窗口的地址 PHP实现: //获取域名或主机地址 echo $_SERVER[' ...