Script to compile invalid objects in DB
- REM: Script to compile invalid objects in DB after refreshing
- REM:
- REM:*****************************************
- REM:
- REM: NOTE: PLEASE TEST THIS SCRIPT BEFORE USE.
- REM: Author will not be responsible for any damage that may be cause by this script.
- REM:*****************************************
- set pagesize 0
- set feedback off
- set trimspool on
- prompt
- prompt Run the script as sysdba otherwise invalid objects will remain (ORA-01031 error)
- prompt
- prompt Run the script several times. It only takes long the first time
- prompt
- prompt check the progress of compilation by issueing from another session
- prompt select count(*) "invalid" from dba_objects where status <> 'VALID';
- prompt
- prompt hit <enter> to continue
- pause
- spool compile.lis
- select 'alter '||object_type||' '||owner||'.\"'||object_name||'\" compile;'
- from dba_objects
- where status<>'VALID'
- and object_type not in ('PACKAGE BODY','TYPE BODY','UNDEFINED','JAVA CLASS','SYNONYM')
- union
- select 'alter package '||owner||'.'||object_name||' compile body;'
- from dba_objects
- where status<>'VALID'
- and object_type='PACKAGE BODY'
- union
- select 'alter type '||owner||'.'||object_name||' compile body;'
- from dba_objects
- where status<>'VALID'
- and object_type='TYPE BODY'
- union
- select 'alter materialized view '||owner||'.'||object_name||' compile;'
- from dba_objects
- where status<>'VALID'
- and object_type='UNDEFINED'
- union
- select 'alter java class '||owner||'.\"'||object_name||'\" resolve;'
- from dba_objects
- where status<>'VALID'
- and object_type='JAVA CLASS'
- union
- select 'alter synonym '||owner||'.'||object_name||' compile;'
- from dba_objects
- where status<>'VALID'
- and object_type='SYNONYM'
- and owner<>'PUBLIC'
- union
- select 'alter public synonym '||object_name||' compile;'
- from dba_objects
- where status<>'VALID'
- and object_type='SYNONYM'
- and owner='PUBLIC';
- spool off
- set feedback on
Script to compile invalid objects in DB的更多相关文章
- oracle重新编译所有invalid objects
点第一个,按住shift键点最后一个,右键recompile就OK了
- Toad for Oracle 使用文档
Toad®for Oracle 版本 12.0.1 发行说明 30 July 2013 目录 欢迎使用 Toad for Oracle 版本更新 解决的问题和改进 已知问题 第三方已知问题 升级和兼容 ...
- EBS开发技术之Patch安装
Contents Document Control........................................................................ ...
- FNDCPASS Troubleshooting Guide For Login and Changing Applications Passwords
In this Document Goal Solution 1. Error Starting Application Services After Changing APPS Pass ...
- 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 ...
- adpatch options=hotpatch
--no need to shutdown application and no need to enable maintenance mode adpatch options=hotpatch fi ...
- 使用数据泵(expdp、impdp)迁移数据库流程
转载原文地址为:http://blog.itpub.net/26736162/viewspace-2652256/ 使用数据泵迁移数据库流程 How To Move Or Copy A Databas ...
- SQL总结之导入导出
(5)还原数据库[倒库] [数据泵模式]先要在D盘创建个目录,如D:/dbback 然后去plsql中创建目录sql命令:create directory dbback as 'D:\dbback'; ...
- 【12c】扩展数据类型(Extended Data Types)-- MAX_STRING_SIZE
[12c]扩展数据类型(Extended Data Types)-- MAX_STRING_SIZE 在12c中,与早期版本相比,诸如VARCHAR2, NAVARCHAR2以及 RAW这些数据类型的 ...
随机推荐
- Windows下MinGW编译Qt4
还真不是吹,这个问题折磨我一天……前些天转载了一篇关于<Eclipse+Qt开发环境设置>和<Eclipse+MinGW+Qt开发环境设置>两片文章,里面讲述了QT的开源版本q ...
- php练习:给指定商品添加特殊效果
老板说: 我只要在文本框填1|3 ,那第1和第3个商品都要标注! 思考过程: 有了重要信息1和3,而循环商品时$key按顺序自动递增,那么只要key和信息匹配的话,就判断商品添加标注,这个可以把位置信 ...
- Android性能优化典范(转)
转载自oschina. 2015年伊始,Google发布了关于Android性能优化典范的专题, 一共16个短视频,每个3-5分钟,帮助开发者创建更快更优秀的Android App.课程专题不仅仅介绍 ...
- 让android webView使用系统默认浏览器内核直接解析,不弹出选择浏览器选项
遇到一个需求,要求浏览网页的页面不去启动其他的浏览器,全部在自身的应用中. 解决方法 webview.setWebViewClient(new WebViewClient() { @Override ...
- [LeetCode] Decode Ways(DP)
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' - ...
- 探讨mvc下linq多表查询使用viewModel的问题
最近在开发mvc3的时候发现了一个问题,就是如何在view页面显示多表查询的数据,最简单的办法就是使用viewmodel了,以下本人使用viewmodel来实现多表查询的3中方法, 先贴代码再说: 1 ...
- Android笔记:Socket客户端收发数据
client.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" and ...
- Windows-005-显示隐藏文件
此文主要讲述如何设置 Win7 系统显示隐藏的文件.文件夹和驱动器,敬请亲们参阅.若有不足之处,敬请大神指正,不胜感激!详情如下: Win7 系统安装完成后,默认是不显示隐藏的文件.文件夹和驱动器的( ...
- laravel-v4.0.9
- 11月23日《奥威Power-BI报表集成到其他系统》腾讯课堂开课啦
听说明天全国各地区都要冷到爆了,要是天气冷到可以放假就好了.想象一下大冷天的一定要在被窝里度过才对嘛,索性明天晚上来个相约吧,相约在被窝里看奥威Power-BI公开课如何? 上周奥威公开 ...