Sunday, November 3, 2013

RAC Concepts - Part : B


Note:  Proofread any scripts before using. Always try scripts on a test instance first. This Blog is not responsible for any damage.

Part - B


13. What does Oracle Grid Infrastructure mean and list some key benefits of it?
Oracle Grid Infrastructure
The Oracle Grid Infrastructure is a separate set of binaries from the Oracle Database software. It incorporates volume management functionality, file system functionality and the cluster management software. Essentially, Oracle Grid Infrastructure combines three products into one single Oracle Home. These three pieces are Oracle Clusterware, Automatic Storage Management (ASM) and the ASM Cluster File System (ACFS). In previous releases, Oracle Clusterware and ASM were installed into separate Oracle homes. ASM was included as part of the Oracle Database binaries, and Oracle Clusterware was a separate install. ACFS is new in Oracle 11g R2.

Oracle Clusterware and Oracle ASM are still individual products, and are referred to by those names.

Oracle Clusterware enables servers, referred to as hosts or nodes, to operate together as if they are one server, commonly referred to as a cluster. Although the servers are standalone servers, each server has additional processes that communicate with other servers. In this way the separate servers appear as if they are one server to applications and end users. Oracle Clusterware provides the infrastructure necessary to run Oracle RAC. The combined processing power of the multiple servers provides greater availability, throughput, and scalability than is available from a single server.

The Clusterware component of the Grid Infrastructure includes Cluster Management Services (known as Cluster Ready Services (CRS) in previous releases) and High Availability Services for both Oracle and other third party products. Installing Oracle Clusterware is a prerequisite activity for working with Oracle RAC.

Starting with Oracle 11g R2, ASM disks can be used for the clusterware files (OCR and voting disk). In previous releases, the OCR and Voting disk files had to be on raw partitions or a separate cluster file system.

The nodes in a cluster can be organized into a server pool for better resource management. Each server pool has the following properties:
  •     The minimum number of nodes that should be in the server pool
  •     The maximum number of nodes that can be in the server pool
  •     The relative importance of this server pool to other server pools
Upon installation of Oracle grid infrastructure, a default server pool, called the Free pool, is created automatically. All servers in a new installation are assigned to the Free server pool, initially. If you create a new server pool, the servers move from the Free pool to the new server pool automatically.

When you create an Oracle RAC database that is a policy-managed database, you specify the number of servers that are needed for the database, and a server pool is automatically created for the database. Oracle Clusterware populates the server pool with the servers it has available. If you do not use server pools, then you can create an administrator-managed database.

ACFS is a general cluster file system that can be used for any type of data files.

The combination of these three components of the Oracle Grid Infrastructure now provides the primary foundation for Oracle 11g R2 RAC databases.

The six primary functions of Oracle Clusterware are Cluster Management, Node Monitoring, Event Services, Network Management, Time Synchronization and High Availability.
  • Cluster Management allows the cluster resources (such as databases, instances, listeners, services, etc.) to be monitored and managed from any node that is part of the defined cluster.
  • Node Monitoring is the "heartbeat" check of the nodes (and the resources running on them) to make sure they are available and functioning properly.
  • Event Services is the high availability messaging and response functionality for RAC.
  • Network Management involves managing the Virtual IP (VIP) addresses that are associated with the cluster and provides the consistent access to the RAC database regardless of the systems hosting it.
  • Time Synchronization is a new feature in Oracle 11g R2 that automatically synchronizes the timestamps of all of the nodes in the cluster. In previous releases, third party tools were generally used. Time Synchronization can be used in observer mode (if a Network Time Protocol is already in place) or active mode where one node is designated as the master node and all of the others are synchronized to it.
  • High Availability services monitor and restart any of the resources being managed by Oracle Clusterware.
Automatic Workload Management (Policy Managed Databases)

In prior releases of Oracle RAC, the DBA would explicitly manage which nodes of a cluster would be used to run the various instances associated with a RAC database. Additionally, database services would be manually configured with preferred and available nodes, which facilitated the balancing of connections and failover of the services in a RAC environment.

