中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

10G RAC升級到11G的方法(官方)

發布時間:2020-08-14 05:59:10 來源:ITPUB博客 閱讀:223 作者:Davis_itpub 欄目:建站服務器

在 Oracle Enterprise Linux 上升級到 Oracle RAC 11g

了解如何在 Oracle Enterprise Linux 5 上逐步將 Oracle RAC 10g 第 2 版升級到 Oracle RAC 11g

作者:Vincent Chan

2007 年 10 月發布

Oracle 最近發布了大家期待已久的 Oracle 數據庫 11g(即,新一代網格計算)。該版本在網格計算方面取得了顯著進步,提供了大量令人難以置信的新特性,從而進一步改進了數據庫可用性和可管理性、性能監視、診斷以及數據庫升級過程。其中不乏令人印象深刻的創新功能,例如 Oracle 真正應用測試、具有實時查詢功能的物理備用、新的分區方案以及結果緩存等關鍵特性。

轉自:http://www.oracle.com/technology/global/cn/pub/articles/chan-upgrade.html

基本上,將 Oracle RAC 10g 升級到 Oracle RAC 11g 的方法有三種:

  • 使用 Oracle 數據庫升級助手 (DBUA) 實用程序
  • 手動升級
  • 導出 Oracle 10g 數據庫,然后將其導入 Oracle 11g 數據庫

推薦的方法是,使用 DBUA 升級您的數據庫和自動存儲管理 (ASM)。DBUA 可以執行許多人工任務,從而顯著簡化升級過程。在本指南中,我們將描述使用 DBUA 進行升級的過程。

本指南相關下載:

  • 適用于 Linux x86 的 Oracle 集群件第 1 版 (11.1.0.6.0)
  • 適用于 Linux x86 的 Oracle 數據庫 11g 第 1 版 (11.1.0.6.0)

概述

本指南分為以下步驟:

  1. 準備安裝
  2. 升級 Oracle 集群件
  3. 安裝 Oracle 數據庫 11g 第 1 版軟件
  4. 升級 Oracle 數據庫
  5. 升級 Oracle ASM
  6. 探索 Oracle 數據庫 11g

Oracle RAC 10g 環境概述:

主機名 實例名 數據庫名 集群件文件存儲 數據庫文件存儲
merlin1 devdb1 devdb Raw ASM
merlin2 devdb2 devdb Raw ASM


主機名 Oracle 集群件主目錄 Oracle ASM 主目錄 Oracle 主目錄
merlin1 /u02/crs/oracle /u01/app/oracle/product/10.2.0/db_1 /u01/app/oracle/product/10.2.0/db_1
merlin2 /u02/crs/oracle /u01/app/oracle/product/10.2.0/db_1 /u01/app/oracle/product/10.2.0/db_1


Oracle 集群件文件

設備名

Oracle Cluster Registry /dev/sdb1
Voting Disk /dev/sdc1

Oracle RAC 11g 環境概述:

主機名 實例名 數據庫名 集群件文件存儲 數據庫文件存儲
merlin1 devdb1 devdb Raw ASM
merlin2 devdb2 devdb Raw ASM


主機名 Oracle 集群件主目錄 Oracle ASM 主目錄 Oracle 主目錄
merlin1 /u02/crs/oracle /u01/app/oracle/product/11.1.0/asm /u01/app/oracle/product/11.1.0/db_1
merlin2 /u02/crs/oracle /u01/app/oracle/product/11.1.0/asm /u01/app/oracle/product/11.1.0/db_1


Oracle 集群件文件 設備名
Oracle Cluster Registry /dev/sdb1
Voting Disk /dev/sdc1

您將在每個節點的 Oracle 集群件主目錄、Oracle ASM 主目錄和 Oracle 主目錄中安裝軟件,以實現冗余和更高的可用性。

1. 準備安裝

執行完整的備份

在升級到 Oracle RAC 11g 之前,備份您的 Oracle RAC 10g 環境。

安裝其他軟件包

以 root 用戶身份安裝以下程序包(如果它們尚未安裝到 RAC 節點上)。這些程序包可以從 Enterprise-R5-GA-Server-i386-disc2.iso 和 Enterprise-R5-GA-Server-i386-disc3.iso 中提取。

  1. compat-libstdc++-33-3.2.3-61.i386.rpm
  2. elfutils-libelf-devel-0.125-3.e15.i386.rpm
  3. gcc-4.1.1-52.e15.i386.rpm
  4. gcc-c++-4.1.1-52.e15.i386.rpm
  5. glibc-devel-2.5-12.i386.rpm
  6. libaio-devel-0.3.106-3.2.i386.rpm
  7. libstdc++-devel-4.1.1-52.e15.i386.rpm
  8. sysstat-7.0.0-3.e15.i386.rpm
  9. unixODBC-2.2.11-7.1.i386.rpm
  10. unixODBC-devel-2.2.11-7.1.i386.rpm

提取這些程序包之后,以 root 用戶身份執行以下命令。

