Search This Blog

Monday, July 30, 2012

Virtual IP (VIP) in Oracle Real Application Clusters (RAC)

Use of Virtual IP (VIP) in Oracle Real Application Clusters (RAC)

When installing Oracle 10g/11g R1 RAC, three network interfaces (IPs) are required for each node in the RAC cluster, they are:
  • Public Interface:  Used for normal network communications to the node
  • Private Interface:  Used as the cluster interconnect
  • Virtual (Public) Interface: Used for failover and RAC management
When installing Oracle 11g R2 RAC, we need one more network interface (IP) for each node in the RAC cluster.
SCAN Interface (IP):  Single Client Access Name (SCAN) is a new feature in Oracle Real Application Clusters (RAC) 11g Release 2, which provides a single name for all clients to access an Oracle Database running in a cluster. The benefit of SCAN is clients using SCAN do not need to change if you add or remove nodes in the cluster.

  • When a client connects to a tns-alias, it uses a TCP connection to an IP address, defined in the tnsnames.ora file. When using RAC, we define multiple addresses in our tns-alias, to be able to failover when an IP address, listener or instance is unavailable. TCP timeouts can differ from platform to platform or implementation to implementation. This makes it difficult to predict the failover time. 
Oracle 10g Cluster Ready Services enables databases to use a Virtual IP address to configure the listener ON. This feature is to assure that oracle clients quickly failover when a node fails. In Oracle Database 10g RAC, the use of a virtual IP address to mask the individual IPO addresses of the clustered nodes is required. The virtual IP addresses are used to simplify failover and are automatically managed by CRS.

  • To create a Virtual IP (VIP) address, the Virtual IP Configuration Assistant (VIPCA) is called from the script of a RAC install, which then configures the virtual IP addresses for each node specified during the installation process. In order to be able to run VIPCA, we need unused public IP addresses available for each node that has been configured in the /etc/hosts file.
  • One public IP address for each node to use for its Virtual IP address for client connections and for connection failover. This IP address is in addition to the operating system managed public host IP address that is already assigned to the node by the operating system. This public Virtual IP must be associated with the same interface name on every node that is a part of the cluster. The IP addresses that are used for all of the nodes that are part of a cluster must be from the same subnet. The host names for the VIP addresses must be registered with the domain name server (DNS). The Virtual IP address should not be in use at the time of the installation because this is a Virtual IP address that Oracle manages internally to the RAC processes. This virtual IP address does not require a separate NIC. The VIPs should be registered in the DNS. The VIP addresses must be on the same subnet as the public host network addresses. Each Virtual IP (VIP) configured requires an unused and resolvable IP address.
  • Using virtual IP we can save our TCP/IP timeout problem because Oracle notification service (ONS) maintains communication between each nodes and listeners. Once ONS found any listener down or node down, it will notify another nodes and listeners. While new connection is trying to establish connection to failure node or listener, virtual IP of failure node automatically divert to surviving node and session will be establishing in another surviving node. This process doesn't wait for TCP/IP timeout event. Due to this, new connection gets faster session establishment to another surviving nodes/listener.
  • Virtual IP (VIP) is for fast connection establishment in failover dictation. Still we can use physical IP address in Oracle 10g in listener if we have no worry for failover timing. We can change default TCP/IP timeout using operating system utilities/commands and kept smaller. But taking advantage of VIP (Virtual IP address) in Oracle 10g RAC database is advisable.

Sunday, July 29, 2012

Locally vs Dictionary Managed Tablespaces

When Oracle allocates space to a segment (like a table or index), a group of contiguous free blocks, called an extent, is added to the segment. Metadata regarding extent allocation and unallocated extents are either stored in the data dictionary, or in the tablespace itself.

Tablespaces that record extent allocation in the dictionary, are called dictionary managed tablespaces, and

Tablespaces that record extent allocation in the tablespace header, are called locally managed tablespaces.

DEV> select tablespace_name, extent_management, allocation_type from dba_tablespaces;

------------------------------     ----------------------       --------------------
SYSTEM                           DICTIONARY           USER
SYSAUX                          LOCAL                      SYSTEM
UNDOTBS1                      LOCAL                      SYSTEM
TEMP                               LOCAL                      UNIFORM
ABMD                              LOCAL                      USER
ESSO                                LOCAL                     USER
SIT                                   LOCAL                     USER
USERS                             LOCAL                     UNIFORM
USER_DATA                    LOCAL                     UNIFORM