最近为用户进行跨版本升级测试,由于数据库库比较大,采用RMAN方式升级,在进行完介质恢复后,采用upgrade方式打开数据库时候,提示ora-39701错误,如下:
startup upgrade;
ORA-39701 database must be mounted EXCLUSIVE for UPGRADE or DOWNGRADE
原因是因为我这里是RAC环境,在RAC环境下,采用脚本升级的方式,必须禁掉集群参数
SQL> STARTUP NOMOUNT
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE scope=spfile ;
SQL> SHUTDOWN IMMEDIATE
SQL> startup upgrade;
另外在执行升级脚本@?/rdbms/admin/catupgrd.sql的时候,提示如下错误:
SELECT TO_NUMBER('MUST_HAVE_RUN_PRE-UPGRADE_TOOL_FOR_TIMEZONE')
* ERROR at line 1:
ORA-01722: invalid number
这是由于我在升级前没有执行Pre-Upgrade Script脚本,解决方式如下
catupgrd.sql fails With ORA-01722 Invalid Number after running the Pre-Upgrade Script [ID 1466464.1] |
To Bottom |
|
Modified:19-Sep-2012Type:PROBLEMStatus:PUBLISHEDPriority:3 |
|
In this Document
Symptoms |
|
WARNING |
|
1: If you did not run the pre-upgrad script, this action described in this note can cause corruption of the database. |
|
2: The TZ value you insert into that table MUST be the proper value of the pre-upgraded DB. Any other value can cause corruption of the database. |
Cause |
Solution |
References |
Applies to:
Oracle Server - Enterprise Edition - Version 10.2.0.3 and later
Information in this document applies to any platform.
Symptoms
While upgrading database version homes, the upgradeprocess fails with the below error:
SELECT TO_NUMBER('MUST_HAVE_RUN_PRE-UPGRADE_TOOL_FOR_TIMEZONE')
*
ERROR at line 1:
ORA-01722: invalid number
This Error is reported even after running the Pre-Upgrade Script &when the latest/acceptable DST Patch is applied on both the Source & TargetOracle Homes.
WARNING
1: If you didnot run the pre-upgrad script, this action described in this note can causecorruption of the database.
2: The TZ valueyou insert into that table MUST be the proper value of the pre-upgraded DB. Anyother value can cause corruption of the database.
Cause
The Pre-Upgrade Script is not creating the registry$database table& inserting the Platform DST Patch Information.
The error may also appear if the the registry$database tableexists, but does not contain the required information.
Solution
1) If the registry$database table does not get created by thePre-Upgrade Script,then it may be created using the below SQL statement:
SQL> 'CREATE TABLE registry$database(
platform_id NUMBER,
platform_name VARCHAR2(101),
edition VARCHAR2(30),
tz_version NUMBER
)';
2) Then manually insert the Platform DST Patchinformation using the below SQL statement:
SQL> 'INSERT intoregistry$database
(platform_id, platform_name, edition, tz_version)
VALUES ((selectplatform_id from v$database),
(select platform_name from v$database),
NULL,
(select version from v$timezone_file))';
3) Query the newly created Table for the accurate results.
SQL> select * from sys.registry$database;
The output should look similar to the one shown below.
PLATFORM_ID PLATFORM_NAME EDITION TZ_VERSION
--------------------------------------------------------------------------------
6 AIX-Based Systems(64-bit) 17
If you are able to get the required output, then you may switch tothe Target Home & start the Manual Upgrade from there.
If the registry$database table exists but does not contain the requiredinformation then the pertinent DST information can be added using the Commandprovided in Step 2.
References
BUG:14174083 - PRE-UPGRADE FAILS TO CREATE REGISTRY$DATABASE& POPULATE THE TZ VALUE
NOTE:1351112.1 - Information Center: Upgradingand Migration Oracle Database
NOTE:1152016.1 - Master Note For Oracle DatabaseUpgrades and Migrations