升級oracle 10g clusterware 和 rac

byfree發表於2009-07-07
1. Stopping All Services for an Oracle Clusterware Installation
C:\>emctl stop dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://rac1:1158/em/console/aboutApplication
OracleDBConsoleorcl1 服務正在停止.................
OracleDBConsoleorcl1 服務已成功停止。
C:\>isqlplusctl stop
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Stopping iSQL*Plus ...
iSQL*Plus stopped.
C:\oracle\product\10.2.0\db_1\BIN>srvctl stop instance -d orcl -i orcl1
C:\oracle\product\10.2.0\db_1\BIN>srvctl stop asm -n rac1
C:\oracle\product\10.2.0\db_1\BIN>srvctl stop nodeapps -n rac1
C:\>crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
檢查oracle的其它相關服務,一一關閉
C:\>net start
C:\>net stop 服務名

2.升級clusterware
點選補丁包裡的setup.exe,進行圖形安裝介面,在指定主目錄詳細資訊時,選擇crs_home的名稱(這就是clusterware升級的地方,很簡單,但很關鍵)
圖形安裝介面完成後,還需要執行C:\oracle\product\10.2.0\crs\install\patch102.bat,完成後繼續在另一個節點再此操作。
C:\oracle\product\10.2.0\crs\install>patch102
Successful validation check of Oracle CRS services status
Successful binary patch of the C:\oracle\product\10.2.0\crs
Successful cleanup of patch subdirectory
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\bin\cluvfy.bat -> C:\oracle\product\10.2.0\crs\inventory\Templates\bin\cluvfy.bat
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\bin\gsd.bat -> C:\oracle\product\10.2.0\crs\inventory\Templates\bin\gsd.bat
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\bin\gsdctl.bat -> C:\oracle\product\10.2.0\crs\inventory\Templates\bin\gsdctl.bat
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\bin\gsdstop.bat -> C:\oracle\product\10.2.0\crs\inventory\Templates\bin\gsdstop.bat
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\bin\instOracle.key -> C:\oracle\product\10.2.0\crs\inventory\Templates\bin\instOracle.key
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\bin\localconfig.bat -> C:\oracle\product\10.2.0\crs\inventory\Templates\bin\localconfig.bat
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\bin\racgwrap.bat.sbs -> C:\oracle\product\10.2.0\crs\inventory\Templates\bin\racgwrap.bat.sbs
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\bin\srvctl.bat -> C:\oracle\product\10.2.0\crs\inventory\Templates\bin\srvctl.bat
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\bin\usrvip.bat -> C:\oracle\product\10.2.0\crs\inventory\Templates\bin\usrvip.bat
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\bin\vipca.bat-> C:\oracle\product\10.2.0\crs\inventory\Templates\bin\vipca.bat
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\cv\remenv\exectask.bat -> C:\oracle\product\10.2.0\crs\inventory\Templates\cv\remenv\exectask.bat
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\evm\admin\conf\evm.auth -> C:\oracle\product\10.2.0\crs\inventory\Templates\evm\admin\conf\evm.auth
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\evm\admin\conf\evmdaemon.conf -> C:\oracle\product\10.2.0\crs\inventory\Templates\evm\admin\conf\evmdaemon.conf
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\evm\admin\conf\evmlogger.conf -> C:\oracle\product\10.2.0\crs\inventory\Templates\evm\admin\conf\evmlogger.conf
C:\oracle\product\10.2.0\crs\inventory\Templates\install\patch102\install\preupdate.bat -> C:\oracle\product\10.2.0\crs\inventory\Templates\install\preupdate.bat
複製了 15 個檔案
Successful startup of OracleCSService
Successful startup of OracleEvmService
Successful startup of OracleCRService
Setting up OPMD process
OpmdInstall:  OPM service successfully installed
OpmdFixupService:  Oracle Object Service set to manual startup and added to list
OpmdFixupService:  OracleCSService set to manual startup and added to list
OpmdFixupService:  OracleEVMService set to manual startup and added to list
OpmdFixupService:  OracleCRService set to manual startup and added to list
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 2: rac2 rac2-priv rac2
Creating OCR keys for user 'administrator', privgrp ''..
Operation successful.
clscfg -upgrade completed succssfully
Successful upgrade of this node to Oracle Cluster Ready Services 10204