# ls -1
elfutils-libelf-devel-0.125-3.e15.i386.rpm
libaio-devel-0.3.106-3.2.i386.rpm
unixODBC-2.2.11-7.1.i386.rpm
unixODBC-devel-2.2.11-7.1.i386.rpm 
#
# rpm -Uvh *.rpm

檢驗內核參數

最低內核參數要求如下所示。如果必要,在兩個節點的 /etc/sysctl.conf 中配置相應的參數。

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144

2. 升級 Oracle 集群件

將 Oracle 集群件升級到版本 10.2.0.3

如果您希望執行滾動升級,在升級到 Oracle RAC 11g 之前,Oracle 集群件的版本必須至少是 10.2.0.3 或帶有 CRS 2 號補丁包的 10.2.0.2(參見錯誤 5256865)。10.2.0.3 補丁集 (5337014) 可以從 Oracle Metalink 下載。

參見 Oracle Metalink 說明 419058.1 或針對 Linux x86 的 Oracle 10.2.0.3 補丁集的相關信息。
merlin1-> crsctl query crs activeversion
CRS active version on the cluster is [10.2.0.3.0]

Oracle 集群件安裝前檢查

集群驗證實用程序 (CVU) 可降低安裝 RAC 的復雜性并減少所花費的時間。該工具將掃描集群環境中所有必需的組件,以確保滿足成功安裝的所有條件。

從 OTN 下載 Oracle 集群件 11.1.0.6 軟件并解壓縮到臨時目錄,然后執行 runcluvfy.sh。

/stage/clusterware/runcluvfy.sh stage -pre crsinst -n all -verbose > /tmp/prechecks.log

驗證是否滿足所有前提條件。您可以忽略針對 openmotif-2.2.3-3.RHEL3 的“Package existence checked failed”消息。

停止所有數據庫資源

merlin1-> srvctl stop database -d devdb
merlin1-> srvctl stop asm -n merlin1
merlin1-> srvctl stop asm -n merlin2
merlin1-> srvctl stop nodeapps -n merlin1
merlin1-> srvctl stop nodeapps -n merlin2
merlin1-> crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.devdb.db   application    OFFLINE   OFFLINE
ora....b1.inst application    OFFLINE   OFFLINE
ora....b2.inst application    OFFLINE   OFFLINE
ora....SM1.asm application    OFFLINE   OFFLINE
ora....N1.lsnr application    OFFLINE   OFFLINE
ora....in1.gsd application    OFFLINE   OFFLINE
ora....in1.ons application    OFFLINE   OFFLINE
ora....in1.vip application    OFFLINE   OFFLINE
ora....SM2.asm application    OFFLINE   OFFLINE
ora....N2.lsnr application    OFFLINE   OFFLINE
ora....in2.gsd application    OFFLINE   OFFLINE
ora....in2.ons application    OFFLINE   OFFLINE
ora....in2.vip application    OFFLINE   OFFLINE

準備要升級的 Oracle 集群件主目錄

在每個節點上執行 preupdate.sh 腳本,以準備要升級的集群件主目錄。該腳本可停止 Oracle 集群件組件并更改 Oracle 集群件主目錄中文件的權限。

以 root 用戶身份在每個節點上執行,
# cd /stage/clusterware/upgrade
# ./preupdate.sh -crshome /u02/crs/oracle -crsuser oracle
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources.This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun.The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is down now.

升級 Oracle 集群件

您只需在一個節點上運行 Oracle Universal Installer (OUI)。OUI 將在每個節點上自動安裝現有的二進制軟件。

以 oracle 用戶身份在 merlin1 上執行,

merlin1-> /stage/clusterware/runInstaller
  1. 歡迎頁面:單擊 Next
  2. 指定 Home 詳細內容:驗證 CRS_Home 目錄 (/u02/crs/oracle) 顯示正確。
  3. 指定硬件集群安裝模式:驗證所有節點均已選擇。
  4. 特定于產品的必要條件檢查:驗證總體結果成功。
  5. 摘要:單擊 Install
  6. 執行配置腳本:以 root 用戶身份按順序執行以下腳本(一次執行一個)。在當前腳本完成后,再繼續執行下一個腳本。
    1. 在 merlin1 上執行 /u02/crs/oracle/install/rootupgrade。
    2. 在 merlin2 上執行 /u02/crs/oracle/install/rootupgrade。

在 merlin1 上,

# /u02/crs/oracle/install/rootupgrade
Checking to see if Oracle CRS stack is already up...

copying ONS config file to 11.1 CRS home
/bin/cp:`/u02/crs/oracle/opmn/conf/ons.config' and `/u02/crs/oracle/opmn/conf/ons.config' are the same file
/u02/crs/oracle/opmn/conf/ons.config was copied successfully to /u02/crs/oracle/opmn/conf/ons.config
WARNING:directory '/u02/crs' is not owned by root
WARNING:directory '/u02' is not owned by root
Oracle Cluster Registry configuration upgraded successfully
Adding daemons to inittab
Attempting to start Oracle Clusterware stack
Waiting for Cluster Synchronization Services daemon to start
Cluster Synchronization Services daemon has started
Waiting for Event Manager daemon to start
Event Manager daemon has started
Cluster Ready Services daemon has started
Oracle CRS stack is running under init(1M)
clscfg:EXISTING configuration version 3 detected.
clscfg:version 3 is 10g Release 2.
Successfully accumulated necessary OCR keys.
Using ports:CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>:<nodename> <private interconnect name> <hostname>
node 1:merlin1 merlin1-priv merlin1
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
CRS stack on this node, is successfully upgraded to 11.1.0.6.0
Checking the existence of nodeapps on this node
Creating '/u02/crs/oracle/install/paramfile.crs' with data used for CRS configuration
Setting CRS configuration values in /u02/crs/oracle/install/paramfile.crs

