ORA-39700:DATABASE MUST BE OPENED WITH UPGRADE OPTION

来源:互联网 发布:java声明构造方法 编辑:程序博客网 时间:2024/05/21 07:49

ORA-01092:ORACLE INSTANCE TERMINATED DISCONNECTION

ORA-00740:BOOTSTRAP PROCESS FAILURE

ORA-39700:DATABASE MUST BE OPENED WITH UPGRADE OPTION



前几天把我的测试系统REDHAT LINUX AS4+ORACLE10.2.0.1用oracle新发布的p6810189_10204_Linux-x86.zip升级到了10.2.0.4,然后打开数据库时打不开,并就错误:
alterlog有如下内容:
ORA-39700: database must be opened with UPGRADE option
Thu Feb 28 23:02:49 2008
Error 704 happened during db open, shutting down database
USER: terminating instance due to error 704
Instance terminated by USER, pid = 1635
ORA-1092 signalled during: ALTER DATABASE OPEN...

按照提示,SQL>startup update
数据库可以打开,操作也正常.

但是如果关闭数据库重起后还是报以上错误,还是要加update的参数才能打开.


方法一(很遗憾使用该方法执行完第一个SQL句后 没有返回来 假死在那了)

因为数据库升级以后数据字典的内容被修改了,需要运行catalog.sql和catproc.sql这两个脚本再更新数据字典。
处理方法如下:
SQL>startup upgrade;
SQL>@ORACLE_HOME\rdbms\admin\catupgrd.sql;
这个脚本会执行比较长时间,我在虚拟机上用了快22分钟.
Total Upgrade Time: 00:21:58
执行完成以后,关闭数据库,再使用正常模式启动数据库.
再运行一下utlrp.sql这个脚本来重新编译一下一些无效的对象
SQL>startup
SQL>@ORACLE_HOME\rdbms\admin\utlrp.sql;
...
OBJECTS WITH ERRORS
-------------------
                  0
...
ERRORS DURING RECOMPILATION


方法二   这里使用migrate 启动选项 并且执行最后一个SQL语句

升级分为2个步骤:安装升级包、升级数据库

升级数据库步骤:
1、sqlplus 登录 /as sysdba
2、确认版本:select * from v$version
3、shutdown immediate后再startup migrate(迁移模式)
4、运行DB补丁脚本升级DB:SQL> @$ORACLE_HOME/rdbms/admin/catpatch.sql


方法三 使用图形工具

.3.1 Upgrading a Release 10.2 Database using Oracle Database Upgrade Assistant

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 Oracle Database Upgrade Assistant as described in this section, then the following errors are displayed:

ORA-01092: ORACLE instance terminated.

ORA-39700: database must be opened with UPGRADE option.


  1. Log in as the Oracle software owner user.

  2. Set the values for the environment variables $ORACLE_HOME, $ORACLE_SID and $PATH.

  3. For single-instance installations, if you are using Automatic Storage Management, start the Automatic Storage Management instance.

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

    $ lsnrctl start
  5. Run Oracle Database Upgrade Assistant either in the interactive or noninteractive mode:

    Interactive mode:

    Enter the following command from the command prompt:

    $ dbua

    Complete the following steps displayed in the Oracle Database Upgrade Assistant screen:

    1. On the Welcome screen, click Next.

    2. On the Databases screen, select the name of the Oracle Database that you want to update, then clickNext.


      Note:

      For Oracle RAC, enter the SYS password to do the upgrade.
    3. On the Recompile Invalid Objects screen, select the Recompile the invalid objects at the end of upgrade option, then clickNext.

    4. If you have not taken the back up of the database earlier, on the Backup screen, select theI would like to take this tool to backup the database option, stipulate the Path, then clickNext.

    5. On the Summary screen, check the summary, then click Finish.

    6. On the End of Database Upgrade Assistant's Upgrade Results screen, click Close to exit from Oracle Database Upgrade Assistant.


    Note:

    If you are upgrading a database having dbcontrol configured in non-secure mode, after upgrade dbconsole will run in secure mode.

    Noninteractive mode:

    Enter the following command to upgrade Oracle Database using Oracle Database Upgrade Assistant in noninteractive mode:

    $ dbua -silent -dbname $ORACLE_SID -oracleHome $ORACLE_HOME -sysDBAUserName <span class="italic">UserName</span> -sysDBAPassword <span class="italic">SYS_password</span> -recompile_invalid_objects true
  6. If you are using the Oracle Recovery Manager catalog, enter the following command:

    $ rman catalog <span class="italic">username</span>/<span class="italic">password</span><span class="italic">@alias</span>RMAN> UPGRADE CATALOG;
  7. For Oracle RAC installations, start any database services that you want to use by entering the following command:

    $ srvctl start service -d <span class="italic">db_name</span> -s <span class="italic">service_name</span>
0 0