以上catupgrd.sql脚本运行了50分钟左右,执行完之后会shutdown immediate数据库。这个时候我们将要重启数据库运行utlrp.sql脚本编译失效对象:
12、运行utlrp.sql编译失效对象
[oracle@db01 dbs]$ sqlplus /as sysdba SQL*Plus: Release 11.2.0.4.0Production on Sat Oct 4 04:11:22 2014 Copyright (c) 1982, 2013,Oracle. All rights reserved. Connected to an idleinstance. SQL> startup ORACLE instance started. Total System Global Area 2872786944bytes Fixed Size 2256712 bytes Variable Size 2634023096 bytes Database Buffers 218103808 bytes Redo Buffers 18403328 bytes Database mounted. Database opened. SQL> @?/rdbms/admin/utlrp TIMESTAMP -------------------------------------------------------------------------------- COMP_TIMESTAMPUTLRP_BGN 2014-10-04 04:14:57 DOC> The following PL/SQL block invokesUTL_RECOMP to recompile invalid DOC> objects in the database. Recompilation timeis proportional to the DOC> number of invalid objects in the database,so this command may take DOC> a long time to execute on a database with alarge number of invalid DOC> objects. DOC> DOC> Use the following queries to trackrecompilation progress: DOC> DOC> 1. Query returning the number of invalidobjects remaining. This DOC> number should decrease with time. DOC> SELECT COUNT(*) FROM obj$ WHERE statusIN (4, 5, 6); DOC> DOC> 2. Query returning the number of objectscompiled so far. This number DOC> should increase with time. DOC> SELECT COUNT(*) FROMUTL_RECOMP_COMPILED; DOC> DOC> This script automatically chooses serial orparallel recompilation DOC> based on the number of CPUs available(parameter cpu_count) multiplied DOC> by the number of threads per CPU (parameterparallel_threads_per_cpu). DOC> On RAC, this number is added across all RACnodes. DOC> DOC> UTL_RECOMP uses DBMS_SCHEDULER to createjobs for parallel DOC> recompilation. Jobs are created withoutinstance affinity so that they DOC> can migrate across RAC nodes. Use thefollowing queries to verify DOC> whether UTL_RECOMP jobs a