在 merlin2 上,

# /u02/crs/oracle/install/rootupgrade
Checking to see if Oracle CRS stack is already up...

copying ONS config file to 11.1 CRS home
/bin/cp:`/u02/crs/oracle/opmn/conf/ons.config' and `/u02/crs/oracle/opmn/conf/ons.config' are the same file
/u02/crs/oracle/opmn/conf/ons.config was copied successfully to /u02/crs/oracle/opmn/conf/ons.config
WARNING:directory '/u02/crs' is not owned by root
WARNING:directory '/u02' is not owned by root
Oracle Cluster Registry configuration upgraded successfully
Adding daemons to inittab
Attempting to start Oracle Clusterware stack 
Waiting for Cluster Synchronization Services daemon to start
Cluster Synchronization Services daemon has started
Waiting for Event Manager daemon to start
Waiting for Event Manager daemon to start
Event Manager daemon has started
Cluster Ready Services daemon has started
Oracle CRS stack is running under init(1M)
clscfg:EXISTING configuration version 4 detected.
clscfg:version 4 is 11 Release 1.
Successfully accumulated necessary OCR keys.
Using ports:CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>:<nodename> <private interconnect name> <hostname>
node 2:merlin2 merlin2-priv merlin2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
CRS stack on this node, is successfully upgraded to 11.1.0.6.0
Checking the existence of nodeapps on this node
Creating '/u02/crs/oracle/install/paramfile.crs' with data used for CRS configuration
Setting CRS configuration values in /u02/crs/oracle/install/paramfile.crs


merlin1-> $ORA_CRS_HOME/bin/crsctl check crs
Cluster Synchronization Services appears healthy
Cluster Ready Services appears healthy
Event Manager appears healthy
merlin1-> $ORA_CRS_HOME/bin/crsctl query crs softwareversion
Oracle Clusterware version on node [merlin1] is [11.1.0.6.0] 
merlin1-> $ORA_CRS_HOME/bin/crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [11.1.0.6.0]

merlin2-> $ORA_CRS_HOME/bin/crsctl check crs 
Cluster Synchronization Services appears healthy
Cluster Ready Services appears healthy
Event Manager appears healthy
merlin2-> $ORA_CRS_HOME/bin/crsctl query crs softwareversion
Oracle Clusterware version on node [merlin2] is [11.1.0.6.0] 
merlin2-> $ORA_CRS_HOME/bin/crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [11.1.0.6.0]
  1. 返回到 merlin1 的執行配置腳本屏幕,然后單擊“OK”。
  2. 配置助手:驗證所有檢查均成功。OUI 在最后會執行集群件安裝后檢查。如果 CVU 失敗,請更正問題,并以 oracle 用戶身份重新運行以下命令:
merlin1-> /u02/crs/oracle/bin/cluvfy stage -post crsinst -n merlin1,merlin2

Performing post-checks for cluster services setup

Checking node reachability...

Node reachability check passed from node "merlin1".


Checking user equivalence...

User equivalence check passed for user "oracle".					

Checking Cluster manager integrity...

Checking CSS daemon...

Daemon status check passed for "CSS daemon".

Cluster manager integrity check passed.

Checking cluster integrity...


Cluster integrity check passed


Checking OCR integrity...


Checking the absence of a non-clustered configuration...

All nodes free of non-clustered, local-only configurations.


Uniqueness check for OCR device passed.

Checking the version of OCR...
OCR of correct Version "2" exists.

Checking data integrity of OCR...
Data integrity check for OCR passed.

OCR integrity check passed.

Checking CRS integrity...


Checking daemon liveness...

Liveness check passed for "CRS daemon".

Checking daemon liveness...

Liveness check passed for "CSS daemon".

Checking daemon liveness...

Liveness check passed for "EVM daemon".

Checking CRS health...

CRS health check passed.

CRS integrity check passed.

Checking node application existence...


Checking existence of VIP node application (required)

Check passed.

Checking existence of ONS node application (optional)

Check passed.

Checking existence of GSD node application (optional)

Check passed.

Post-check for cluster services setup was successful.
  1. 安裝結束:單擊 Exit。
