Oracle 11gR2 RAC 新特性說明


 

最近接觸了一下Oracle 11g R2 的RAC,發現變化很大。 所以在自己動手做實驗之前還是先研究下它的新特性比較好。

 

一.    官網介紹

 

先看一下Oracle 的官網文檔里對RAC 新特性的一點說明。

Oracle Database 11g Release 2 (11.2.0.2) New Features in Oracle RAC

http://download.oracle.com/docs/cd/E11882_01/rac.112/e16795/whatsnew.htm#CHDJAGEE

 

Oracle Database 11g Release 2 (11.2.0.2) New Features in Oracle RAC

This section describes the Oracle Database 11g release 2 (11.2) features for Oracle RAC administration and deployment.

Oracle RAC One Node

Oracle Real Application Clusters One Node (Oracle RAC One Node) provides enhanced high availability for single-instance databases, protecting them from both planned and unplanned downtime. Oracle RAC One Node provides the following:

(1)Always-on single-instance database services

(2)Better consolidation for database servers

(3)Enhanced server virtualization

(4)Lower cost development and test platform for full Oracle RAC

In addition, Oracle RAC One Node facilitates the consolidation of database storage, standardizes your database environment, and, when necessary, enables you to upgrade to a full, multinode Oracle RAC database without downtime or disruption.

Online database relocation is a tool you can use to relocate an Oracle RAC One Node database from one node to another while maintaining service availability.

This feature includes enhancements to the Server Control Utility (SRVCTL) for both Oracle RAC One Node and online database relocation.

This feature also includes enhancements to the Database Configuration Assistant (DBCA) to enable you to use the tool to add an Oracle RAC One Node database.

 

Edition-Based Redefinition

You can specify an edition attribute for a database service using SRVCTL. When you specify an edition attribute for a service, all subsequent connections that specify the service use this edition as the initial session edition.

Specifying an edition as a service attribute can help to manage resource usage. For example, services associated with an edition can be placed on a separate instance in an Oracle RAC environment, and the Oracle Database Resource Manager can manage resources used by different editions by associating resource plans with the corresponding services.

 

Enhancements to SRVCTL for Grid Infrastructure Management

Enhancements to SRVCTL simplify the management of various new Oracle grid infrastructure and Oracle RAC resources.

 

Oracle Database Quality of Service Management Server

The Oracle Database Quality of Service Management server allows system administrators to manage application service levels hosted in Oracle Database clusters by correlating accurate runtime performance and resource metrics and analyzing with an expert system to produce recommended resource adjustments to meet policy-based performance objectives.

 

 

Oracle Database 11g Release 2 (11.2.0.1) New Features in Oracle RAC

This section describes the Oracle Database 11g release 2 (11.2.0.1) features for Oracle RAC administration and deployment.

Grid Plug and Play

Grid Plug and Play reduces per-node configuration data and the need for explicit add and delete nodes steps, where possible. This allows a system administrator to take a template system image and run it on a node to be added with no further configuration. This removes many manual operations, reduces the opportunity for errors, and encourages configurations that can be changed more easily. Removal of the per-node configuration makes the nodes easier to replace because it is not required that they contain individual states that must be managed.

Grid Plug and Play also introduces simplified instance addition. When your databases are backed with Oracle Managed Files (OMF) and Oracle Automatic Storage Management (Oracle ASM), recovery threads and undo tablespaces are automatically created for an instance that you add explicitly with the srvctl add instance command, or implicitly when a policy-managed database brings up a new instance.

All tools and utilities such as DBCA, the Oracle Net Configuration Assistant (NETCA), and SRVCTL have been updated to support Grid Plug and Play. Oracle Enterprise Manager, the graphical interface for managing Oracle RAC, provides management and monitoring for the Grid Plug and Play environment.

Grid Plug and Play reduces the cost of installing, configuring, and managing database nodes by making their per-node state disposable. Nodes can easily be replaced with regenerated state.

 

Policy-based cluster and capacity management

