ITPub博客

首页 > Linux操作系统 > Linux操作系统 > linux下oracle RAC10.2.0.1升级到10.2.0.4

linux下oracle RAC10.2.0.1升级到10.2.0.4

原创 Linux操作系统 作者:longqidong 时间:2012-05-07 14:27:23 0 删除 编辑

        RAC升级分三步。

       1. 升级clusterware  -- > 升级包中安装程序里选择CRS_HOME后安装

       2. 升级数据库软件  -- >升级包中安装程序里选择ORACLE_HOME后安装

       3. 升级实例    -- > 可以使用脚本 或者直接运行DBUA 实现。


1. 升级Clusterware


    停止相关的进程

 

    每个节点分别停止 EM和 isqlplus

       [oracle@rac1 bin]$ emctl stop dbconsole

       [oracle@rac1 bin]$ isqlplusctl stop

 

   停止相关进程

       这个可以用srvctl 命令来一个一个进行,也可以用crs_stop -all 进行。

[oracle@rac1 bin]$ crs_stat -t

Name           Type           Target    State     Host

------------------------------------------------------------

ora.orcl.db    application    OFFLINE   OFFLINE

ora....oltp.cs application    OFFLINE   OFFLINE

ora....cl1.srv application    OFFLINE   OFFLINE

ora....cl2.srv application    OFFLINE   OFFLINE

ora....l1.inst application    OFFLINE   OFFLINE

ora....l2.inst application    OFFLINE   OFFLINE

ora....C1.lsnr application    OFFLINE   OFFLINE

ora.rac1.gsd   application    OFFLINE   OFFLINE

ora.rac1.ons   application    OFFLINE   OFFLINE

ora.rac1.vip   application    OFFLINE   OFFLINE

ora....C2.lsnr application    OFFLINE   OFFLINE

ora.rac2.gsd   application    OFFLINE   OFFLINE

ora.rac2.ons   application    OFFLINE   OFFLINE

ora.rac2.vip   application    OFFLINE   OFFLINE

 

  停止每个节点上的CRS

[root@rac1 ~]# /u01/app/oracle/product/crs/bin/crsctl stop crs


    进行升级包的目录,运行runInstaller 

 这里需要用到Xmanager,在服务器端设置 

  export DISPLAY=192.168.0.214:0.0   214是我客户端的IP

 

    [oracle@rac1 p6810189_10204_Linux-x86]$ pwd

       /mnt/OracleSoftware/p6810189_10204_Linux-x86

    [oracle@rac1 p6810189_10204_Linux-x86]$ cd Disk1/

    [oracle@rac1 Disk1]$ ls

    10204_buglist.htm  install  patch_note.htm  response  runInstaller  stage

    [oracle@rac1 Disk1]$ ./runInstaller 


 

  在可视化的安装窗口选择CRS_HOME。千万注意,不要选错了。然后一下步进行安装。

 

  安装结束会提示运行2个脚本

 

   

    The installer has detected that your Cluster Ready Services (CRS) installation is shared amongst the following nodes:

 

    rac1

    rac2

 

Because of the shared nature of this installation, you cannot perform. a rolling upgrade of your CRS software.

 

To complete the installation of this patchset, you must perform. the following tasks:

 

    1.  On each node, do the following:

       a.  Log in as the root user.

       b.  As root, shutdown the CRS daemons on the node

           using the following command:

              /u01/app/oracle/product/crs/bin/crsctl stop crs

       Repeat this step until the CRS daemons on all the nodes are shutdown.

 

    2.  After all the CRS daemons on all the nodes are shutdown,

       run the shell script. located at:

           /u01/app/oracle/product/crs/install/root102.sh

       This script. will automatically start the CRS daemons on the

       patched node upon completion.

 

    3.  Wait until the script. finishes and then proceed to the

        next node and repeat step 2.

 

[root@rac1 ~]# /u01/app/oracle/product/crs/bin/crsctl stop crs

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

[root@rac1 ~]# /u01/app/oracle/product/crs/install/root102.sh

Creating pre-patch directory for saving pre-patch clusterware files

Completed patching clusterware files to /u01/app/oracle/product/crs

Relinking some shared libraries.

Relinking of patched files is complete.

WARNING: directory '/u01/app/oracle/product' is not owned by root

WARNING: directory '/u01/app/oracle' is not owned by root

WARNING: directory '/u01/app' is not owned by root

WARNING: directory '/u01' is not owned by root

Preparing to recopy patched init and RC scripts.

Recopying init and RC scripts.

Startup will be queued to init within 30 seconds.

Starting up the CRS daemons.

Waiting for the patched CRS daemons to start.

  This may take a while on some systems.

.

.