在此階段,Oracle 集群件已經升級到 Oracle 集群件 11g,并且所有集群資源應該處于運行狀態。
merlin1-> $ORA_CRS_HOME/bin/crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.devdb.db   application    ONLINE    ONLINE    merlin1
ora....b1.inst application    ONLINE    ONLINE    merlin1
ora....b2.inst application    ONLINE    ONLINE    merlin2
ora....SM1.asm application    ONLINE    ONLINE    merlin1
ora....N1.lsnr application    ONLINE    ONLINE    merlin1 
ora....in1.gsd application    ONLINE    ONLINE    merlin1
ora....in1.ons application    ONLINE    ONLINE    merlin1
ora....in1.vip application    ONLINE    ONLINE    merlin1
ora....SM2.asm application    ONLINE    ONLINE    merlin2
ora....N2.lsnr application    ONLINE    ONLINE    merlin2
ora....in2.gsd application    ONLINE    ONLINE    merlin2
ora....in2.ons application    ONLINE    ONLINE    merlin2
ora....in2.vip application    ONLINE    ONLINE    merlin2

3. 安裝 Oracle 數據庫 11g 第 1 版軟件

創建 Oracle 主目錄

以 oracle 用戶身份在這兩個節點上創建新的 Oracle 主目錄。

mkdir -p  /u01/app/oracle/product/11.1.0/db_1

安裝 Oracle 數據庫軟件

從 OTN 上下載 Oracle 數據庫軟件。
以 oracle 用戶身份在 merlin1 上執行,

merlin1-> /stage/database/runInstaller
  1. 歡迎頁面:單擊 Next
  2. 選擇安裝類型:
    1. 選擇 Custom
  3. 指定 Home 詳細內容:
    1. Oracle 基目錄:/u01/app/oracle。
    2. 名稱:OraDb11g_home1
    3. 路徑:/u01/app/oracle/product/11.1.0/db_1
  4. 指定硬件集群安裝模式:
    1. 選擇 Cluster Installation
    2. 單擊 Select All
  5. 特定于產品的必要條件檢查:驗證總體結果成功。
  6. 可用產品組件:選擇所有必需組件。
  7. 特權操作系統組:
    1. 數據庫管理員 (OSDBA) 組:dba。
    2. 數據庫操作員 (OSOPER) 組:oinstall。
    3. ASM 管理員 (OSASM) 組:dba。
  8. 創建數據庫:
    1. 選擇 Install database Software only
  9. 摘要:單擊 Install
  10. 執行配置腳本:以 root 用戶身份執行下面的腳本。
    1. 在 merlin1 上執行 /u01/app/oracle/product/11.1.0/db_1/root.sh。
    2. 在 merlin2 上執行 /u01/app/oracle/product/11.1.0/db_1/root.sh。
  11. 返回到 merlin1 的執行配置腳本屏幕,然后單擊 OK
  12. 安裝結束:單擊 Exit

4. 升級 Oracle 數據庫

數據庫升級前檢查

在運行數據庫升級助手 (DBUA) 之前,執行數據庫升級前檢查(即 utlu111i.sql)以檢驗是否滿足所有前提條件。作為升級過程的一部分,DBUA 會自動將 cluster_database 參數由 true 更改為 false。進行必要的修改后,重新執行數據庫升級前檢查腳本。

以 sys 用戶身份連接,

SQL> spool /tmp/utlu111i.log
SQL> @/u01/app/oracle/product/11.1.0/db_1/rdbms/admin/utlu111i
Oracle Database 11.1 Pre-Upgrade Information Tool    08-13-2007 18:03:45        
.                                                                               
**********************************************************************          
Database:                                                                       
**********************************************************************          
--> name:DEVDB                                                        
--> version:       10.2.0.3.0                                                   
--> compatible:    10.2.0.1.0                                                   
--> blocksize:     8192                                                         
--> platform.:Linux IA (32-bit)                                            
--> timezone file:V4                                                           
.                                                                               
**********************************************************************          
Tablespaces:[make adjustments in the current environment]                      
**********************************************************************          
--> SYSTEM tablespace is adequate for the upgrade.                              
.... minimum required size:743 MB                                              
--> UNDOTBS1 tablespace is adequate for the upgrade.                            
.... minimum required size:315 MB                                              
--> SYSAUX tablespace is adequate for the upgrade.                              
.... minimum required size:458 MB                                              
--> TEMP tablespace is adequate for the upgrade.                                
.... minimum required size:61 MB                                               
--> EXAMPLE tablespace is adequate for the upgrade.                             
.... minimum required size:66 MB                                               
.                                                                               
**********************************************************************          
Update Parameters:[Update Oracle Database 11.1 init.ora or spfile]             
**********************************************************************          
-- No update parameter changes are required.                                    
.                                                                               
**********************************************************************          
Renamed Parameters:[Update Oracle Database 11.1 init.ora or spfile]            
**********************************************************************          
-- No renamed parameters found.No changes are required.                        
.                                                                               
**********************************************************************          
Obsolete/Deprecated Parameters:[Update Oracle Database 11.1 init.ora or spfile]
**********************************************************************          
--> "background_dump_dest" replaced by  "diagnostic_dest"                       
--> "user_dump_dest" replaced by  "diagnostic_dest"                             
--> "core_dump_dest" replaced by  "diagnostic_dest"                             
.                                                                               
**********************************************************************          
Components:[The following database components will be upgraded or installed]   
**********************************************************************          
--> Oracle Catalog Views         [upgrade]  VALID                               
--> Oracle Packages and Types    [upgrade]  VALID                               
--> JServer JAVA Virtual Machine [upgrade]  VALID                               
--> Oracle XDK for Java          [upgrade]  VALID                               
--> Real Application Clusters    [upgrade]  VALID                               
--> Oracle Workspace Manager     [upgrade]  VALID                               
--> OLAP Analytic Workspace      [upgrade]  VALID                               
--> OLAP Catalog                 [upgrade]  VALID                               
--> EM Repository                [upgrade]  VALID                               
--> Oracle Text                  [upgrade]  VALID                               
--> Oracle XML Database          [upgrade]  VALID                               
--> Oracle Java Packages         [upgrade]  VALID                               
--> Oracle interMedia            [upgrade]  VALID                               
--> Spatial                      [upgrade]  VALID                               
--> Data Mining                  [upgrade]  VALID                               
--> Expression Filter            [upgrade]  VALID                               
--> Rule Manager                 [upgrade]  VALID                               
--> Oracle OLAP API              [upgrade]  VALID                               
.                                                                               
**********************************************************************          
Miscellaneous Warnings                                                          
**********************************************************************          
WARNING:--> The "cluster_database" parameter is currently "TRUE" and must be   
set to "FALSE" prior to running the upgrade.                                    
WARNING:--> Database contains stale optimizer statistics.                      
.... Refer to the 11g Upgrade Guide for instructions to update                  
.... statistics prior to upgrading the database.                                
.... Component Schemas with stale statistics:                                   
....   SYS                                                                      
WARNING:--> Database contains schemas with objects dependent on network        
packages.                                                                       
.... Refer to the 11g Upgrade Guide for instructions to configure Network ACLs. 
WARNING:--> EM Database Control Repository exists in the database.             
.... Direct downgrade of EM Database Control is not supported.Refer to the     
.... 11g Upgrade Guide for instructions to save the EM data prior to upgrade.   
.                                                                               

