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的更多相关文章

  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. SQLite.net发布后找不到"SQLite.Interop.dll"的问题

    http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki sqlite-netFx40-static-binary-b ...

  2. imx6 android 进入文件系统闪屏

    imx6进入文件系统的时候都会闪屏,应该是framebuffer未初始化,就已经打开了背光.目前解决办法,在kenel阶段关闭背光,显示android的开机动画之后(此时framebuffer已经初始 ...

  3. Java 日志管理最佳实践

    转:http://blog.jobbole.com/51155/ 日志记录是应用程序运行中必不可少的一部分.具有良好格式和完备信息的日志记录可以在程序出现问题时帮助开发人员迅速地定位错误的根源.对于开 ...

  4. Task+http请求

    Task+http请求  这个算是一个简单的事例吧

  5. net Datable 基本操作

    net Datable 基本操作 using System; using System.Collections.Generic; using System.Text; using System.Dat ...

  6. LeetCode Fraction to Recurring Decimal

    原题链接在这里:https://leetcode.com/problems/fraction-to-recurring-decimal/ 题目: Given two integers represen ...

  7. How to read the HTML DTD

    Contents How to read the HTML DTD 1. DTD Comments 2. Parameter Entity definitions 3. Element declara ...

  8. JQuery:JQuery操作CSS类

    JQuery:CSS类jQuery - 获取并设置 CSS 类,通过 jQuery,可以很容易地对 CSS 元素进行操作.jQuery 操作 CSSjQuery 拥有若干进行 CSS 操作的方法.我们 ...

  9. 一些常用的linux命令

    查看本机ip地址 ifconfig ln -s phpmyadmin 添加链接 /var/www/  与html  同级 打开本机电脑硬盘: cd /media/用户名 文件夹的新建命令: sudo ...

  10. 针对大的sql文件删除行操作

    今天处理开发已导出的库的一个sql文件.未gzip压缩 ,1.3G 需要删除 17 18 24行的SET行. 想到了两个办法 1  sed 方法 主意 由于 sed 虽然指定行 进行 替换, 也会读完 ...