Oracle Clusterware allocates and reassigns capacity based on policies you define, enabling faster resource failover and dynamic capacity assignment using policy-based management.

Policy-based cluster and capacity management allows the efficient allocation of different types of applications in the cluster. Various applications can be hosted on a shared infrastructure, being isolated regarding their resource consumption by policies and, therefore, behave as if they were deployed in single-system environments. Policy-managed Oracle RAC databases use policy-based cluster management to provide the required resources for the workloads the database supports.

 

Role-separated management

Role-separated management for Oracle Clusterware allows certain administrative tasks to be delegated to different people, representing different roles in the company. It is based on the idea of a clusterware administrator, who can grant administrative tasks on a per resource basis. For example, if two databases are placed into the same cluster, the cluster administrator can manage both databases in the cluster. But, the cluster administrator can also decide to grant different administrative privileges to each DBA responsible for each one of those databases.

Role-separated management enables multiple applications and databases to share the same cluster and hardware resources, but ensures that different administration groups do not interfere with each other.

 

Improved Cluster Resource Modeling

Oracle Clusterware can manage different types of applications and processes. You can create dependencies among the applications and processes and manage them as a single entity.

 

Oracle Enterprise Manager-based Oracle Clusterware resource management

You can use Oracle Enterprise Manager to manage Oracle Clusterware resources. You can create and configure resources in Oracle Clusterware and also monitor and manage resources after they are deployed in the cluster.

 

Oracle Cluster Registry performance enhancements

Improvements in the way Oracle Clusterware accesses Oracle Cluster Registry (OCR) speed up relocation of services when a node fails. Oracle Clusterware now supports up to five copies of OCR for improved availability of the cluster and OCR can now be stored in Oracle ASM.

The tools to manage OCR have changed to support the new management options. Consistent storage management automation provides improved performance in Oracle Clusterware and Oracle RAC environments, and easier management of the cluster.

 

SRVCTL support for single-instance database

Server Control Utility (SRVCTL) commands have been enhanced to manage the configuration in a standalone server using Oracle Restart. The new SRVCTL functionality enables you to register a single-instance database that can be managed by Oracle Clusterware. Once registered, Oracle Clusterware can start, stop, monitor, and restart the database instance.

The new SRVCTL functionality simplifies management of Oracle Database through a consistent interface that can be used from the console or scripted. An improved management interface makes it easy to provide higher availability for single-instance databases that run on a server that is part of a cluster.

 

Enhanced Cluster Verification Utility

New Cluster Verification Utility (CVU) functionality checks certain storage types and configurations. Also, more consideration is given to user-specific settings.

In addition to command-line commands, these checks are done through the Oracle Universal Installer, DBCA, and Oracle Enterprise Manager. These enhancements facilitate implementation and configuration of cluster environments and provide assistance in diagnosing problems in a cluster environment, improving configuration and installation.

 

Oracle Enterprise Manager support for Grid Plug and Play

 

You can use Oracle Enterprise Manager:

To support the Grid Plug and Play environment

To administer dynamic configuration use

To manage Grid Plug and Play profiles and targets, such as hosts, clusters, and Oracle RAC databases and Oracle RAC database instances

 

Additionally, Oracle Enterprise Manager supports other Oracle RAC administration tasks, including:

Monitoring:

Startup

Shutdown

Backup and recovery

Tablespace management

Node addition

 

Oracle Enterprise Manager provisioning for Oracle Clusterware and Oracle RAC

The Oracle Enterprise Manager provisioning framework has been updated to reflect the changes to the installation and configuration of Oracle Clusterware and Oracle RAC. You can achieve easier implementation and management of a clustered database environment using the Oracle Enterprise Manager provisioning framework.

 

Zero downtime for patching Oracle RAC

Patching Oracle Clusterware and Oracle RAC can be completed without taking the entire cluster down. This also allows for out-of-place upgrades to the cluster software and Oracle Database, reducing the planned maintenance downtime required in an Oracle RAC environment.

 

Integrated support for application failover in an Oracle Data Guard configuration