In Oracle Database 11 g R2, a DBA can now configure a feature called policy-based management. This involves defining a server pool with the options of a minimum number of servers, a maximum number of servers and an importance level. The database itself would then be associated with a server pool rather than a specific set of nodes. This would allow Oracle to dynamically deliver services based on the total resources available to the cluster.

For example, if a cluster consisted of eight nodes in total and supported three RAC databases. Each database would be defined with a minimum and maximum number of servers. Let's assume that DB1 is defined with a minimum of 4 and a maximum of 6 with an importance of 10, DB2 is defined with a minimum of 2 and maximum of 3 and an importance of 7, and DB3 is set to a minimum of 2 and maximum of 3 with an importance of 5.

Initially the 8 nodes could be configured as nodes 1-4 allocated to DB1, nodes 5-6 allocated to DB2 and nodes 7-8 allocated to DB3. If node 3 failed for some reason, the system would allocate node 7 or 8 to DB1 because it has a higher importance than DB3 and a minimum requirement of 4 servers, even though it would cause DB3 to fall below the minimum number of servers. If node 3 is re-enabled it would be allocated immediately to DB3 to bring that database back to its minimum required servers.

If a 9th node were added to the cluster, it would be assigned to DB1 because of the importance factor and the fact that DB1 has not yet hit its maximum number of servers.

Oracle Automatic Storage Management

With Oracle Real Application Clusters (Oracle RAC), each instance must have access to the data files and recovery files for the Oracle RAC database. Using Oracle Automatic Storage Management (Oracle ASM) is an easy way to satisfy this requirement.

Oracle ASM is an integrated, high-performance volume manager and file system. With Oracle Database 11g Release 2, Oracle ASM adds support for storing the Oracle Clusterware OCR and voting disk files, as well as a general purpose cluster file system called Oracle Automatic Storage Management Cluster File System (Oracle ACFS). Oracle ASM is based on the principle that the database should manage storage instead of requiring an administrator to do it. Oracle ASM eliminates the need for you to directly manage potentially thousands of Oracle database files.

Oracle ASM groups the disks in your storage system into one or more disk groups. You manage a small set of disk groups and Oracle ASM automates the placement of the database files within those disk groups. Oracle Cluster Registry (OCR) and voting disks can also be placed on Oracle ASM diskgroups.

Oracle ASM is implemented as a special kind of Oracle instance, with its own System Global Area and background processes. The Oracle ASM instance is tightly integrated with Oracle Clusterware and Oracle Database. Every server running one or more database instances that use Oracle ASM for storage has an Oracle ASM instance. In an Oracle RAC environment, there is one Oracle ASM instance for each node, and the Oracle ASM instances communicate with each other on a peer-to-peer basis. Only one Oracle ASM instance is supported on a node, but you can have multiple database instances that use Oracle ASM residing on the same node.

Oracle recommends that you use Oracle ASM for your Oracle Clusterware files and Oracle RAC datafiles, instead of raw devices or the operating system file system. Oracle databases can use both Oracle ASM files and non-Oracle ASM files. You can also create an ACFS to store your database Oracle Home and any other external (non-database) files in the cluster.

ASM Cluster File System (ACFS)

Oracle Automatic Storage Management Cluster File System (Oracle ACFS) is a new multi-platform, scalable file system, and storage management technology that extends Oracle ASM functionality to support customer files maintained outside of the Oracle Database. Files supported by Oracle ACFS include database and application executables, trace files, alert logs, application reports, BFILEs, and configuration files. Oracle ACFS leverages Oracle ASM functionality to provide dynamic file system resizing, striping, and mirroring.

ACFS is a multi platform cluster file system that has been designed to run on any platform that is supported by ASM rather than being specific to any one platform as some of the third party products are.

ACFS uses a file type called a dynamic volume, which can be used as a volume for a regular file system. The ASM Dynamic Volume Manager provides the interface between the dynamic volumes and the ACFS.

ACFS also provides a snapshot utility that does version enabling of the file system. These snapshots are online point-in-time copies of the ACFS. The storage for the snapshots is managed within ACFS and is very space efficient. Before any file is modified in ACFS, a copy is saved as a snapshot. The snapshot copies are designed to only capture the changed data. Snapshots can also be created on demand to provide consistent views of the ACFS system.