3.Stopping All Services for an Oracle RAC Installation
C:\> ORACLE_BASE\ORACLE_HOME\bin\emctl stop dbconsole
C:\> ORACLE_BASE\ORACLE_HOME\bin\isqlplusctl stop
C:\> ORACLE_BASE\ORACLE_HOME\bin\srvctl stop service -d db_name [-s service_name_list [-i inst_name]]
C:\> ORACLE_BASE\ORACLE_HOME\bin\srvctl stop database -d db_name
C:\> ORACLE_BASE\ORACLE_HOME\bin\srvctl stop asm -n node
C:\> ORACLE_BASE\ORACLE_HOME\bin\srvctl stop listener -n node [-l listenername]

4.升級oracle db軟體
停止oracle相關應用
點選補丁包裡的setup.exe,進行oracle db軟體升級
shutdown RAC兩個節點的例項
SQL> shutdown immediate
資料庫已經關閉。
已經解除安裝資料庫。
ORACLE 例程已經關閉。
SQL> startup nomount
ORACLE 例程已經啟動。
Total System Global Area  209715200 bytes
Fixed Size                  1248140 bytes
Variable Size             134218868 bytes
Database Buffers           71303168 bytes
Redo Buffers                2945024 bytes
SQL> alter system set cluster_database=false scope=spfile;
系統已更改。
SQL> shutdown
ORA-01507: ??????

ORACLE 例程已經關閉。
SQL> startup upgrade
ORACLE 例程已經啟動。
Total System Global Area  209715200 bytes
Fixed Size                  1248140 bytes
Variable Size             134218868 bytes
Database Buffers           71303168 bytes
Redo Buffers                2945024 bytes
資料庫裝載完畢。
資料庫已經開啟。

5.升級DB
C:\>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on 星期二 7月 7 09:12:47 2009
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
已連線到空閒例程。
SQL> startup upgrade
ORACLE 例程已經啟動。
Total System Global Area  209715200 bytes
Fixed Size                  1295872 bytes
Variable Size             134220288 bytes
Database Buffers           71303168 bytes
Redo Buffers                2895872 bytes
資料庫裝載完畢。
資料庫已經開啟。
SQL> spool upgrade_info.log
SQL> @?\rdbms\admin\utlu102i.sql
Oracle Database 10.2 Upgrade Information Utility    07-07-2009 09:14:57
.
**********************************************************************
Database:
**********************************************************************
--&gt name:       ORCL
--&gt version:    10.2.0.1.0
--&gt compatible: 10.2.0.1.0
--&gt blocksize:  8192
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
--&gt SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 492 MB
.... AUTOEXTEND additional space required: 12 MB
--&gt UNDOTBS1 tablespace is adequate for the upgrade.
.... minimum required size: 401 MB
.... AUTOEXTEND additional space required: 356 MB
--&gt SYSAUX tablespace is adequate for the upgrade.
.... minimum required size: 300 MB
--&gt TEMP tablespace is adequate for the upgrade.
.... minimum required size: 58 MB
.... AUTOEXTEND additional space required: 37 MB
--&gt EXAMPLE tablespace is adequate for the upgrade.
.... minimum required size: 78 MB
.
**********************************************************************
Update Parameters: [Update Oracle Database 10.2 init.ora or spfile]
**********************************************************************
-- No update parameter changes are required.
.
**********************************************************************
Renamed Parameters: [Update Oracle Database 10.2 init.ora or spfile]
**********************************************************************
-- No renamed parameters found. No changes are required.
.
**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 10.2 init.ora or spfile]
**********************************************************************
-- No obsolete parameters found. No changes are required
.
**********************************************************************
Components: [The following database components will be upgraded or installed]
**********************************************************************
--&gt Oracle Catalog Views         [upgrade]  VALID
--&gt Oracle Packages and Types    [upgrade]  VALID
--&gt JServer JAVA Virtual Machine [upgrade]  VALID
--&gt Oracle XDK for Java          [upgrade]  VALID
--&gt Oracle Java Packages         [upgrade]  VALID
--&gt Oracle Text                  [upgrade]  VALID
--&gt Oracle XML Database          [upgrade]  VALID
--&gt Real Application Clusters    [upgrade]  VALID
--&gt Oracle Workspace Manager     [upgrade]  VALID
--&gt Oracle Data Mining           [upgrade]  VALID
--&gt OLAP Analytic Workspace      [upgrade]  VALID
--&gt OLAP Catalog                 [upgrade]  VALID
--&gt Oracle OLAP API              [upgrade]  VALID
--&gt Oracle interMedia            [upgrade]  VALID
--&gt Spatial                      [upgrade]  VALID
--&gt Expression Filter            [upgrade]  VALID
--&gt EM Repository                [upgrade]  VALID
--&gt Rule Manager                 [upgrade]  VALID
.
**********************************************************************
Miscellaneous Warnings
**********************************************************************
WARNING: --&gt Database contains INVALID objects prior to upgrade.
.... USER DMSYS has 1 INVALID objects.
.... USER PUBLIC has 65 INVALID objects.
.... USER CTXSYS has 1 INVALID objects.
.... USER EXFSYS has 12 INVALID objects.
.... USER SYS has 138 INVALID objects.
.
PL/SQL 過程已成功完成。
SQL> spool off
SQL>
C:\> ORACLE_BASE\ORACLE_HOME\bin\srvctl start listener -n node
start the Automatic Storage Management instance.
For Oracle RAC installations:
Use SQL*Plus to log in to the database as the SYS user with SYSDBA privileges:
C:\> sqlplus / as sysdba
SQL> STARTUP NOMOUNT
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;
SQL> SHUTDOWN