Applications connected to a primary database transparently failover to a new primary database when Oracle Data Guard changes roles. Clients integrated with Fast Application Notification (FAN) can achieve fast failover between primary and standby databases, in addition to fast failover within the cluster. Services have an attribute with which you can associate the service with a database role, such as PHYSICAL_STANDBY, so that the service is only active when the database is mounted in the associated role.

 

Oracle ASM Dynamic Volume Manager

The Oracle ASM Dynamic Volume Manager is a kernel-loadable device driver that provides a standard device driver interface to clients, such as the Oracle Automatic Storage Management Cluster File System (Oracle ACFS). Oracle ASM Dynamic Volume Manager is the primary I/O interface for Oracle ACFS to perform I/O and build a file system using Oracle Automatic Storage Management (Oracle ASM) as a volume manager. Oracle ASM Dynamic Volume Manager is loaded upon Oracle ASM startup, is cluster aware, and communicates with Oracle ASM for extent map information, extent rebalancing, and I/O failures.

Oracle ASM Dynamic Volume Manager provides a standard I/O interface allowing general-purpose file systems to leverage the full functionality of Oracle ASM as a volume manager. Files not directly supported by Oracle ASM, such as Oracle binaries, can now reside on ACFS on Oracle ASM volumes. This eliminates the need for third-party file systems or volume managers to host general-purpose files.

 

Oracle Enterprise Manager support for Oracle Automatic Storage Management Cluster File System

Oracle Enterprise Manager provides a comprehensive management solution that extends Oracle ASM technology to support all customer application data files, both database and non-database, and in both single-host and cluster configurations. It also enhances existing Oracle Enterprise Manager support for Oracle ASM, and adds features to support the Oracle ASM Dynamic Volume Manager (ADVM) and Oracle ASM Cluster File System (ACFS) technology.

Oracle Enterprise Manager provides a graphical user interface that makes it easier to manage the environment, whether it is a standalone server or a cluster deployment of Oracle ASM. The centralized console provides a consistent interface for managing volumes, database files, file systems, and the Oracle Database.

 

Oracle Automatic Storage Management Cluster File System

The Oracle Automatic Storage Management Cluster File System (Oracle ACFS) provides a robust, modern, general purpose file system for files beyond the Oracle database files. Oracle ACFS also provides support for files such as Oracle binaries, report files, trace files, alert logs, and other application data files. With the addition of Oracle ACFS, Oracle ASM becomes a complete storage management solution for both Oracle database and non-database files.

 

Additionally, Oracle ACFS

(1)Supports large files with 64-bit file and file system data structure sizes leading to exabyte-capable file and file system capacities

(2)Uses extent-based storage allocation for improved performance

(3)Uses a log-based metadata transaction engine for file system integrity and fast recovery

(4)Can be exported to remote clients through industry standard protocols such as NFS and CIFS

 

Oracle ACFS complements and leverages Oracle ASM and provides a general purpose journaling file system for storing and managing non-Oracle database files. This eliminates the need for third-party cluster file system solutions, while streamlining, automating, and simplifying all file type management in both single node and Oracle RAC and Grid computing environments.

Oracle ACFS supports dynamic file system expansion and contraction without any downtime and is also highly available, leveraging the Oracle ASM mirroring and striping features in addition to hardware RAID functionality.

 

Automatic Storage Management file access control

This feature implements access control on Oracle ASM files on UNIX platforms to isolate itself and different database instances from each other and prevent unauthorized access. The feature includes SQL statements to grant, modify, and deny file permissions.

This feature enables multiple database instances to store their Oracle ASM files in the same disk group and enables consolidation of multiple databases, securely, to prevent database instances from accessing or overwriting files belonging to other database instances.

 

Universal Connection Pool

Universal Connection Pool (UCP) is a Java connection pool that replaces the deprecated JDBC Implicit Connection Cache with Oracle Database 11g (11.1.0.7). UCP is integrated with Oracle RAC to provide the following benefits:

(1)A single UCP can be leveraged by any Oracle component or user.