PL/SQL procedure successfully completed.

SQL> spool off

修改 oracle 用戶環境文件

修改 ORACLE_HOME 以便在兩個節點上反映新的 Oracle 數據庫 11g 目錄。

merlin1-> more .profile
export PS1="`/bin/hostname -s`-> "
export EDITOR=vi
export ORACLE_SID=devdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
export ORA_CRS_HOME=/u02/crs/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/loca
l/bin:/usr/X11R6/bin
umask 022

升級數據庫

以 oracle 用戶身份在 merlin1 上執行 dbua。

merlin1-> ../.profile
merlin1-> which dbua
/u01/app/oracle/product/11.1.0/db_1/bin/dbua  
merlin1-> dbua
  1. 歡迎頁面:單擊 Next
  2. 升級操作:選擇 Upgrade a Database
  3. 數據庫:選擇 devdb
  4. 數據庫升級助手:單擊 Yes 移植現有的監聽器。



圖 1

  1. 數據庫升級助手:單擊 No 稍后升級 ASM。



圖 2

  1. 診斷目標:
    1. Oracle 基目錄:/u01/app/oracle
    2. 診斷目標:/u01/app/oracle



圖 3

  1. 恢復配置:
    1. 選擇 Specify Flash Recovery Area
    2. 閃回恢復區:+RECOVERYDEST。
    3. 閃回恢復區大小:2048 MB。
  2. 重新編譯無效對象:選擇 Recompile invalid objects at the end of upgrade
  3. 摘要:單擊 Finish



圖 4



圖 5

  1. 進度:單擊 OK 查看升級結果。
  2. 升級結果:單擊 Close
SQL> select comp_name,version,status from dba_registry;

COMP_NAME                               VERSION    STATUS                       
--------------------------------------- ---------- ------                       
Oracle Enterprise Manager               11.1.0.6.0 VALID                        
OLAP Catalog                            11.1.0.6.0 VALID                        
Spatial                                 11.1.0.6.0 VALID                        
Oracle Multimedia                       11.1.0.6.0 VALID                        
Oracle XML Database                     11.1.0.6.0 VALID                        
Oracle Text                             11.1.0.6.0 VALID                        
Oracle Data Mining                      11.1.0.6.0 VALID                        
Oracle Expression Filter                11.1.0.6.0 VALID                        
Oracle Rule Manager                     11.1.0.6.0 VALID                        
Oracle Workspace Manager                11.1.0.6.0 VALID                        
Oracle Database Catalog Views           11.1.0.6.0 VALID                        
Oracle Database Packages and Types      11.1.0.6.0 VALID                        
JServer JAVA Virtual Machine            11.1.0.6.0 VALID                        
Oracle XDK                              11.1.0.6.0 VALID                        
Oracle Database Java Packages           11.1.0.6.0 VALID                        
OLAP Analytic Workspace                 11.1.0.6.0 VALID                        
Oracle OLAP API                         11.1.0.6.0 VALID                        
Oracle Real Application Clusters        11.1.0.6.0 VALID                        

18 rows selected.

merlin1-> srvctl config database -d devdb
merlin1 devdb1 /u01/app/oracle/product/11.1.0/db_1
merlin2 devdb2 /u01/app/oracle/product/11.1.0/db_1

