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. span设置宽和高当没有内容的时候也可以撑开

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. 常见的jquery一些效果

    1.CSS渐变:background: linear-gradient(to bottom right, #999 , #eee);

  3. 在线GET/POST API接口请求模拟测试工具

    在前后端开发过程中经常需要对HTTP接口进行测试,推荐几款比较好用的测试工具 Postman https://www.getpostman.com/ 强大的HTTP请求测试工具 支持多平台 Advan ...

  4. spark java 代码example

    https://github.com/apache/spark/tree/master/examples/src/main/java/org/apache/spark/examples

  5. LeetCode OJ 292.Nim Gam19. Remove Nth Node From End of List

    Given a linked list, remove the nth node from the end of list and return its head. For example, Give ...

  6. Android Studio的使用(十四)--如何查看资源或者函数在哪些类中被引用

    1.我们都知道在Eclipse中可以通过快捷键Ctrl+Shift+G开快速搜索方法.类.资源都在那个类中被使用了. 2.在Android Studio中则使用快捷键Ctrl+G.

  7. LCA-倍增法(在线)O(nlogn)-O(logn)

    1. DFS预处理出所有节点的深度和父节点 inline void dfs(int u) { int i; ;i=next[i]) { if (!deep[to[i]]) { deep[to[i]] ...

  8. 调试minix内核

    调试的时候,要把电脑当作单片机来使用,故先需要添加串口,方便进行打印调试 http://wiki.minix3.org/doku.php?id=developersguide:serialout 1. ...

  9. 百度,google的地理编码

    1.百度的地理编码:(不支持中国以外的其它城市) http://api.map.baidu.com/geocoder/v2/?ak=E974997f80db18330f8f5c61d084a677&a ...

  10. ubuntu 上下载PHP的源代码

    参考: https://vpsineu.com/blog/how-to-build-and-install-php-5-6-9-from-source-on-ubuntu-14-04-vps/ 直接 ...