(2)Eliminates redundant connection pools from several Oracle Components, such as AOL/J, ADF Business Components, and TopLink.

(3)Provides consistent connection pool behavior for an Oracle component or product. For example, the connection pool sizes can be configured to provide consistent connection management behavior for an application.

(4)Provides JMX interfaces for the UCP Manager, which delivers a consistent management interface to manage the connection pool.

(5)UCP adapters can provide standards compliance for a specific connection type being pooled.

(6)Supports connection pooling for Oracle and non-Oracle connections.

(7)Supports pooling for any type of connections, including JDBC or JCA connections.

 

Expose high availability events through a Java API

You can access fast application notification (FAN) events with a simplified JAVA API if you are not using the Oracle connection pool features.

 

SRVCTL enhancements to support Grid Plug and Play

This feature includes enhancements to the server control utility (SRVCTL) for the Grid Plug and Play feature.

 

 

二. 網上的資料:

 

2.1  11gR2 RAC 安裝配置中的三個重要調整

 

2.2.1.  ASMLIB 和 CRS集成在了一起,在安裝GRID的時候CRS和ASM一起來配置,OCR和VOTING DISK 在新裝11G R2 RAC上必須使用ASM或者NFS,已經不支持RAW和塊設備,如果是從11G R1,或者10G升級到11G R2 OCR,VOTING DISK將被繼續支持。

 

2.2.2. 使用OUI,DBCA創建數據庫的時候已經不支持裸設備了,如果要用裸設備需要用手工來創建數據庫。

 

2.2.3. 客戶端tnsnames.ora使用SCAN IP 替代原來的直接配置配置VIP,簡化了客戶端的配置。而且在增加,刪除節點后不需要對tnsnames.ora文件進行調整。

 

 

2.2  Oracle 11gR2新特性

    Oracle 11gR2將自動存儲管理 (ASM) 和 Oracle Clusterware 集成在 Oracle Grid Infrastructure 中。Oracle ASM 和 Oracle Database 11gR2 提供了較以前版本更為增強的存儲解決方案,該解決方案能夠在 ASM 上存儲 Oracle Clusterware文件,即 Oracle 集群注冊表 (OCR) 和表決文件(VF,又稱為表決磁盤)。這一特性使 ASM 能夠提供一個統一的存儲解決方案,無需使用第三方卷管理器或集群文件系統即可存儲集群件和數據庫的所有數據;

   

Oracle 11gR2 中引入了SCAN(single client access name),即簡單客戶端連接名,一個方便客戶端連接的接口;在Oracle 11gR2之前,client鏈接數據庫的時候要用vip,假如cluster有4個節點,那么客戶端的tnsnames.ora中就對應有四個主機vip的一個連接串,如果cluster增加了一個節點,那么對於每個連接數據庫的客戶端都需要修改這個tnsnames.ora。SCAN簡化了客戶端連接,客戶端連接的時候只需要知道這個名稱,並連接即可, 每個SCAN VIP對應一個scan listener, cluster內部的service在每個scan listener上都有注冊,scan listener接受客戶端的請求,並轉發到不同的Local listener中去,由local 的listener提供服務給客戶端。

   

此外,安裝GRID的過程也簡化了很多,內核參數的設置可保證安裝的最低設置,驗證安裝后執行fixup.sh即可,此外ssh互信設置可以自動完成,尤其不再使用OCFS及其復雜設置,直接使用ASM存儲,在HP-UX11.31上無需額外的集群軟件(如Service Guard for RAC Extendsion)即可安裝.

 

 

