oracle 10g 升级

本文详细介绍了Oracle 10g数据库从版本2升级的过程,包括查看当前版本、停用数据库和服务、关闭监听及ASM实例。在升级过程中需要注意停用Oracle Enterprise Manager Console、设置Grid Control的计划维护以及确保正确关闭ASM实例和Oracle Cluster Synchronization Services。在升级中可能遇到图形界面启动问题和先决条件检查问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

查看原来的版本号
SQL> select version from v$timezone_file;
   VERSION
----------
         2

SQL> select version from v$instance;

VERSION
-----------------
10.2.0.1.0

停用数据库和所有服务,监听,如下
8.8.1 Stopping All Processes for a Single Instance Installation

Shut down the following Oracle Database 10g processes in the order specified before installing the patch set:

  1. Shut down all processes in the Oracle home that might be accessing a database; for example, Oracle Enterprise Manager Database Control:

    $ emctl stop dbconsole
    $ lsnrctl stop
    

    Note:

    Before you shut down all processes that are monitored by Oracle Enterprise Manager Grid Control, set a blackout in Grid Control for the processes that you intend to shut down. This is necessary so that the availability records for these processes indicate that the shutdown was planned downtime rather than an unplanned system outage.
  2. Shut down all database instances running in the Oracle home directory, where you need to install the patch set.

  3. Shut down all listeners running in the Oracle home directory, where you need to install the patch set.

  4. If there is an Automatic Storage Management instance present, then enter the following command to set the values for the environment variables$ORACLE_HOME and$ORACLE_SID:

    • Bourne, Bash, or Korn shell:

      $ export ORACLE_SID=+ASM
      $ export ORACLE_HOME=ASM_HOME
      
    • C shell:

      % setenv ORACLE_SID +ASM
      % setenv ORACLE_HOME ASM_HOME
      

    Enter the following command to shut down the Automatic Storage Management instance:

    cd $ORACLE_HOME/bin
    $ ./sqlplus /NOLOG
    SQL> CONNECT SYS AS SYSDBA
    Enter password:SYS_password
    SQL> SHUTDOWN IMMEDIATE
    
  5. For Automatic Storage Management, as the root user enter the following command to shut down the Oracle Cluster Synchronization Services daemon:

    # $ORACLE_HOME/bin/crsctl stop crs
 修改升级包的用户和组
[root@localhost oracle]# chown -R oracle:oinstall p8202632_10205_LINUX.zip
进入oracle用户解压
[oracle@localhost ~]$ unzip p8202632_10205_LINUX.zip
执行
[oracle@localhost Disk1]$ ./runInstaller
进入图形界面进行升级
 
 
 
附录:官方说明

9.1 Installing the Oracle Database 10g Patch Set Interactively

Note:

If you attempt to install this patch set in an Oracle home directory that does not contain an Oracle10 g release 10.2.0.1 or higher installation, Oracle Universal Installer displays a warning dialog with the following error:
OUI-10091: There are no patches that need to be applied from the patch set Oracle Database 10g Release 2 Patch Set 4 10.2.0.5

Oracle Universal Installer does not allow the installation to proceed. Click OK, then click Cancel to end the installation.

To install the Oracle Database 10g patch set interactively:

  1. Log in as the oracle user.

  2. If you are not installing the software on the local computer, then run the following command on remote machine:

    • Bourne, Bash, or Korn shell:

      $ export DISPLAY=localhost:0.0
      
    • C shell:

      % setenv DISPLAY local_host:0.0
      

    In this example, local_host is the host name or IP address of the computer that you want to use to display Oracle Universal Installer.

    Now to enable X applications, run the following command on the machine that you want to use to display Oracle Universal Installer:

    $ xhost + [fully_qualified_remote_host_name]
    
  3. Enter the following commands to start Oracle Universal Installer, where patchset_directory is the directory where you unpacked the patch set software:

    % cd patchset_directory/Disk1
    % ./runInstaller
    
  4. On the Welcome screen, click Next.

  5. On the Specify Home Details screen, select the name of the Oracle home that you want to update, or select the Path that you want to update from the list, then click Next.

  6. Enter your e-mail address and password for your My Oracle Support account to be informed of security issues, then click Next.

    Note:

    The registration and configuration can also be done manually after patch set installation.

    The OCM registration page appears only while applying 10.2.0.5 patch over existing Database instances alone.

  7. If you are installing the patch set on an Oracle RAC cluster, click Next when the Selected Nodes screen appears.

  8. On the Product-specific Prerequisite Checks screen, correct any reported errors, and click Next.

  9. On the Summary screen, click Install.

    This screen lists all of the patches available for installation.

  10. When prompted, run the $ORACLE_HOME/root.sh script as the root user. If you are applying the patch set to an Oracle RAC installation, then run the root.sh script on each node of the cluster.

  11. On the End of Installation screen, click Exit, then click Yes to exit from Oracle Universal Installer.