merlin1-> $ORA_CRS_HOME/bin/crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.devdb.db   application    ONLINE    ONLINE    merlin1
ora....b1.inst application    ONLINE    ONLINE    merlin1
ora....b2.inst application    ONLINE    ONLINE    merlin2
ora....SM1.asm application    ONLINE    ONLINE    merlin1
ora....N1.lsnr application    ONLINE    ONLINE    merlin1
ora....in1.gsd application    ONLINE    ONLINE    merlin1
ora....in1.ons application    ONLINE    ONLINE    merlin1
ora....in1.vip application    ONLINE    ONLINE    merlin1
ora....SM2.asm application    ONLINE    ONLINE    merlin2
ora....N2.lsnr application    ONLINE    ONLINE    merlin2
ora....in2.gsd application    ONLINE    ONLINE    merlin2
ora....in2.ons application    ONLINE    ONLINE    merlin2
ora....in2.vip application    ONLINE    ONLINE    merlin2

新的診斷位置

SQL> select name, value from v$parameter where name like '%dump_dest' or name like 'diag%';

NAME                 VALUE
-------------------- --------------------------------------------------
background_dump_dest /u01/app/oracle/diag/rdbms/devdb/devdb1/trace
user_dump_dest       /u01/app/oracle/diag/rdbms/devdb/devdb1/trace
core_dump_dest       /u01/app/oracle/diag/rdbms/devdb/devdb1/cdump
diagnostic_dest      /u01/app/oracle

5. 升級 Oracle ASM

單獨的 ASM 主目錄不是必需的;但是,具有一個單獨的 ASM 主目錄具有以下優點:可讓您將補丁或補丁集獨立地從 ASM 主目錄應用到 Oracle RDBMS 主目錄。在同一個節點上運行一個以上的數據庫實例時,具有單獨的 ASM 主目錄和 RDBMS 主目錄尤其受益。在 Oracle RDBMS 主目錄需要修補時,ASM 實例可用性將不會受到影響。

此時,您的 ASM 主目錄仍然在 Oracle 數據庫 10g 主目錄下運行。

merlin1-> srvctl config asm -n merlin1
+ASM1 /u01/app/oracle/product/10.2.0/db_1
merlin1-> srvctl config asm -n merlin2
+ASM2 /u01/app/oracle/product/10.2.0/db_1

創建 ASM 主目錄

在兩個節點上,以 oracle 用戶身份創建新的 ASM 主目錄

mkdir /u01/app/oracle/product/11.1.0/asm 
并修改 shell 配置文件中的 ORACLE_HOME 變量,以反映新的 ASM 主目錄。

ORACLE_HOME=/u01/app/oracle/product/11.1.0/asm

在 ASM 主目錄中安裝 Oracle 數據庫 11g 第 1 版軟件

以 oracle 用戶身份在 merlin1 上執行,

merlin1-> ../.profile 
merlin1-> /stage/database/runInstaller
  1. 歡迎頁面:單擊 Next
  2. 選擇安裝類型:
    1. 選擇 Enterprise Edition
  3. 指定 Home 詳細內容:
    1. Oracle 基目錄:/u01/app/oracle。
    2. 名稱:OraASM11g_home。
    3. 路徑:/u01/app/oracle/product/11.1.0/asm。
  4. 指定硬件集群安裝模式:
    1. 選擇 Cluster Installation
    2. 單擊 Select All
  5. 特定于產品的必要條件檢查:驗證總體結果成功。
  6. 升級現有數據庫:
    1. 您希望立即執行升級嗎?:No
  7. 選擇配置選項:
    1. 選擇 Install Software Only
  8. 特權操作系統組:
    1. 數據庫管理員 (OSDBA) 組:dba
    2. 數據庫操作員 (OSOPER) 組:oinstall
    3. ASM 管理員 (OSASM) 組:dba
  9. 摘要:單擊 Install
  10. 執行配置腳本:以 root 用戶身份執行下面的腳本。
    1. 在 merlin1 上執行 /u01/app/oracle/product/11.1.0/asm/root.sh。
    2. 在 merlin2 上執行 /u01/app/oracle/product/11.1.0/asm/root.sh。
  11. 返回到 merlin1 的執行配置腳本屏幕,然后單擊 OK
  12. 安裝結束:單擊 Exit

升級 ASM

在 merlin1 上,以 oracle 用戶身份停止數據庫并啟動 DBUA。

merlin1-> srvctl stop database -d devdb
merlin1-> /u01/app/oracle/product/11.1.0/asm/bin/dbua
  1. 歡迎頁面:單擊 Next
  2. 升級操作:選擇 Upgrade Automatic Storage Management Instance
  3. 摘要:單擊 Finish



圖 6



圖 7

  1. 進度:單擊 OK 查看升級結果。
  2. 升級結果:單擊 Close
merlin1-> srvctl config asm -n merlin1
+ASM1 /u01/app/oracle/product/11.1.0/asm
merlin1-> srvctl config asm -n merlin2
+ASM2 /u01/app/oracle/product/11.1.0/asm
merlin1-> srvctl start database -d devdb
merlin1-> crs_stat -t 
Name           Type           Target    State     Host
------------------------------------------------------------
ora.devdb.db   application    ONLINE    ONLINE    merlin1
ora....b1.inst application    ONLINE    ONLINE    merlin1
ora....b2.inst application    ONLINE    ONLINE    merlin2
ora....SM1.asm application    ONLINE    ONLINE    merlin1
ora....N1.lsnr application    ONLINE    ONLINE    merlin1
ora....in1.gsd application    ONLINE    ONLINE    merlin1
ora....in1.ons application    ONLINE    ONLINE    merlin1
ora....in1.vip application    ONLINE    ONLINE    merlin1
ora....SM2.asm application    ONLINE    ONLINE    merlin2
ora....N2.lsnr application    ONLINE    ONLINE    merlin2
ora....in2.gsd application    ONLINE    ONLINE    merlin2
ora....in2.ons application    ONLINE    ONLINE    merlin2
ora....in2.vip application    ONLINE    ONLINE    merlin2



圖 8

修改磁盤組兼容性屬性和數據庫兼容性參數

作為最后一步,要利用 Oracle 數據庫 11g 的新特性,必須將數據庫兼容性參數和磁盤組兼容性屬性更改為 11.1.0。

在 devdb1 實例上,

SQL> show parameter compatible
NAME                     TYPE        VALUE
------------------------ ----------- -------------------------
compatible                           string      10.2.0.1.0

SQL> alter system set compatible='11.1.0' scope=spfile;
System altered.
在 merlin1 上,重新啟動數據庫,

merlin1-> srvctl stop database -d devdb
merlin1-> srvctl start database -d devdb

在 ASM1 實例上,

SQL> select name,compatibility,database_compatibility from 
v$asm_diskgroup;

NAME            COMPATIBILITY DATABASE_COMPATIBILI
--------------- ------------- --------------------
DG1             10.1.0.0.0    10.1.0.0.0
RECOVERYDEST    10.1.0.0.0    10.1.0.0.0

SQL> alter diskgroup dg1 set attribute 'compatible.asm'='11.1.0';

Diskgroup altered.

SQL> alter diskgroup dg1 set attribute 'compatible.rdbms'='11.1.0';

Diskgroup altered.

SQL> alter diskgroup recoverydest set attribute 'compatible.asm'='11.1.0';

Diskgroup altered.

SQL> alter diskgroup recoverydest set attribute 'compatible.rdbms'='11.1.0';

Diskgroup altered.

SQL> select name,compatibility,database_compatibility from v$asm_diskgroup;

NAME            COMPATIBILITY DATABASE_COMPATIBILI
--------------- ------------- --------------------
DG1             11.1.0.0.0    11.1.0.0.0
RECOVERYDEST    11.1.0.0.0    11.1.0.0.0


6. 探索 Oracle 數據庫 11g

此部分將簡要描述 Oracle 數據庫 11g 的幾個新特性。新特性的詳細描述不在本指南的討論范圍之內。要獲得更完整的列表,請參閱 Oracle 數據庫新特性指南 11g 第 1 版 (11.1)

自動內存管理 — 在 Oracle 數據庫 11g 中,已經使用動態參數 memory_target 進一步自動化了內存管理。您只需指定總的實例內存大小,數據庫將自動管理 SGA 與 PGA 之間的內存分配。視圖 v$memory_target_advice 將提供內存調整建議。

間隔分區通過在插入行超出分區范圍時自動創建新表分區,提高了分區表的可管理性。

按整數值分區

SQL> create table patients (
2  patientid number not null,name varchar2(10),address varchar2(15)
  3  )
4  partition by range (patientid)
5  interval (100)
6  (partition p1 values less than (100))
  7  /

Table created.

SQL> select partition_name,high_value
2  from user_tab_partitions
3  where table_name='PATIENTS';

PARTITION_NAME  HIGH_VALUE
--------------- ---------------
P1              100

SQL> insert into patients values (100,'ROBERT','4 BORNE AVE');

1 row created.

SQL> select partition_name,high_value
2  from user_tab_partitions
3  where table_name='PATIENTS';

PARTITION_NAME  HIGH_VALUE
--------------- ---------------
P1              100
SYS_P81         200

SQL> select count(*) from patients partition (SYS_P81);

COUNT(*)
----------
         1

按日期分區

SQL> create table userlogs (
2  transid number,
3  transdt date,
4  terminal varchar2(10)
  5  )
6  partition by range (transdt)
7  interval (numtoyminterval(1,'YEAR'))
  8  (
9     partition p1 values less than (to_date('01-01-2007','mm-dd-yyyy'))
 10  );

Table created.

SQL> select partition_name,high_value
2  from user_tab_partitions
3  where table_name='USERLOGS';

PARTITION_NAME HIGH_VALUE
-------------- --------------------------------------------------------------------------------
P1             TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA


SQL> insert into userlogs values (1,'11-AUG-07','XAV0004');

1 row created.

SQL> select partition_name,high_value
2  from user_tab_partitions
3  where table_name='USERLOGS';

PARTITION_NAME HIGH_VALUE
-------------- --------------------------------------------------------------------------------
P1             TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
SYS_P42        TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA


SQL> select count(*) from userlogs partition (sys_p42);

COUNT(*)
----------
         1
引用分區根據父表的分區模式對子表進行分區。

SQL> create table patients (
2  patientid number not null,name varchar2(10), address varchar2(15)
  3  )
4  partition by range (patientid)
5  (partition p1 values less than (100),
6   partition p2 values less than (200))
  7  /

Table created.
SQL> alter table patients
2  add constraint patients_pk primary key (patientid);

Table altered.

SQL> create table invoices (
2  invoiceno number,amount number, patientid number not null,
3  constraint invoices_fk
4  foreign key (patientid) references patients
  5  )
6  partition by reference (invoices_fk);

Table created.

SQL> select dbms_metadata.get_ddl('TABLE','INVOICES','VCHAN') from dual;

DBMS_METADATA.GET_DDL('TABLE','INVOICES','VCHAN')
-----------------------------------------------------------------------
CREATE TABLE "VCHAN"."INVOICES"
(    "INVOICENO" NUMBER,
"AMOUNT" NUMBER,
"PATIENTID" NUMBER NOT NULL ENABLE,
CONSTRAINT "INVOICES_FK" FOREIGN KEY ("PATIENTID")
REFERENCES "VCHAN"."PATIENTS" ("PATIENTID") ENABLE
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT)
PARTITION BY REFERENCE ("INVOICES_FK")
(PARTITION "P1"
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS" NOCOMPRESS ,
PARTITION "P2"
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS" NOCOMPRESS )

SQL> insert into patients values (1,'TOBY','88 Palace Ave');

1 row created.

SQL> insert into invoices values (150,262.12,1);

1 row created.

SQL> select count(*) from invoices partition (p1);

COUNT(*)
----------
         1

SQL> select count(*) from invoices partition (p2);

COUNT(*)
----------
         0

SQL> insert into patients values (110,'GILY','512 HILE STREET');

1 row created.

SQL> insert into invoices values (151,500.01,110);

1 row created.

SQL> select count(*) from invoices partition (p1);

COUNT(*)
----------
         1

SQL> select count(*) from invoices partition (p2);

COUNT(*)
----------
         1
Oracle 數據庫 11g 中的表壓縮支持傳統的 DML 和刪除列操作。壓縮數據在讀取期間不需要解壓縮,這樣,因為讀取的數據塊較少,查詢壓縮數據的速度將明顯加快。
SQL> create tablespace tbs1 datafile '/u01/app/oracle/oradata/db11g/tbs1_01.dbf' size 500M;

Tablespace created.

SQL> create tablespace tbs2 datafile '/u01/app/oracle/oradata/db11g/tbs2_01.dbf' size 500M;

Tablespace created.

SQL> create table mytable_compress (col1 varchar2(26),col2 varchar2(26)) tablespace tbs1 compress for all operations;

Table created.

SQL> create table mytable_nocompress (col1 varchar2(26),col2 varchar2(26)) tablespace tbs2;

Table created.

SQL> alter system flush buffer_Cache;

System altered.

SQL> alter system flush shared_pool;

System altered.

SQL> set timing on

SQL> insert into mytable_nocompress
2  select 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','ABCDEFGHIJKLMNOPQRSTUVWXYZ'
3  from (select 1 from dual connect by level <= 2000000);

2000000 rows created.

Elapsed: 00:00:8.07

SQL> commit;

Commit complete.

Elapsed: 00:00:00.07

SQL> alter system flush buffer_Cache;

System altered.

SQL> alter system flush shared_pool;

System altered.

SQL> insert into mytable_compress
2  select 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','ABCDEFGHIJKLMNOPQRSTUVWXYZ'
3  from (select 1 from dual connect by level <= 2000000);

2000000 rows created.

Elapsed: 00:00:41.79

SQL> commit;

Commit complete.

Elapsed: 00:00:00.04

SQL> select segment_name,extents from user_segments where segment_name like 'MYTABLE%';

SEGMENT_NAME                      EXTENTS
------------------------------ ----------
MYTABLE_COMPRESS                       53
MYTABLE_NOCOMPRESS                     88


SQL> select tablespace_name,bytes/1024/1024 from dba_free_space where tablespace_name like 'TBS%';

TABLESPACE_NAME                BYTES/1024/1024
------------------------------ ---------------
TBS1                                  461.9375
TBS2                                  363.9375


SQL> alter table mytable_compress drop column col2;

Table altered.

Elapsed: 00:00:21.04
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

桓台县| 科技| 苍梧县| 三河市| 定州市| 全椒县| 黄骅市| 那坡县| 乌拉特后旗| 成都市| 建德市| 德江县| 米泉市| 于都县| 镇康县| 东宁县| 巫山县| 洛川县| 金平| 梨树县| 德州市| 邵阳县| 巴中市| 临泉县| 南丰县| 连云港市| 嵊州市| 金山区| 社会| 织金县| 隆昌县| 上高县| 乌什县| 大姚县| 平泉县| 江安县| 新巴尔虎右旗| 宝丰县| 花莲市| 闽清县| 富蕴县|