2.2.1 隨處可見的集群

  在以前的版本中,Oracle Clusterware必須要獨立地安裝在它自己的ORACLE HOME中,並且也只能在RAC環境下使用,這一切在Oracle 11g R2得到徹底顛覆,因為在這個版本中支持安裝Oracle網格基礎架構,而且只需要一個獨立的ORACLE HOME,它包括了Oracle Clusterware和Oracle自動存儲管理(ASM)。通過升級后的Oracle通用安裝程序安裝了網格基礎架構后,你將會看到一個全新的功能和服務矩陣,如:

  單實例RAC(Oracle重啟): Oracle 11g R2擴展了Oracle Clusterware的功能,為任何單實例提供了高可用特性,本質上是將數據庫變成了單實例RAC數據庫。Oracle 11g R2中的Oracle重啟特性幫助Oracle網格基礎架構的高可用服務控制服務器重啟時哪一個監聽器,ASM實例和數據庫應該啟動,它完全取代了過去DBA們經常用到的DBSTART腳本。同樣,當單個數據庫實例崩潰或其它異常終止時,Oracle重啟功能會自動監測失效的實例,並自動重啟它,就好像是在一個真實的RAC環境中一樣。

  SRVCTL升級:如果你管理過舊版本的RAC環境,你可能已經熟悉了RAC環境中的維護工具SRVCTL,在11g R2中,該工具被擴展了,現在可以管理單實例RAC,以及監聽器和ASM實例。

  集群時間同步服務:Oracle 11g R2現在需要在所有RAC節點上配置時間同步,如果你曾經經歷過某個節點被驅逐出RAC集群配置,你一定知道其難度有多大,特別是兩個服務器的時間不同步和日志文件的時間戳不同步時,Oracle之前的版本借助系統提供的網絡時間協議(NTP)同步所有節點時間,但這需要連接到互聯網上的標准時間服務器,作為NTP的替代者,Oracle 11g R2提供了一個新的集群時間同步服務,確保集群中的所有節點的時間都保持一致。

  網格即插即用:在以前的版本中,配置RAC最復雜的部分是確定和設置所有節點都需要用到的公共ip地址,私有ip地址和虛擬ip地址。為了簡化RAC的安裝,Oracle 11g R2提供了一個全新的網格名稱服務(GNS),它和域名服務器協作,處理每個網格組件的ip地址分配,當集群環境跨越多個數據庫時這個新特性極其有用。

  干凈地卸載RAC組件:如果你曾經嘗試過刪除多個節點上的所有RAC痕跡,那一定會鍾情於這項新特性,在Oracle 11g R2中,所有安裝和配置助手,特別是Oracle通用安裝程序(OUI),數據庫配置助手(DBCA)和網絡配置助手(NETCA),都得到了增強,當需要卸載RAC組件時,可以保證卸得干干凈凈。

 

2.2.2  ASM加入了集群

ASM和Oracle 11g R2 Clusterware安裝在同一個Oracle Home下,因此消除了之前推薦的冗余Oracle Home安裝方法,並且ASM也從DBCA脫離出來了,有了專門的自動存儲管理配置助手(ASMCA)。

智能化數據布局:在之前的版本中,要配置ASM磁盤可能需要存儲管理員的參與,需要配置磁盤I/O子系統,Oracle 11g R2提供了ASM分配單元,可以直接受益於磁盤外緣柱面,獲得更快的速度,可以將數據文件,重做日志文件和控制放在磁盤外緣獲得更好的性能。

  EM支持工作台擴展:在這個版本中對Oracle 11g R1引入到企業管理控制台中的自動診斷倉庫(ADR)進行了擴展,包括支持ASM診斷,將所有診斷信息打包直接發送給Oracle技術支持,以便獲得更快速的ASM性能問題解決方案。

  ASMCMD增強:自動存儲管理命令行實用工具(ASMCMD)也獲得了不少增強,包括:

     1) 啟動和停止ASM實例;

     2) 備份,恢復和維護ASM實例的服務器參數文件(spfile);

     3) 實用iostat監控ASM磁盤組的性能;

     4) 維護新的ASM集群文件系統(ACFS)中的磁盤卷,目錄和文件存儲,我的下一個話題就是它。

 