Note:

If you are applying this patch set to an Oracle Clusterware installation, then complete all of the steps displayed on the Oracle Universal Installer screen.

The Oracle Clusterware installation instructions displayed on the Oracle Universal Installer screen are also available in the CRS_home/install/readme.txt file.

When applying this patch set on an Oracle Clusterware home, Oracle Universal Installer prompts you to run the root102.sh script from $ORACLE_HOME/install. You must run this script as the root user on all nodes.

 
注意,升级的过程中要关闭sqlplus,否则在安装的过程中会报错!如在安装的过程中弹出错误对话框,检查sqlplus是否关闭!
 
完成升级安装后执行如下的步骤:
After you install the patch set, you must perform the following steps on every database associated with the upgraded Oracle home:

Note:

If you do not run the catupgrd.sql script as described in this section and you start up a database for normal operation, then ORA-01092: ORACLE instance terminated. Disconnection forced errors will occur and the error ORA-39700: database must be opened with UPGRADE option will be in the alert log.
 
  1. Log in as the Oracle software owner user.

  2. For Oracle RAC installations, start listener on each node of the cluster as follows:

    $ srvctl start listener -n node
    
  3. If you are using Automatic Storage Management, start the Automatic Storage Management instance.

  4. For single-instance installations, start the listener as follows:

    $ lsnrctl start
    
  5. For single-instance installations, use SQL*Plus to log in to the database as the SYS user with SYSDBA privileges:

    $ sqlplus /nolog 
    SQL> CONNECT SYS AS SYSDBA
    Enter password:SYS_password
    

    Users of single-instance implementations should now bypass steps that apply to Oracle RAC installations.

  6. For Oracle RAC installations:

    1. Use SQL*Plus to log in to the database as the SYS user with SYSDBA privileges:

      $ sqlplus /nolog 
      SQL> CONNECT SYS AS SYSDBA
      Enter password: SYS_password
      SQL> STARTUP NOMOUNT
      
    2. Set the CLUSTER_DATABASE initialization parameter to FALSE:

      SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile; 
      
    3. Shut down the database:

      SQL> SHUTDOWN
      
  7. Enter the following SQL*Plus commands:

    SQL> STARTUP UPGRADE
    SQL> SPOOL patch.log
    SQL> @?/rdbms/admin/catupgrd.sql
    SQL> SPOOL OFF
    
  8. Review the patch.log file for errors and inspect the list of components that is displayed at the end of catupgrd.sql script.

    This list provides the version and status of each SERVER component in the database.

  9. If necessary, rerun the catupgrd.sql script after correcting any problems.

  10. Restart the database:

    SQL> SHUTDOWN IMMEDIATE
    SQL> STARTUP
    
  11. 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
    

    Note:

    When the 10.2.0.5 patch set is applied to an Oracle10 g Standard Edition database, there may be 54 invalid objects after the utlrp.sql script runs. These objects belong to the unsupported components and do not affect the database operation.

    Ignore any messages indicating that the database contains invalid recycle bin objects similar to the following:

    BIN$4lzljWIt9gfgMFeM2hVSoA==$0
    

    This issue is tracked with Oracle bug 9386364.

  12. Run the following command to check the status of all the components after the upgrade:

    SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
    

    In the output of the preceding command, the status of all the components should be VALID for a successful upgrade.

  13. If you are using the Oracle Recovery Manager catalog, enter the following command:

    $ rman catalog username/password@alias 
    RMAN> UPGRADE CATALOG;
    
    1. For Oracle RAC installations:
      1. Set the CLUSTER_DATABASE initialization parameter to TRUE:
      SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile; 
      
    2. Restart the database:

      SQL> SHUTDOWN IMMEDIATE
      SQL> STARTUP
      
    3. Start any database services that you want to use:

      $ srvctl start service -d db_name -s service_name
      
      1. To configure and secure Enterprise Manager follow these steps:
      2. Ensure the database and Listener are operational.
        1. In the case of a single instance, execute
        emca -upgrade db
        
      • In the case of Oracle RAC, execute

        emca -upgrade db -cluster
        
      1. Note:
      2. If you are upgrading a database where Oracle Database Control is configured in non-secure mode, then Oracle Database Control will run in secure mode after upgrade.

完成升级如下:

 

升级过程中遇到的问题:

1,启动不了图形界面,修改了/etc/redhat-release中的版本也不行

详见这里

./runinstaller -ignoreSysPrereqs

使用ignoreSysPrereqs标记会跳过对先决条件的检查

2.出现如下错误

解决办法:就如Error中所说,关闭sqlplus,监听,服务即可
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值