1. REM: Script to compile invalid objects in DB after refreshing
  2. REM:
  3. REM:*****************************************
  4. REM:
  5. REM: NOTE: PLEASE TEST THIS SCRIPT BEFORE USE.
  6. REM: Author will not be responsible for any damage that may be cause by this script.
  7. REM:*****************************************
  8.  
  9. set pagesize 0
  10. set feedback off
  11. set trimspool on
  12. prompt
  13. prompt Run the script as sysdba otherwise invalid objects will remain (ORA-01031 error)
  14. prompt
  15. prompt Run the script several times. It only takes long the first time
  16. prompt
  17. prompt check the progress of compilation by issueing from another session
  18. prompt select count(*) "invalid" from dba_objects where status <> 'VALID';
  19. prompt
  20. prompt hit <enter> to continue
  21. pause
  22. spool compile.lis
  23. select 'alter '||object_type||' '||owner||'.\"'||object_name||'\" compile;'
  24. from dba_objects
  25. where status<>'VALID'
  26. and object_type not in ('PACKAGE BODY','TYPE BODY','UNDEFINED','JAVA CLASS','SYNONYM')
  27. union
  28. select 'alter package '||owner||'.'||object_name||' compile body;'
  29. from dba_objects
  30. where status<>'VALID'
  31. and object_type='PACKAGE BODY'
  32. union
  33. select 'alter type '||owner||'.'||object_name||' compile body;'
  34. from dba_objects
  35. where status<>'VALID'
  36. and object_type='TYPE BODY'
  37. union
  38. select 'alter materialized view '||owner||'.'||object_name||' compile;'
  39. from dba_objects
  40. where status<>'VALID'
  41. and object_type='UNDEFINED'
  42. union
  43. select 'alter java class '||owner||'.\"'||object_name||'\" resolve;'
  44. from dba_objects
  45. where status<>'VALID'
  46. and object_type='JAVA CLASS'
  47. union
  48. select 'alter synonym '||owner||'.'||object_name||' compile;'
  49. from dba_objects
  50. where status<>'VALID'
  51. and object_type='SYNONYM'
  52. and owner<>'PUBLIC'
  53. union
  54. select 'alter public synonym '||object_name||' compile;'
  55. from dba_objects
  56. where status<>'VALID'
  57. and object_type='SYNONYM'
  58. and owner='PUBLIC';
  59. spool off
  60. set feedback on

Script to compile invalid objects in DB的更多相关文章

  1. oracle重新编译所有invalid objects

    点第一个,按住shift键点最后一个,右键recompile就OK了

  2. Toad for Oracle 使用文档

    Toad®for Oracle 版本 12.0.1 发行说明 30 July 2013 目录 欢迎使用 Toad for Oracle 版本更新 解决的问题和改进 已知问题 第三方已知问题 升级和兼容 ...

  3. EBS开发技术之Patch安装

     Contents Document Control........................................................................ ...

  4. FNDCPASS Troubleshooting Guide For Login and Changing Applications Passwords

    In this Document   Goal   Solution   1. Error Starting Application Services After Changing APPS Pass ...

  5. Oracle E-Business Suite Maintenance Guide Release 12.2(Patching Utilities)

    更多内容参考: http://docs.oracle.com/cd/E51111_01/current/acrobat/122ebsmt.zip Oracle Patch Application As ...

  6. adpatch options=hotpatch

    --no need to shutdown application and no need to enable maintenance mode adpatch options=hotpatch fi ...

  7. 使用数据泵(expdp、impdp)迁移数据库流程

    转载原文地址为:http://blog.itpub.net/26736162/viewspace-2652256/ 使用数据泵迁移数据库流程 How To Move Or Copy A Databas ...

  8. SQL总结之导入导出

    (5)还原数据库[倒库] [数据泵模式]先要在D盘创建个目录,如D:/dbback 然后去plsql中创建目录sql命令:create directory dbback as 'D:\dbback'; ...

  9. 【12c】扩展数据类型(Extended Data Types)-- MAX_STRING_SIZE

    [12c]扩展数据类型(Extended Data Types)-- MAX_STRING_SIZE 在12c中,与早期版本相比,诸如VARCHAR2, NAVARCHAR2以及 RAW这些数据类型的 ...

随机推荐

  1. Windows下MinGW编译Qt4

    还真不是吹,这个问题折磨我一天……前些天转载了一篇关于<Eclipse+Qt开发环境设置>和<Eclipse+MinGW+Qt开发环境设置>两片文章,里面讲述了QT的开源版本q ...

  2. php练习:给指定商品添加特殊效果

    老板说: 我只要在文本框填1|3 ,那第1和第3个商品都要标注! 思考过程: 有了重要信息1和3,而循环商品时$key按顺序自动递增,那么只要key和信息匹配的话,就判断商品添加标注,这个可以把位置信 ...

  3. Android性能优化典范(转)

    转载自oschina. 2015年伊始,Google发布了关于Android性能优化典范的专题, 一共16个短视频,每个3-5分钟,帮助开发者创建更快更优秀的Android App.课程专题不仅仅介绍 ...

  4. 让android webView使用系统默认浏览器内核直接解析,不弹出选择浏览器选项

    遇到一个需求,要求浏览网页的页面不去启动其他的浏览器,全部在自身的应用中. 解决方法 webview.setWebViewClient(new WebViewClient() { @Override ...

  5. [LeetCode] Decode Ways(DP)

    A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' - ...

  6. 探讨mvc下linq多表查询使用viewModel的问题

    最近在开发mvc3的时候发现了一个问题,就是如何在view页面显示多表查询的数据,最简单的办法就是使用viewmodel了,以下本人使用viewmodel来实现多表查询的3中方法, 先贴代码再说: 1 ...

  7. Android笔记:Socket客户端收发数据

    client.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" and ...

  8. Windows-005-显示隐藏文件

    此文主要讲述如何设置 Win7 系统显示隐藏的文件.文件夹和驱动器,敬请亲们参阅.若有不足之处,敬请大神指正,不胜感激!详情如下: Win7 系统安装完成后,默认是不显示隐藏的文件.文件夹和驱动器的( ...

  9. laravel-v4.0.9

  10. 11月23日《奥威Power-BI报表集成到其他系统》腾讯课堂开课啦

    听说明天全国各地区都要冷到爆了,要是天气冷到可以放假就好了.想象一下大冷天的一定要在被窝里度过才对嘛,索性明天晚上来个相约吧,相约在被窝里看奥威Power-BI公开课如何?        上周奥威公开 ...