{"id":172,"date":"2008-03-15T16:08:00","date_gmt":"2008-03-15T19:08:00","guid":{"rendered":"http:\/\/www.soudba.com.br\/?p=172"},"modified":"2008-03-15T16:08:00","modified_gmt":"2008-03-15T19:08:00","slug":"recompilar-todos-objetos-invalidos-de-todos-esquemas","status":"publish","type":"post","link":"https:\/\/www.soudba.com.br\/?p=172","title":{"rendered":"Recompilar todos objetos invalidos de todos esquemas"},"content":{"rendered":"<p>Use sempre a $ORACLE_HOME\/rdbms\/admin\/ultrp.sql <\/p>\n<p>sqlplus \/ as sysdba<\/p>\n<p>sql&gt;@$ORACLE_HOME\/rdbms\/admin\/ultrp.sql;<\/p>\n<p>Conectado a:<br \/>Oracle Database 10g Express Edition Release 10.2.0.1.0 &#8211; Production<\/p>\n<p>SQL&gt; @C:oraclexeapporacleproduct10.2.0serverRDBMSADMINutlrp.sql<\/p>\n<p>TIMESTAMP<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>COMP_TIMESTAMP UTLRP_BGN  2008-03-15 16:01:59<\/p>\n<p>DOC&gt;   The following PL\/SQL block invokes UTL_RECOMP to recompile invalid<br \/>DOC&gt;   objects in the database. Recompilation time is proportional to the<br \/>DOC&gt;   number of invalid objects in the database, so this command may take<br \/>DOC&gt;   a long time to execute on a database with a large number of invalid<br \/>DOC&gt;   objects.<br \/>DOC&gt;<br \/>DOC&gt;   Use the following queries to track recompilation progress:<br \/>DOC&gt;<br \/>DOC&gt;   1. Query returning the number of invalid objects remaining. This<br \/>DOC&gt;      number should decrease with time.<br \/>DOC&gt;         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);<br \/>DOC&gt;<br \/>DOC&gt;   2. Query returning the number of objects compiled so far. This number<br \/>DOC&gt;      should increase with time.<br \/>DOC&gt;         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;<br \/>DOC&gt;<br \/>DOC&gt;   This script automatically chooses serial or parallel recompilation<br \/>DOC&gt;   based on the number of CPUs available (parameter cpu_count) multiplied<br \/>DOC&gt;   by the number of threads per CPU (parameter parallel_threads_per_cpu).<br \/>DOC&gt;   On RAC, this number is added across all RAC nodes.<br \/>DOC&gt;<br \/>DOC&gt;   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel<br \/>DOC&gt;   recompilation. Jobs are created without instance affinity so that they<br \/>DOC&gt;   can migrate across RAC nodes. Use the following queries to verify<br \/>DOC&gt;   whether UTL_RECOMP jobs are being created and run correctly:<br \/>DOC&gt;<br \/>DOC&gt;   1. Query showing jobs created by UTL_RECOMP<br \/>DOC&gt;         SELECT job_name FROM dba_scheduler_jobs<br \/>DOC&gt;            WHERE job_name like &#8216;UTL_RECOMP_SLAVE_%&#8217;;<br \/>DOC&gt;<br \/>DOC&gt;   2. Query showing UTL_RECOMP jobs that are running<br \/>DOC&gt;         SELECT job_name FROM dba_scheduler_running_jobs<br \/>DOC&gt;            WHERE job_name like &#8216;UTL_RECOMP_SLAVE_%&#8217;;<br \/>DOC&gt;#<\/p>\n<p>Procedimento PL\/SQL conclu\u03c6do com sucesso.<\/p>\n<p>TIMESTAMP<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>COMP_TIMESTAMP UTLRP_END  2008-03-15 16:02:05<\/p>\n<p>Procedimento PL\/SQL conclu\u03c6do com sucesso.<\/p>\n<p>DOC&gt; The following query reports the number of objects that have compiled<br \/>DOC&gt; with errors (objects that compile with errors have status set to 3 in<br \/>DOC&gt; obj$). If the number is higher than expected, please examine the error<br \/>DOC&gt; messages reported with each object (using SHOW ERRORS) to see if they<br \/>DOC&gt; point to system misconfiguration or resource constraints that must be<br \/>DOC&gt; fixed before attempting to recompile these objects.<br \/>DOC&gt;#<\/p>\n<p>OBJECTS WITH ERRORS<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>                  0<\/p>\n<p>DOC&gt; The following query reports the number of errors caught during<br \/>DOC&gt; recompilation. If this number is non-zero, please query the error<br \/>DOC&gt; messages in the table UTL_RECOMP_ERRORS to see if any of these errors<br \/>DOC&gt; are due to misconfiguration or resource constraints that must be<br \/>DOC&gt; fixed before objects can compile successfully.<br \/>DOC&gt;#<\/p>\n<p>ERRORS DURING RECOMPILATION<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>                          0<\/p>\n<p>Procedimento PL\/SQL conclu\u03c6do com sucesso.<\/p>\n<p>Advert\u03a9ncia: Voc\u03a9 n\u03c0o est\u00df mais conectado ao ORACLE.<br \/>SQL&gt; <br \/>Conectado.<br \/>SQL&gt; select count(*) from user_objects;<\/p>\n<p>  COUNT(*)<br \/>&#8212;&#8212;&#8212;-<br \/>       195<\/p>\n<p>SQL&gt; select count(*) from user_objects where status = &#8216;INVALID&#8217;;<\/p>\n<p>  COUNT(*)<br \/>&#8212;&#8212;&#8212;-<br \/>         0<\/p>\n<p>SQL&gt; select count(*) from user_objects where status = &#8216;INVALID&#8217;;<\/p>\n<p>  COUNT(*)<br \/>&#8212;&#8212;&#8212;-<br \/>         0<\/p>\n<p>SQL&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use sempre a $ORACLE_HOME\/rdbms\/admin\/ultrp.sql sqlplus \/ as sysdba sql&gt;@$ORACLE_HOME\/rdbms\/admin\/ultrp.sql; Conectado a:Oracle Database 10g Express Edition Release 10.2.0.1.0 &#8211; Production SQL&gt; @C:oraclexeapporacleproduct10.2.0serverRDBMSADMINutlrp.sql TIMESTAMP&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; COMP_TIMESTAMP UTLRP_BGN 2008-03-15 16:01:59 DOC&gt; The following PL\/SQL block invokes UTL_RECOMP to recompile invalidDOC&gt; objects in the database. &hellip; <a href=\"https:\/\/www.soudba.com.br\/?p=172\">Continue lendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-172","post","type-post","status-publish","format-standard","hentry","category-sem-categoria"],"_links":{"self":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172"}],"version-history":[{"count":0,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}