10204 patch successfully applied.

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: rac1 rac1-priv rac1

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

clscfg -upgrade completed successfully

升级集群软件比较简单 ,只是注意升级路径别选错就可以。


2.升级数据库软件

    升级clusterware的时候,升级结束的时候会启动CRS服务。 我们在升级数据库的时候需要关闭这些服务。

 

 停止相关进程

    [oracle@rac1 bin]$ crs_stop -all

    [oracle@rac1 bin]$ crs_stat -t

Name           Type           Target    State     Host

------------------------------------------------------------

ora.orcl.db    application    ONLINE    OFFLINE

ora....oltp.cs application    ONLINE    OFFLINE

ora....cl1.srv application    ONLINE    OFFLINE

ora....cl2.srv application    ONLINE    OFFLINE

ora....l1.inst application    OFFLINE   OFFLINE

ora....l2.inst application    OFFLINE   OFFLINE

ora....C1.lsnr application    OFFLINE   OFFLINE

ora.rac1.gsd   application    OFFLINE   OFFLINE

ora.rac1.ons   application    OFFLINE   OFFLINE

ora.rac1.vip   application    OFFLINE   OFFLINE

ora....C2.lsnr application    OFFLINE   OFFLINE

ora.rac2.gsd   application    OFFLINE   OFFLINE

ora.rac2.ons   application    OFFLINE   OFFLINE

ora.rac2.vip   application    OFFLINE   OFFLINE

 


    [oracle@rac1 ~]$ export DISPLAY=192.168.0.214:0.0

 

    进行升级包的目录,运行runInstaller

   

    在可视化的安装窗口选择ORACLE_HOME。注意,不要选错了。然后一下步进行安装。

 

 

  安装结束会提示用root用户在所有节点上运行一个脚本

    /u01/app/oracle/product/10.2.0/db_1/root.sh

 

[root@rac1 ~]# /u01/app/oracle/product/10.2.0/db_1/root.sh

Running Oracle10 root.sh script...

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/10.2.0/db_1

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying dbhome to /usr/local/bin ...

The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying oraenv to /usr/local/bin ...

The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying coraenv to /usr/local/bin ...

 

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.


3.升级实例 

    两种方式

    1. DBUA  在一个节点执行就可以,可视化界面操作。

    2. 手动执行脚本  (一个节点执行就可以)


$ srvctl start listener -n node

   $ sqlplus /nolog

   SQL> CONNECT SYS AS SYSDBA

   Enter password: 123

   SQL> STARTUP NOMOUNT

 

    更改cluster_database参数为false,只允许一个节点启动实例

   SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;

 

Shut down the database:

   SQL> SHUTDOWN


SQL> STARTUP UPGRADE

SQL> SPOOL patch.log

SQL> @?/rdbms/admin/catupgrd.sql 升级脚本

SQL> SPOOL OFF


SQL> SHUTDOWN IMMEDIATE

SQL> STARTUP


SQL> @?/rdbms/admin/utlrp.sql 重新编译失效的对象


执行下面脚本查看是否升级成功

SQL> select comp_name,status,version from sys.dba_registry;


COMP_NAME            STATUS                 VERSION

-------------------- ---------------------- ------------------------------

Oracle Enterprise Ma VALID                  10.2.0.4.0

nager


OLAP Catalog         VALID                  10.2.0.4.0

Oracle interMedia    VALID                  10.2.0.4.0

Oracle XML Database  VALID                  10.2.0.4.0

Oracle Expression Fi VALID                  10.2.0.4.0

lter


Oracle Rule Manager  VALID                  10.2.0.4.0

Oracle Workspace Man VALID                  10.2.0.4.3


COMP_NAME            STATUS                 VERSION

-------------------- ---------------------- ------------------------------

ager


Oracle Database Cata VALID                  10.2.0.4.0

log Views


Oracle Database Pack VALID                  10.2.0.4.0

ages and Types


JServer JAVA Virtual VALID                  10.2.0.4.0

 Machine



COMP_NAME            STATUS                 VERSION

-------------------- ---------------------- ------------------------------

Oracle XDK           VALID                  10.2.0.4.0

Oracle Database Java VALID                  10.2.0.4.0

 Packages


OLAP Analytic Worksp VALID                  10.2.0.4.0

ace


Oracle OLAP API      VALID                  10.2.0.4.0

Oracle Real Applicat VALID                  10.2.0.4.0

ion Clusters



15 rows selected.

  确定都升级为10.2.0.4之后将 cluster_database更改过来。

 SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;


SQL> SHUTDOWN

SQL> STARTUP

 升级完成

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22418990/viewspace-722894/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-08-26

  • 博文量
    94
  • 访问量
    415854