oracle RAC 9.2.0.4 for linux x86升级到9.2.0.8

oracle RAC 9.2.0.4升级到9.2.0.8
   操作系统平台:Red Hat Enterprise Linux AS release 3
   准备工作:
            1. Check Tablespace Sizes and Set Parameter Values
            
            2. Check SYSTEM Tablespace Size ensure that there is at least 10 MB of free
               space allocated to the SYSTEM tablespace
            
            3. Check XDB Tablespace Size For Oracle RAC installations, ensure that there
               is at least 50 MB of free space allocated to the XDB tablespace
            
            4. Set the SHARED_POOL_SIZE and JAVA_POOL_SIZE Initialization Parameters
               SQL> ALTER SYSTEM SET SHARED_POOL_SIZE='150M' SCOPE=spfile;
               SQL> ALTER SYSTEM SET JAVA_POOL_SIZE='150M' SCOPE=spfile;


为了数据的安全,做之前先备份数据:
  1.1 逻辑导出数据库
      ORACLE_HOME=/opt/oracle/product/9.2.0.4
      ORACLE_SID=zfj1
      NLS_LANG=american_america.zhs16gbk
      export ORACLE_HOME ORACLE_SID NLS_LANG
      $ORACLE_HOME/bin/exp rman/rmanzfj full=y buffer=4096000 compress=n file=/opt/ora
      cle/backup/dmp/exp_zfj.dmp log=/opt/oracle/backup/dmp/exp_zfj.log

  1.2 物理备份数据库:

      [oracle@svr1 sh]$ rman target / catalog rman/rman@catadb(一个节点执行即可)

      Recovery Manager: Release 9.2.0.8.0 - Production

      Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

      connected to target database: ZFJ (DBID=3130691682)
      connected to recovery catalog database
      RMAN> run {
            allocate channel c1 type disk;
            backup
            incremental level 0
            skip inaccessible
            tag zfj_level0
            filesperset 15
            format '/opt/oracle/dump/rmanzfj/zfj_DBLevel0%s_%p_%t'
            release channel c1;
            }
  1.3 备份数据库安装文件(需要在两个节点都执行)
          cd /opt/oracle
          tar cvf zfj1_oracle.tar --preserve --exclude data_ocfs --exclude data_ocfs2
            (备注:把 oralce安装目录文件打包备份,--preserve参数将保持文件属性不变
              --exclude参数排除data_ocfs、data_ocfs2两个目录不打包到zfj1_oracle.tar)
   
  1.4 配置linux操作系统启动到运行级别5,并可以用xmanger图形链接
         1.4.1
              vi /etc/inittab      id:5:initdefault:
         1.4.2
              cd /etc/X11/gdm
              vi /etc/gdm.conf
                  [xdmcp]
                  # Distributions: Ship with this off.  It is never a safe thing to leave
                  # out on the net.  Setting up /etc/hosts.allow and /etc/hosts.deny to   

                 only
                  # allow local access is another alternative but not the safest.
                  # Firewalling port 177 is the safest if you wish to have xdmcp on.
                  # Read the manual for more notes on the security of XDMCP.
                  Enable=true

                  #PingIntervalSeconds=15
                  # The port.  177 is the standard port so better keep it that way
                  Port=177
               cd /etc/X11/xdm
               vi Xaccess 取消如下行前面的#和*号
                   any host can get a login window
               vi  xdm-config 在如下行前面加一个 !
                    !DisplayManager.requestPort:    0
     
  1.5 升级oracle 9i cluster manager(rac环境只需要在一个节点执行)
          1.5.1 切换到oracle用户下 su - oracle
         
          1.5.2 做如下准备工作,如果如下环境变量已经设置可以不予理睬
                $ DISPLAY=local_host:0.0;export DISPLAY(xmanger 3.0好像自动会识别把图形切
                换到用户终端,不需要设置)
         
          1.5.3 查看oracle environment variable is set correctly
         
          1.5.4 set the LD_LIBRARY_PATH environment variable to $ORACLE_HOME/lib
                $ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib; export
                LD_LIBRARY_PATH         

          1.5.5 把oracle升级包上传到服务器上,并进入升级包目录Disk1 例如:/var/src/Disk1
                 ./oracm/runInstaller(升级cluster manager)
                 备注:此时图形界面会出现,指定原始oracle home和path,此过程中需要输入
                 cluster节点和cluster私有节点(心跳)名,输入后next就安装成功了
         
          1.5.6 $cd ORACLE_HOME/oui/bin(where oracle_home is the Oracle home where you
                installed Oracle Universal Installer 10.1.0.5)
                $./runInstaller -updateNodeList -noClusterEnabled -local ORACLE_home=
                $ORACLE_HOME CLUSTER_NODES=svr1,svr2(svr1和svr2是rac的两个节点)
         
          备注:RAC环境只需要在一个节点执行,升级程序自动会将另外一个节点的cluster         

                manager程序文件也进行升级
   
  1.6 交互模式打oracle 9i数据升级补丁(此过程要确保cluster manager是启动的)

            
          1.6.1 $cd ORACLE_HOME/oui/bin(where oracle_home is the Oracle home where you     

                installed Oracle Universal Installer 10.1.0.5)
                $./runInstaller -updateNodeList -noClusterEnabled -local                  

                ORACLE_HOME=$ORACLE_HOME CLUSTER_NODES=srv1,srv2
                          
          1.6.2 如果cluster manager没有启动,执行启动cluste manager
                #/opt/oracle/product/9.2.0.4/oracm
                #source ~oracle/.bash_profile (进入root用户下使用oracle环境变量,然后      

                执行cluster启动脚本)
                #/opt/oracle/product/9.2.0.4/oracm/bin
                #./ocmstart.sh
         
          1.6.3 Enter following commands to start Oracle Universal Installer, where        

                patchset_directory is the directory you unzipped the patch set            

                software
                $ patchset_directory/Disk1(patchset_directory实际上就是我上传补丁的        

                那个目录)
                $ ./runInstaller
          1.6.4 在oui图形界面中,指定oracle_home name(如果oracle_home名指定正确,自        

                动会找到以前oracle安装的路径)和路径,然后next,当提示用root用户运行         

                $ORACLE_HOME/root.sh脚本时,按照提示运行root.sh脚本,然后等安装完成        

                后退出oracle universal installer即可;
               
          备注:在升级oracle 9i rac环境数据库的时候,一定要确认升级ok的oracle cluster      

                 manage启动起来,否则会报错,不会启懂oracle universal installer图形界      

               面  

  1.7 upgrade the database
          1.7.1 log in as the oracle software owner(typically oracle) su- oracle
              
          1.7.2 start the Global Services Daemon(GSD) on each node of the cluster         

                as follows:(备注:在每个节点都要启动gsd服务,如下命令在每个节点执行
                 $gsdctl start
                 $lsnrctl start
              
          1.7.3 start the database,where db_name is the database name:
                $srvctl start database -d zfj(备注:如果gsd服务没有启动,srvctl就不        

                能使用,只能一个节点一个节点的使用sqlplus启动数据库,gsd服务的作用         

                就是一个命令就可以把所有节点的实例启动起来)、
              
          1.7.4 Set the CLUSTER_DATABASE initialization parameter to FALSE: (作用就        

                是让clust manager暂时不起作用)
                SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;
              
          1.7.5 shutdown database
                $ srvctl stop database -d zfj

  1.8 Enter the following SQL*Plus commands:
               $sqlplus "/ as sysdba"
               SQL> STARTUP MIGRATE
               SQL> SPOOL patch.log
               SQL> @?/rdbms/admin/catpatch.sql
               SQL> SPOOL OFF
      
  1.9 查看patch.log文件是否有报错
  
  2.0 restart the database;
              SQL> SHUTDOWN  immediate;
              SQL> STARTUP
  2.1 Run the utlrp.sql script to recompile all invalid PL/SQL packages now               

      instead of when the packages are accessed for the first time. This step is           

      optional but recommended.
               
      SQL> @?/rdbms/admin/utlrp.sql
      
  2.2 Set the CLUSTER_DATABASE initialization parameter to TRUE:
      SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile; (1.7.4)
      
  2.3 restart th database;
      SQL> SHUTDOWN  immediate;
      SQL> EXIT
      $ srvctl start database -d zfj(两个节点的实例都启动)
  
  2.4 If you are using the Oracle Recovery Manager catalog, enter the following            

      command:(由于我们有一个专门的catlog数据库,而且是oracle 10G的,版本比               

      9.2.0.8高,所以不需要升级,升级方法如下:)
      
      $ rman catalog username/password@catadb(catadb是我的catalog数据库)
      RMAN> UPGRADE CATALOG;

 

FROM:http://linux.chinaunix.net/bbs/archiver/tid-1038418.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值