2.2.3  ACFS – 一個強健的集群文件系統

  Oracle之前也發布過集群文件系統(OCFS),之后又發布了增強版OCFS2,它讓Oracle RAC實例可以通過共享存儲讀寫數據庫文件,重做日志文件和控制文件。

  此外,OCFS也允許RAC數據庫的Oracle集群注冊文件(OCR)和表決磁盤存儲在集群文件系統中,在Oracle 10g R2中,這個需求被取消了,OCR文件和表決磁盤可以存儲在裸設備或裸塊設備中,如果你曾經在原始設備上丟失過這些文件的所有副本,你一定了解要恢復它們是多么繁瑣,因此,在Oracle 11g R2中,將不再支持將這些文件存儲在裸設備上。

  為了提高這些關鍵文件的存活能力,Oracle 11g R2正式引入了一種新的集群文件系統,稱之為ASM集群文件系統(ACFS: automatic cluster file system),在RAC環境中,ACFS可以為OCR文件和表決磁盤提供更好的保護,它允許創建五份OCR文件副本,之前的集群文件系統僅允許保存兩份OCR文件,一個主OCR,一個鏡像OCR,但ACFS不適合單獨的RAC環境,除此之外,幾乎所有與操作系統和數據相關的文件都可以從ACFS的安全性和文件共享特性受益。

 

  動態卷管理器: Oracle 11g R2提供了一個新的ASM動態卷管理器(ADVM)來配置和維護存儲在ACFS文件系統中的文件,使用ADVM可以在ASM磁盤組內構建一個ADVM卷設備,管理存儲在ADVM卷設備中的文件,以及按需調整ADVM卷設備空間大小,最重要的是,因為ADVM是構建在ASM文件系統架構之上的,可以保證存儲在這些卷中的文件受到良好的保護,不會出現意外丟失,因為ASM提供了類似RAID的磁盤陣列的功能。

 

  文件訪問控制:使用傳統的Windows風格訪問控制列表(ACL)或Unix/Linux下的用戶/組/其它訪問權限風格為ACFS目錄和文件授予讀,寫和執行權限,可以通過圖形化的企業管理控制台或命令行程序ASMCMD管理ACFS目錄和文件安全。

  文件系統快照(FSS):Oracle 11g R2通過它的文件系統快照(FSS)功能可以對ACFS文件系統執行快照,一個快照是所選ACFS文件系統的一個只讀副本,對相同的ACFS,它會自動保留63個獨立的ACFS快照,當某個ACFS文件被不經意地更新,刪除或其它危險操作時,這個特性非常有用,利用11g R2企業管理控制台或ACFS acfsutil命令行工具可以找出該文件合適的版本並執行恢復。

 

2.2.4 改善的軟件安裝和打補丁過程

  作為一名DBA壓力最大的活就是給Oracle數據庫打補丁了,如果補丁可能會引入對數據庫有害的行為,我不得不花費大量的時間和精力來確定和審核.

集群驗證實用程序集成:從Oracle 10g開始引入了集群驗證實用程序(CVU),現在已經完全集成到Oracle通用安裝程序(OUI)和其它配置助手(如DBCA,DBUA)中了。

 

  零停機修補的集群:當為Oracle集群打補丁時,Oracle 11g R2在一個不合適的位置升級方式應用補丁,這意味着會有兩個Oracle Home,其中一個專門用來存放補丁的,但一次只能激活一個Oracle Home,在Oracle 11g R2中不用再為升級全部關閉Oracle集群了,實現真正的零停機打補丁。

 

2.2.5  DBMS_SCHEDULER升級

  DBMS_SCHEDULER包得到了徹底的更新,DBA經常使用這個包來調度作業。

  

