AIX6.1上打10G PATCH時報libjox10.a無法覆蓋的錯誤解決

djb1008發表於2012-07-05

一. 問題描述
在AIX6.1(6100-01-06-0939)上升級ORACLE資料庫(版本從10.2.0.4升級到10.2.0.5)時,報一個出錯視窗,說:libjox10.a無法複製.
我選擇了ignore,繼續安裝(在這裡種下了隱患)

10.2.0.5的patch安裝完了,將資料庫啟動到upgrade狀態,執行catupgrd.sql進行資料庫的升級時,遇到了ora-01722錯誤,錯誤描述如下:

錯誤的資訊如下:
打補丁的時候,,在執行等等,此時如果ignore,則會導致後面執行catupgrd.sql報ora-01722的錯誤,這個檔案可能包含了一些物件的定義.

[@more@]

SQL> @?/rdbms/admin/catupgrd.sql


DOC>#######################################################################
DOC>#######################################################################
DOC> The following statement will cause an "ORA-01722: invalid number"
DOC> error if the database has not been opened for UPGRADE.
DOC>
DOC> Perform a "SHUTDOWN ABORT" and
DOC> restart using UPGRADE.
DOC>#######################################################################
DOC>#######################################################################
DOC>#
SELECT TO_NUMBER('MUST_BE_OPEN_UPGRADE') FROM v$instance
*
ERROR at line 1:
ORA-01722: invalid number


catupgrd.sql 無法進行下去,資料庫升級失敗.

二. 問題分析
在metalink上搜尋相關文章,找到DOC_ID=435536.1的文章,內容大致如下:
......
Symptoms
You are getting following error while performing upgrade/downgrade of the database.
This error appears when executing script in the following release only

catbkout.sql( Available on 9.2.0.7 and Above )
catbkout.sql(Available on 10.1.0.5 and Above )
catbkout.sql( 10.2.0.2 and Above )
catupgrd.sql (For 10g R2 Above)

SQL> @?/rdbms/admin/catupgrd.sql

DOC> The following statement will cause an "ORA-01722: invalid number"
DOC> error if the database has not been opened for UPGRADE.
DOC>
DOC> Perform a "SHUTDOWN ABORT" and
DOC> restart using UPGRADE.
DOC>#
SELECT TO_NUMBER('MUST_BE_OPEN_UPGRADE') FROM v$instance
*
ERROR at line 1:
ORA-01722: invalid number

Cause
Instance has not started with UPGRADE ( MIGRATE for 9.2) mode , which caused catupgrd.sql failed execute.
There can be multiple cause for the ORA-01722 error. Following are few listed
1. Database not started as UPGRADE or MIGRATE Mode.
2. SQL*PLUS session user running this script is not SYS.
3. Database server version is not correct for this script.
4. If the SYSAUX tablespace does not exist or is not ONLINE for READ WRITE, PERMANENT, EXTENT MANAGEMENT LOCAL, andSEGMENT SPACE MANAGEMENT AUTO.[Applicable Only For 10G]

Solution
1. Ensure you have followed the following criteria
• Database as UPGRADE or MIGRATE Mode.
• Logged on as SYS user when running this script.
• Database server version matches for this script i.e catupgrd.sql for 10.2 need to be executed for 10.2 database
• If the SYSAUX tablespace exist and is ONLINE for READ WRITE, PERMANENT, EXTENT MANAGEMENT LOCAL and SEGMENT SPACE MANAGEMENT AUTO.[Applicable Only For 10G]
2. If you are meeting above criteria , then open the script from appropriate location %ORACLE_HOME%/rdbms/admin
3. Goto the SQL command which fails with error i.e in this case
SELECT TO_NUMBER('MUST_BE_OPEN_UPGRADE') FROM v$instance
and check you have performed the criteria mentioned above SQL command
While running the catbkout .sqlor catupgr.sql , you will also see the following appear on console . These are comments before SQL , which are for information purpose.

The following statement will cause an "ORA-01722: invalid number"
error
if the user running this script is not SYS. Disconnect
and reconnect with AS
SYSDBA.

三. 問題解決
我檢查了自己的環境,沒有文章中提到的問題.分析一下,可能還是在打patch的時候,遇到libjox10.a檔案無法覆蓋的問題,這個時候不應該選擇ignore.
而是應該刪除舊的檔案,讓patch複製新的檔案過來.這個檔案是二進位制檔案,其中包含了很多物件的定義(例如 MUST_BE_OPEN_UPGRADE的定義).
再次執行10.2.0.5 patch安裝程式(runInstaller),在libjox10.a檔案報錯時,不退出當前出錯介面,執行下面的命令,刪除舊的檔案.
$ cd /oracle/product/10.2.0/db/lib
$ ls -lt libjox10.a
-rw-r--r-- 1 oracle oinstall 13257611 May 10 2008 libjox10.a
$ mv libjox10.a libjox10.a.bak
然後在出錯介面裡,選擇retry,補丁程式可以正常執行下去了.

patch安裝完成後,進行資料庫的升級,不再報ora-01722的錯誤了.

SQL>Startup upgrade
SQL>@?/rdbms/admin/catupgrd.sql

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/32980/viewspace-1058732/,如需轉載,請註明出處,否則將追究法律責任。

相關文章