sqlplus "/as sysdba"
@$ORACLE_HOME\RDBMS\ADMIN\utlrp.sql; this script will compile all invalid objects in database
自己编写的一个脚本
$ more check.sql
set head off
set pagesize 2000
spool comp.sql
select ‘alter ‘||decode(object_type, ‘VIEW‘, ‘VIEW‘,‘TRIGGER‘,‘TRIGGER‘,
‘PROCEDURE‘, ‘PROCEDURE‘, ‘FOUNCTION‘,‘FUNCTION‘,
‘PACKAGE‘,‘PACKAGE‘, ‘PACKAGE BODY‘, ‘PACKAGE‘, ‘MATERIALIZED VIEW‘)
||‘ ‘||owner||‘.‘||object_name||‘ compile ‘||
decode(object_type, ‘PACKAGE BODY‘, ‘ BODY‘)||‘;‘
from dba_objects
where status like ‘INV%‘;
spool off
在ORACLE_HOME下创建check.sql
sqlplus / as sysdba
@check.sql
@comp.sql
时间: 2024-10-26 02:52:43