While ACFS can be used to store most files associated with Oracle, it must be noted that the Oracle Grid Infrastructure binaries themselves cannot be stored in ACFS. They must be installed locally on each node in the cluster.

All of the necessary services to manage ACFS systems are automatically managed by Oracle Clusterware.

14. What are the file types that ASM support and keep in disk groups? 

Control files Flashback logs Data Pump dump sets
Data files DB SPFILE Data Guard configuration
Temporary data files RMAN backup sets Change tracking bitmaps
Online redo logs RMAN data file copies OCR files
Archive logs Transport data files ASM SPFILE

15. List Key benefits of ASM?
  • Stripes files rather than logical volumes
  • Provides redundancy on a file basis
  • Enables online disk reconfiguration and dynamic rebalancing
  • Reduces the time significantly to resynchronize a transient failure by tracking changes while disk is offline
  • Provides adjustable rebalancing speed
  • Is cluster-aware
  • Supports reading from mirrored copy instead of primary copy for extended clusters
  • Is automatically installed as part of the Grid Infrastructure
    Striping—Oracle ASM spreads data evenly across all disks in a disk group to optimize performance and utilization. This even distribution of database files eliminates the need for regular monitoring and I/O performance tuning.

    Mirroring—Oracle ASM can increase data availability by optionally mirroring any file. Oracle ASM mirrors at the file level, unlike operating system mirroring, which mirrors at the disk level. Mirroring means keeping redundant copies, or mirrored copies, of each extent of the file, to help avoid data loss caused by disk failures. The mirrored copy of each file extent is always kept on a different disk from the original copy. If a disk fails, Oracle ASM can continue to access affected files by accessing mirrored copies on the surviving disks in the disk group.

    Online storage reconfiguration and dynamic rebalancing—Oracle ASM permits you to add or remove disks from your disk storage system while the database is operating. When you add a disk to a disk group, Oracle ASM automatically redistributes the data so that it is evenly spread across all disks in the disk group, including the new disk. The process of redistributing data so that it is also spread across the newly added disks is known as rebalancing. It is done in the background and with minimal impact to database performance.

    Managed file creation and deletion—Oracle ASM further reduces administration tasks by enabling files stored in Oracle ASM disk groups to be managed by Oracle Database. Oracle ASM automatically assigns file names when files are created, and automatically deletes files when they are no longer needed by the database.



16. List some of the background process that used in ASM?

Process Description
RBAL Opens all device files as part of discovery and coordinates the rebalance activity
ARBn One or more slave processes that do the rebalance activity
GMON Responsible for managing the disk-level activities such as drop or offline and advancing the ASM disk group compatibility
MARK Marks ASM allocation units as stale when needed
Onnn One or more ASM slave processes forming a pool of connections to the ASM instance for exchanging messages
PZ9n One or more parallel slave processes used in fetching data on clustered ASM installation from GV$ views

17. What are types of ASM Mirroring?
 
Disk Group Type Supported Mirroring Levels Default Mirroring Level
External redundancy Unprotected (None) Unprotected (None)
Normal redundancy Two-wayThree-wayUnprotected (None) Two-way
High redundancy Three-way Three-way

18. What is ASM Striping?
ASM can use variable size data extents to support larger files, reduce memory requirements, and improve performance.
Each data extent resides on an individual disk.
Data extents consist of one or more allocation units.
The data extent size is:
  • Equal to AU for the first 20,000 extents (0–19999)
  • Equal to 4 × AU for the next 20,000 extents (20000–39999)
  • Equal to 16 × AU for extents above 40,000
ASM stripes files using extents with a coarse method for load balancing or a fine method to reduce latency.
  • Coarse-grained striping is always equal to the effective AU size.
  • Fine-grained striping is always equal to 128 KB.