SQL> STARTUP UPGRADE
SQL> SPOOL patch.log
SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\catupgrd.sql
SQL> spool off
SQL> shutdown immediate
資料庫已經關閉。
已經解除安裝資料庫。
ORACLE 例程已經關閉。
SQL> startup
ORACLE 例程已經啟動。
Total System Global Area  209715200 bytes
Fixed Size                  1295872 bytes
Variable Size             184551936 bytes
Database Buffers           20971520 bytes
Redo Buffers                2895872 bytes
資料庫裝載完畢。
資料庫已經開啟。
SQL> @?\rdbms\admin\utlrp.sql
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2009-07-07 10:22:05
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>#
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END  2009-07-07 10:25:30
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
SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
COMP_NAME                           VERSION         STATUS
----------------------------------- --------------- ------
Oracle Enterprise Manager           10.2.0.4.0      VALID
Spatial                             10.2.0.4.0      VALID
Oracle interMedia                   10.2.0.4.0      VALID
OLAP Catalog                        10.2.0.4.0      VALID
Oracle XML Database                 10.2.0.4.0      VALID
Oracle Text                         10.2.0.4.0      VALID
Oracle Expression Filter            10.2.0.4.0      VALID
Oracle Rule Manager                 10.2.0.4.0      VALID
Oracle Workspace Manager            10.2.0.4.3      VALID
Oracle Data Mining                  10.2.0.4.0      VALID
Oracle Database Catalog Views       10.2.0.4.0      VALID
Oracle Database Packages and Types  10.2.0.4.0      VALID
JServer JAVA Virtual Machine        10.2.0.4.0      VALID
Oracle XDK                          10.2.0.4.0      VALID
Oracle Database Java Packages       10.2.0.4.0      VALID
OLAP Analytic Workspace             10.2.0.4.0      VALID
Oracle OLAP API                     10.2.0.4.0      VALID
Oracle Real Application Clusters    10.2.0.4.0      VALID
For Oracle RAC installations:
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;
Restart the database:
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
Ensure the database and Listener are operational.
In the case of Oracle Real Application Clusters (RAC), execute
emca -upgrade db -cluster
操作這一步時,我遇到如下報錯:
2009-7-7 10:49:41 oracle.sysman.emcp.EMConfig perform
嚴重: 無法備份檔案 C:\oracle\product\10.2.0\db_1\rac2_orcl2
有關詳細資料, 請參閱 C:\oracle\product\10.2.0\db_1\cfgtoollogs\emca\orcl\emca_2009-07-07_10-47-13-上午.log 中的日誌檔案。
2009-7-7 10:49:41 oracle.sysman.emcp.EMConfig perform
配置: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: 無法備份檔案 C:\oracle\product\10.2.0\db_1\rac2_orcl2
 at oracle.sysman.emcp.EMAgentConfig.performUpgrade(EMAgentConfig.java:733)
 at oracle.sysman.emcp.EMAgentConfig.invoke(EMAgentConfig.java:238)
 at oracle.sysman.emcp.EMAgentConfig.invoke(EMAgentConfig.java:208)
 at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:175)
 at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:486)
 at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1142)
 at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:470)
 at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:419)
解決這個問題見:http://space.itpub.net/17997/viewspace-608496

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

相關文章