文件監視器:以前的版本無法在批處理過程中檢測大多數觸發事件,如檢測一個文件抵達某個目錄,在Oracle 11g R2中,使用新的文件監視器可以緩解這個問題,一旦預期的文件抵達目錄,DBMS_SCHEDULER現在就可以檢測到了,並在新的對象類型SCHEDULER_FILEWATCHER_RESULT中注冊它的到來,它通過新的CREATE_FILE_WATCHER存儲過程向DBMS_SCHEDULER發送一個信號觸發作業。

  內置的email通知:無論何時,DBMS_SCHEDULER調度任務啟動、失敗或完成時,任務的狀態可以立即通過email發送出去,雖然在以前的版本中也能實現這個功能,但要么調用DBMS_MAIL存儲過程,要么調用DBMS_SMTP存儲過程,現在這個功能合並到DBMS_SCHEDULER中了。

  遠程作業:DBMS_SCHEDULER現在允許DBA在遠程數據庫上創建和調度作業,現在我終於可以在生產庫上通過DBMS_SCHEDULER調用生產庫DBMS_SCHEDULER上的存儲過程執行任務了,這意味着我現在可以在一台數據庫上集中創建和維護調度任務了。

  多作業目標:最后,現在可以在多個數據庫實例上同時調度DBMS_SCHEDULER任務了,在RAC環境中,這個特性非常有用,因為我可以利用多個數據庫實例將長時間運行任務分成幾部分,分別在不同的數據庫實例上執行更小的任務.

 

 

2.3           SCAN(Single Client Access Name)

 

在Oracle 11gR2以前,如果數據庫采用了RAC架構,在客戶端的tnsnames中,需要配置多個節點的連接信息,從而實現諸如負載均衡,failover等等RAC的特性。因此,當數據庫RAC集群需要添加或刪除節點時,需要及時對客戶端機器的tns進行更新,以免出現安全隱患。

在11gR2中,為了簡化該項配置工作,引入了SCAN(Single Client Access Name)的特性,該特性的好處在於,在數據庫與客戶端之間,添加了一層虛擬的服務層,就是所謂的scan ip以及scan ip listener,在客戶端僅需要配置scan ip的tns信息,通過scan ip listener,連接后台集群數據庫。這樣,不論集群數據庫是否有添加或者刪除節點的操作,均不會對client產生影響。

 

2.3.1 SCAN(Single Client Access Name)的架構以及配置

在11gR2中,安裝RAC發生的巨大變化,在10g以及11gR1的時代,安裝RAC的步驟是先安裝CRS,再安裝DB,而到了11gR2的時代,crs與asm被集成在一起,合稱為GRID,必須先安裝GRID后,才能繼續安裝DB。

 

在11gR2中,SCAN IP是作為一個新增IP出現的,原有的CRS中的VIP仍然存在。在11gR2的RAC架構中,SCAN IP並非獨立存在的,而是和原有的 VIP結合在一起的。它們的工作原理如圖:

 

      

 

     從圖可以看出,scan ip其實是oracle在客戶端與數據庫之間,新加的一個連接層,當有客戶端訪問時,連接到 SCAN IP LISTENER, 而SCAN IP LISTENER接收到連接請求時,會根據 LBA 算法(所謂LBA算法,就是least loaded instance),將該客戶端的連接請求,轉發給對應的instance上的VIP LISTENER,從而完成了整個客戶端與服務器的連接過程。簡化如下:
      Client -> scan listener -> local listener -> local instance

 

 

SCAN包含在安裝grid的過程中。SCAN的定義,有兩種途徑:
    1. 在DNS中定義域名。

  2. 通過oracle提供的Grid Naming Server(GNS)實現DHCP自定義。

 

   如果通過dns來定義,則需要在網絡中定義3個SCAN IP地址,指向同一個域名,這3個ip地址必須處於同一個子網內,同時域名不能太長。另外,SCAN IP是由oracle clusterware管理的,因此在主機的集群軟件(如IBM HACMP,HP SERVICE GUARD)中不能將此ip配置進去,類似於10g中的vip,在grid安裝前,此IP是無法ping通的。


    范例:
    scan-ip.tianlesoftware.com  IN A 192.168.1.111
                                        IN A 192.168.1.112
                                        IN A 192.168.1.113

  如果使用GNS的方式,則必須有DHCP服務,在cluster的配置過程中,將會自動向DHCP服務器申請3個IP地址作為SCAN IP使用。

 