19. How many ASM Diskgroups can be created under one ASM Instance?
ASM imposes the following limits:
  • 63 disk groups in a storage system
  • 10,000 ASM disks in a storage system
  • Two-terabyte maximum storage for each ASM disk (non-Exadata)
  • Four-petabyte maximum storage for each ASM disk (Exadata)
  • 40-exabyte maximum storage for each storage system
  • 1 million files for each disk group
  • ASM file size limits (database limit is 128 TB):
  1. External redundancy maximum file size is 140 PB.
  2. Normal redundancy maximum file size is 42 PB.
  3. High redundancy maximum file size is 15 PB.

20. What is node listener?
In 11gr2 the listeners will run from Grid Infrastructure software home
  • The node listener is a process that helps establish network connections from ASM clients to the ASM instance.
  • Runs by default from the Grid $ORACLE_HOME/bin directory
  • Listens on port 1521 by default
  • Is the same as a database instance listener
  • Is capable of listening for all database instances on the same machine in addition to the ASM instance
  • Can run concurrently with separate database listeners or be replaced by a separate database listener
  • Is named tnslsnr on the Linux platform
21. What is SCAN listener?
A scan listener is something that additional to node listener which listens the incoming db connection requests from the client which got through the scan IP, it got end points configured to node listener where it routes the db connection requests to particular node listener.

22. What is the difference between CRSCTL and SRVCTL?
crsctl manages clusterware-related operations:
  • Starting and stopping Oracle Clusterware
  • Enabling and disabling Oracle Clusterware daemons
  • Registering cluster resources
srvctl manages Oracle resource–related operations:
  • Starting and stopping database instances and services
  • Also from 11gR2 manages the cluster resources like network,vip,disks etc
23. How to control Oracle Clusterware?
To start or stop Oracle Clusterware on a specific node:
# crsctl stop crs
# crsctl start crs
To enable or disable Oracle Clusterware on a specific node:
# crsctl enable crs
# crsctl disable crs
24. How to check the cluster (all nodes) status?
To check the viability of Cluster Synchronization Services (CSS) across nodes:
$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
25. How to check the cluster (one node) status?
$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
26. How to find Voting Disk location?
•To determine the location of the voting disk:
# crsctl query css votedisk
## STATE File Universal Id File Name Disk group
– —– —————– ———- ———-
1. ONLINE 8c2e45d734c64f8abf9f136990f3daf8 (ASMDISK01) [DATA]
2. ONLINE 99bc153df3b84fb4bf071d916089fd4a (ASMDISK02) [DATA]
3. ONLINE 0b090b6b19154fc1bf5913bc70340921 (ASMDISK03) [DATA]
Located 3 voting disk(s).
27. How to find Location of OCR?
  • cat /etc/oracle/ocr.loc
ocrconfig_loc=+DATA
local_only=FALSE
  • #OCRCHECK (also about OCR integrity)

28. How to find the cluster network settings?
To determine the list of interfaces available to the cluster:
$ oifcfg iflist –p -n
To determine the public and private interfaces that have been configured:
$ oifcfg getif
eth0 192.0.2.0 global public
eth1 192.168.1.0 global cluster_interconnect
To determine the Virtual IP (VIP) host name, VIP address, VIP subnet mask, and VIP interface name:
$ srvctl config nodeapps -a
VIP exists.:host01
VIP exists.: /192.0.2.247/192.0.2.247/255.255.255.0/eth0
29. How to check the node connectivity in Oracle Grid Infrastructure?
$ cluvfy comp nodecon -n all –verbose
30. Can I stop all nodes in one command? Meaning that stopping whole cluster ?
In 10g its not possible, where in 11g it is possible
[root@pic1]# crsctl start cluster -all
[root@pic2]# crsctl stop cluster –all

31. How to stop whole cluster with single command?
    crsctl stop cluster (possible only from 11gr2), please note crsctl commands becomes global now, if you do not specify node specifically the command executed globally for example
    crsctl stop crs (stops in all crs resource in all nodes)
    crsctl stop crs –n <ndeoname) (stops only in specified node)

32. CRS is not starting automatically after a node reboot, what you do to make it happen?

To enable :
  • crsctl enable crs (as root)
To disable :
  • crsctl disable crs (as root)



No comments:

Post a Comment

Oracle ASM Concepts

Note: Proofread any scripts before using. Always try scripts on a test instance first. This Blog is not responsible for any damage. O...