RAC 資料庫升級 10.2.0.1.0 到 10.2.0.2.0 之升級catalog

xchui702發表於2011-08-11

--RAC 資料庫由10.2.0.1.0 升級到10.2.0.2.0
安裝10.2.0.2.0的介質後,啟動資料庫報錯如下
SYS@devdb11>startup upgrade
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.

Total System Global Area  184549376 bytes
Fixed Size                  1259864 bytes
Variable Size              83887784 bytes
Database Buffers           96468992 bytes
Redo Buffers                2932736 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced

檢視alert.log檔案:
ORACLE Instance devdb11 - Archival Error. Archiver continuing.
Thu Aug 11 16:47:19 2011
Errors in file /u01/app/oracle/admin/devdb1/udump/devdb11_ora_2177.trc:
ORA-39701: database must be mounted EXCLUSIVE for UPGRADE or DOWNGRADE
Thu Aug 11 16:47:19 2011
Error 39701 happened during db open, shutting down database
USER: terminating instance due to error 39701
Thu Aug 11 16:47:19 2011
Errors in file /u01/app/oracle/admin/devdb1/bdump/devdb11_lms0_1871.trc:
ORA-39701: database must be mounted EXCLUSIVE for UPGRADE or DOWNGRADE
Thu Aug 11 16:47:19 2011
Errors in file /u01/app/oracle/admin/devdb1/bdump/devdb11_lmon_1867.trc:
ORA-39701: database must be mounted EXCLUSIVE for UPGRADE or DOWNGRADE
Thu Aug 11 16:47:19 2011
Errors in file /u01/app/oracle/admin/devdb1/bdump/devdb11_lmd0_1869.trc:
ORA-39701: database must be mounted EXCLUSIVE for UPGRADE or DOWNGRADE
Instance terminated by USER, pid = 2177
ORA-1092 signalled during: ALTER DATABASE OPEN MIGRATE...

--對於RAC資料庫需要把cluster_database引數改為false, 因為作為cluster資料庫不會用EXCLUSIVE方式開啟資料庫。
SYS@devdb11>startup nomount;
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.

Total System Global Area  184549376 bytes
Fixed Size                  1259864 bytes
Variable Size              83887784 bytes
Database Buffers           96468992 bytes
Redo Buffers                2932736 bytes
SYS@devdb11>alter system set cluster_database=false scope=spfile;

System altered.

SYS@devdb11>shutdown
ORA-01507: database not mounted


ORACLE instance shut down.
--重新用upgrade方式開啟資料庫,是成功的。然後升級catalog.
SYS@devdb11>startup upgrade
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.

Total System Global Area  184549376 bytes
Fixed Size                  1259864 bytes
Variable Size              83887784 bytes
Database Buffers           96468992 bytes
Redo Buffers                2932736 bytes
Database mounted.
Database opened.

SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF

--檢查patch.log 檔案: 發現一下錯誤都可以忽略
rac1-> grep -i "ora-" patch.log
DOC>    The following statement will cause an "ORA-01722: invalid number"
DOC>    The following statement will cause an "ORA-01722: invalid number"
DOC>   The following statement will cause an "ORA-01722: invalid number"
DOC>    The following statements will cause an "ORA-01722: invalid number"
DOC>    The following statement will cause an "ORA-01722: invalid number"
DOC>    The following PL/SQL block will cause an ORA-20000 error and
DOC>    The following PL/SQL block will cause an ORA-20000 error and
ORA-29558: JAccelerator (NCOMP) not installed. Refer to Install Guide for
ORA-06512: at "SYS.DBMS_JAVA", line 236

以及patch.log檔案的末尾各個元件的版本資訊。
Component                                Status         Version  HH:MM:SS
Oracle Database Server                    VALID      10.2.0.2.0  00:26:07
JServer JAVA Virtual Machine              VALID      10.2.0.2.0  00:13:47
Oracle XDK                                VALID      10.2.0.2.0  00:02:45
Oracle Database Java Packages             VALID      10.2.0.2.0  00:01:20
Oracle Text                               VALID      10.2.0.2.0  00:01:38
Oracle XML Database                       VALID      10.2.0.2.0  00:01:36
Oracle Real Application Clusters          VALID      10.2.0.2.0  00:00:02
Oracle Data Mining                        VALID      10.2.0.2.0  00:00:38
OLAP Analytic Workspace                   VALID      10.2.0.2.0  00:00:30
OLAP Catalog                              VALID      10.2.0.2.0  00:03:45
Oracle OLAP API                           VALID      10.2.0.2.0  00:03:05
Oracle interMedia                         VALID      10.2.0.2.0  00:15:12
Spatial                                   VALID      10.2.0.2.0  00:01:22
Oracle Expression Filter                  VALID      10.2.0.2.0  00:00:27
Oracle Enterprise Manager                 VALID      10.2.0.2.0  00:03:35
Oracle Rule Manager                       VALID      10.2.0.2.0  00:00:44
.

--重啟動後,編譯失效的物件。
SYS@devdb11>select distinct status from dba_objects;

STATUS
-------
INVALID
VALID

SYS@devdb11>select status, count(*) from dba_objects group by status;

STATUS    COUNT(*)
------- ----------
INVALID        493
VALID        49796

SYS@devdb11>@?/rdbms/admin/utlrp.sql

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2011-08-12 10:27:03

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is 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 a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script. automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END  2011-08-12 10:30:27


PL/SQL procedure successfully completed.

DOC> The following query reports the number of objects that have compiled
DOC> with errors (objects that compile with errors have status set to 3 in
DOC> obj$). If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
                  0

DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
                          0


PL/SQL procedure successfully completed.

SYS@devdb11>select status, count(*) from dba_objects group by status;

STATUS    COUNT(*)
------- ----------
VALID        50290


--對於cluster 資料庫,

SYS@devdb11>alter system set cluster_database=true scope=spfile;

System altered.

SYS@devdb11>shutdown
ORA-01507: database not mounted

--啟動資料庫
srvctl start database -d devdb1

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/674865/viewspace-704721/,如需轉載,請註明出處,否則將追究法律責任。

相關文章