除了SCAN IP,在cluster的配置過程中,SCAN IP LISTENER服務也會被建立,每個SCAN IP對應一個SCAN IP LISTENER,並且,為了提升高可用性,3個SCAN IP以及其對應的SCAN IP LISTENER將被獨立的分配到各個節點上。如果cluster中其中某個運行scan ip的節點出現異常,則其余兩個正常的scan ip節點將自動接管。

注意,如果客戶端是11gR2的版本,則客戶端只需在tns中配置域名解析,即可實現failover,如果客戶端版本低於11gR2,則無法通過域名解析出3個SCAN IP地址,因此如果要實現failover,必須在客戶端的tns中配置3個SCAN IP的地址進行解析,這也是為何oracle強烈建議在使用11gR2數據庫時,客戶端也最好使用11gR2的原因。

 

如:

 $srvctl config scan_listener

SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
     SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
     SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521

 

$srvctl config scan

SCAN name: scan-ip, Network: 1/192.168.1.0/255.255.255.0/
    SCAN VIP name: scan1, IP: /scan-ip.tianlesoftware.com/192.168.1.111
    SCAN VIP name: scan2, IP: /scan-ip.tianlesoftware.com/192.168.1.112
    SCAN VIP name: scan3, IP: /scan-ip.tianlesoftware.com/192.168.1.113

 

 

2.3.2    SCAN IP 配置方法及使用

  SCAN IP是跟數據庫instance無關的,例如一個12節點的RAC,只有3個SCAN IP,並且SCAN IP是隨機分布在各個instance的,那么,SCAN IP LISTENER如何監聽各個節點的數據庫呢,該怎么配置哪個instance去哪個SCAN IP LISTENER注冊?

   

 SCAN IP 和 SCAN LISTENER是獨立於RAC的各個節點的,而每個節點的 VIP , VIP LISTENER是跟instance綁定的,每個節點的VIP LISTENER,會監聽自己所屬節點的instance。

   

 因此,在數據庫中,我們需要設置remote_listener參數,這個參數設置很有講究,因為scan ip有3個,scan listener也有三個,但是他們對應的是同一個域名,因此,在數據庫中,我們需要使用easy connect naming method方式,就是在sqlnet.ora的配置文件中,必須有NAMES.DIRECTORY_PATH=(tnsnames,ezconnect)存在。

 

另外,配置remote_listener的方式也有講究,以前的版本中,我們通常是在tnsnames.ora中寫好remote_listener的地址以及端口,但是對於scan listener,不能這么做,必須按照標准格式,設置成REMOTE_LISTENER=SCAN:PORT的形式,

如: REMOTE_LISTENER=scan-ip.tianlesoftware.com:1521,而不需要在tnsnames.ora中進行額外設置。

   

經過以上設置后,RAC數據庫的每個節點的PMON進程,會用廣播的方式向每個SCAN LISTENER進行注冊,同時CRS的后台進程ONS,會采集各個節點的負載狀況,通知scan listener,以便scan listener根據負載情況,將新連接分配到當前負載最低的節點上。

 

 

2.4  10gR2 RAC 與11gR2 RAC安裝時的三方面不同

 

2.4.1  netca的配置不同

(1)oracle 10gR2 rac 是在安裝完oracle clusterware和oracle database 后,需要手工運行netca,這時監聽才配置完成

(2)oracle 11gR2 rac 是在安裝完oracle grid時運行完root.sh腳本后,自動會運行netca,監聽配置完成,並且多了listener_scan1監聽名稱

 

2.4.2  dbca的配置不同

(1)oracle 10gR2 rac dbca支持asm,共享文件系統,裸設備三種建庫時存放數據文件方法

(2)oracle 11gR2 rac dbca只支持asm,共享文件系統,不再支持裸設備的方法來建庫

 

2.4.3 TAF的配置不同

(1)oracle 10gR2 rac taf配置可以通過dbca圖形工具來配置

(2)oracle 11gR2 rac taf配置只能通過EM圖形工具來配置

 轉:http://blog.csdn.net/tianlesoftware/article/details/5982972


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM