oracle 升級到 11.2.0.2

luckyfriends發表於2013-02-21
Oracle112.2.0.2升級還沒有測試過,不過新版本的安裝做過幾次了。升級步驟基本上和以前差不多,看著提示應該就能坐下了,除非運氣差遇到什麼問題。總得來說Oracle的安裝(包括RAC)越來越簡單人性化,安裝過程中都有提示。
後面抽時間實測一遍,下面是轉載一個升級過程,比較詳盡。

【升級前版本: 】
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

【升級後版本:】
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0      Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

【升級目的:】解決secure file 的 ora-07445 錯誤

【升級步驟:】

1.  準備步驟:匯入之前在做 update 和 delete 操作的時候提示 ora-7445 錯誤的表和相關記錄,嘗試透過 update 和 delete 操作在測試環境重現 ora-7445 錯誤

2.  下載補丁包、確認系統包足夠

3.  開始安裝 oracle 補丁包

oracle 升級到 11.2.0.2

提示是否需要更新相關的軟體

oracle 升級到 11.2.0.2


可以有如下選擇:

(1)選擇只安裝軟體,之後透過DBUA或者手工執行升級指令碼來升級

(2)選擇升級資料庫,之後不需要DBUA升級,也不需要手工執行升級指令碼

oracle 升級到 11.2.0.2

oracle 升級到 11.2.0.2

對單例項的資料庫進行升級

oracle 升級到 11.2.0.2

選擇語言:英語+簡體中文

oracle 升級到 11.2.0.2

選擇企業版

oracle 升級到 11.2.0.2

剩下的就和正常安裝資料庫差不多。

4.  軟體安裝完畢之後:
(1)如果之前選擇了升級存在的資料庫,那麼會進入升級介面:
oracle 升級到 11.2.0.2

oracle 升級到 11.2.0.2

升級程式會檢查 recycle bin 是否清空,包括 dba_recycle 和 user_recycle;同時也會檢查系統裡面的無效物件,最好在升級前就確認無效物件。

oracle 升級到 11.2.0.2


oracle 升級到 11.2.0.2

如果選擇在升級前備份資料,需要確認磁碟空間是否足夠做備份。如果磁碟空間不足,那麼會出現提示:
oracle 升級到 11.2.0.2

oracle 升級到 11.2.0.2

oracle 升級到 11.2.0.2

oracle 升級到 11.2.0.2

oracle 升級到 11.2.0.2

開始升級啦,升級和以往一樣慢。

(2)如果之前選擇了只安裝軟體,簡單描述一下手工升級資料字典流程:

【步驟1:】 關閉資料庫:
shut immediate;

【步驟2:】 關閉監聽器:
lsnrctl stop

【步驟3:】 修改 $ORACLE_HOME:
cd /home/oracle
mv  app app_old    
mv appnew app

【步驟4:】不一定必要,取決於 datafile、logfile、controlfile 儲存的位置,如果和 $ORACLE_HOME 無關,則不需要修改。

mv /home/oracle/app_old/oracle/oradata/$ORACLE_SID/datafile/  /home/oracle/app/oracle/oradata/$ORACLE_SID/datafile/  
mv /home/oracle/app_old/oracle/oradata/$ORACLE_SID/onlinelog/  /home/oracle/app/oracle/oradata/$ORACLE_SID/onlinelog/  
mv /home/oracle/app_old/oracle/oradata/$ORACLE_SID/controlfile/ /home/oracle/app/oracle/oradata/$ORACLE_SID/controlfile/ 

【步驟5:】複製密碼檔案 orapw$ORACLE_SID  
SPFILE 檔案 spfile$ORACLE_SID.ora   
監聽配置檔案 listener.ora  
本地 tnsnames.ora  sqlnet.ora檔案
到新 $ORACLE_HOME

【步驟6:】重啟資料到upgrade,升級資料字典
sqlplus / as sysdba
startup upgrade;
@?/rdbms/admin/catupgrd
shut immediate

【步驟7:】重啟資料庫,編譯無效物件
sqlplus / as sysdba
startup 
@?/rdbms/admin/utlrp

【步驟8:】確認升級後版本
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0      Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

SQL> col namespace for a20;
SQL> col version for a15;
SQL> col comments for a40;
SQL> select namespace,version,comments from registry$history;

NAMESPACE            VERSION         COMMENTS
-------------------- --------------- ----------------------------------------
view invalidation
SERVER               11.2.0.2.0      Upgraded from 11.2.0.1.0
SERVER               11.2.0.2        Patchset 11.2.0.2.0
view invalidation
SERVER               11.2.0.2.0      Upgraded from 11.2.0.1.0

SQL> 

【步驟9:】確認 opatch 能用:opatch lsinventory -detail

Invoking OPatch 11.2.0.1.1

Oracle Interim Patch Installer version 11.2.0.1.1
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /home/oracle/app/oracle/product/11.2.0
Central Inventory : /home/oracle/app/oraInventory
from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.1
OUI version       : 11.2.0.2.0
OUI location      : /home/oracle/app/oracle/product/11.2.0/oui
Log file location : /home/oracle/app/oracle/product/11.2.0/cfgtoollogs/opatch/opatch2010-11-10_14-54-16PM.log

Patch history file: /home/oracle/app/oracle/product/11.2.0/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /home/oracle/app/oracle/product/11.2.0/cfgtoollogs/opatch/lsinv/lsinventory2010-11-10_14-54-16PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1): 

Oracle Database 11g                                                  11.2.0.2.0
There are 1 products installed in this Oracle Home.


Installed Products (136): 

Agent Required Support Files                                         10.2.0.4.3
Assistant Common Files                                               11.2.0.2.0
Bali Share                                                           1.1.18.0.0
Buildtools Common Files                                              11.2.0.2.0
Character Set Migration Utility                                      11.2.0.2.0
Cluster Verification Utility Common Files                            11.2.0.2.0
Database Configuration and Upgrade Assistants                        11.2.0.2.0
Database SQL Scripts                                                 11.2.0.2.0
Database Workspace Manager                                           11.2.0.2.0
Deinstallation Tool                                                  11.2.0.2.0
Enterprise Edition Options                                           11.2.0.2.0
Enterprise Manager Agent                                             10.2.0.4.3
Enterprise Manager Agent Core Files                                  10.2.0.4.3
Enterprise Manager Common Core Files                                 10.2.0.4.3
Enterprise Manager Common Files                                      10.2.0.4.3
Enterprise Manager Database Plugin -- Agent Support                  11.2.0.2.0
Enterprise Manager Database Plugin -- Repository Support             11.2.0.2.0
Enterprise Manager Grid Control Core Files                           10.2.0.4.3
Enterprise Manager plugin Common Files                               11.2.0.2.0
Enterprise Manager Repository Core Files                             10.2.0.4.3
Exadata Storage Server                                               11.2.0.1.0
Expat libraries                                                       2.0.1.0.1
Generic Connectivity Common Files                                    11.2.0.2.0
HAS Common Files                                                     11.2.0.2.0
HAS Files for DB                                                     11.2.0.2.0
Installation Common Files                                            11.2.0.2.0
Installation Plugin Files                                            11.2.0.2.0
Installer SDK Component                                              11.2.0.2.0
JAccelerator (COMPANION)                                             11.2.0.2.0
LDAP Required Support Files                                          11.2.0.2.0
...

XDK Required Support Files                                           11.2.0.2.0
XML Parser for Java                                                  11.2.0.2.0
XML Parser for Oracle JVM                                            11.2.0.2.0
There are 136 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


--------------------------------------------------------------------------------

OPatch succeeded.

如果 Opatch 不能用,需要確認 /etc/oratab 和 /etc/oraInst.loc 裡面指向的值都正確。
複製原 oraInventory 到現在的 oraInventory 目錄下:
mv /home/oracle/app_old/oraInventory /home/oracle/app/oraInventory

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

相關文章