You are on page 1of 8

What is ASM in Oracle?

Oracle ASM is Oracle's volume manager specially designed for Oracle database data. It is available since
Oracle database version 10g and many improvements have been made in versions 11g release 1 and 2.
ASM offers support for Oracle RAC clusters without the requirement to install 3rd party software, such as
cluster aware volume managers or filesystems.
ASM is shipped as part of the database server software (Enterprise and Standard editions) and does not
cost extra money to run.
ASM simplifies administration of Oracle related files by allowing the administrator to reference disk groups
rather than individual disks and files, which are managed by ASM.
The ASM functionality is an extention of the Oracle Managed Files (OMF) functionality that also includes
striping and mirroring to provide balanced and secure storage. The new ASM functionality can be used in
combination with existing raw and cooked file systems, along with OMF and manually managed files.
--------------------------------------------------------------------------------------------------------------------------
Where are the Oracle ASM files stored?
Oracle ASM files are stored within the Oracle ASM diskgroup. If we dig into internals, oracle ASM files are
stored within the Oracle ASM filesystem structures.
--------------------------------------------------------------------------------------------------------------------------
How to create tablespace in ASM?
SQL> CREATE TABLESPACE TS1 DATAFILE '+DATA1' SIZE 20GB;
Above command creates a datafile in DATA1 diskgroup. use " sqlplus / as sysasm"
--------------------------------------------------------------------------------------------------------------------------
How to add datafile to tablespace in ASM?
SQL> alter tablespace TS1 add datafile '+DATA' size 10G;
Above command adds a datafile in DATA1 diskgroup. use " sqlplus / as sysasm"
--------------------------------------------------------------------------------------------------------------------------
How to add logfile to tablespace in ASM?
ALTER DATABASE ADD LOGFILE THREAD 2
GROUP 5 ('+REDO/db_name/redo__t2_5a.log','+REDO/db_name/redo__t2_5b.log') SIZE 100m,
GROUP 6 ('+REDO/db_name/redo__t2_6a.log','+REDO/db_name/redo__t2_6b.log') SIZE 100m;
Above command adds a logfile in REDO diskgroup. use " sqlplus / as sysasm"
--------------------------------------------------------------------------------------------------------------------------
How to drop redolog group in ASM?
Alter database drop logfile group 1;
--------------------------------------------------------------------------------------------------------------------------
How to drop redolog file in ASM?
ALTER DISKGROUP REDO DROP FILE '+REDO/db_name/redo02a.log';
--------------------------------------------------------------------------------------------------------------------------
Why should we use separate ASM home from DB home?
Because ASM will have its own ORACLE_HOME. To patch the ASM alone we need it in seperate home.
--------------------------------------------------------------------------------------------------------------------------
How many ASM instances should one have?
Several databases can share a single ASM instance. So, although one can create multiple ASM
instances on a single system, normal configurations should have one and only one ASM instance per
system.For clustered systems, create one ASM instance per node (called +ASM1, +ASM2, etc).
------------------------------------------------------------------------------------------------------------ --------------
What is the syntax of ASM filenames?
ASM filename syntax is as follows:
+DATA/PRODDB/datafile/undotbs02.491.870097913
+diskgroup_name/database_name/database_file_type/tag_name.file_number.incarnation
where,
+diskgroup_name – Name of the diskgroup that contains this file
database_name – Name of the database that contains this file
datafile – Can be one among 20 different ASM file types
tag_name – corresponds to tablespace name for datafiles, groupnumber for redo log files
file_number – file_number in ASM instance is used to correlate filenames in database instance
incarnation_number – It is derived from the timestamp. It is used to provide uniqueness
----------------------------------------------------------------------------------------------- ---------------------------
How many diskgroups should one database have?
As per my recommendation it is better to have one disk group for all database files(maintenace will be
easy) and optionally a second for recovery files (see FRA).
--------------------------------------------------------------------------------------------------------------------------
How can you access a database files in ASM diskgroup under RDBMS?
Once the ASM file is created in ASM diskgroup, a filename is generated. This file is now visible to the
user via the standard RDBMS view V$DATAFILE.
you have to set ASM environment variables ,connect using asmcmd command to see the files at OS
level
-------------------------------------------------------------------------------------------- ------------------------------
What is the use of an incarnation number in Oracle ASM filename?
Incarnation number distinguishes between a new file that has been created using the same file number
and another file that has been deleted
--------------------------------------------------------------------------------------------------------------------------
How to check the ASM parameter file?
set the ASM environment variables(HOME and ORACLE_SID)
cd $ASM_HOME/bin
Method-1:
sqlplus /as sysdba
sho parameter spfile
Method-2:
asmcmd
ASMCMD> spget
+DATA/asm/asmparameterfile/registry.253.766260991
--------------------------------------------------------------------------------------------------------------------------
What is ASM Rebalancing?
ASM attempts to spread the data evenly across all disks in a disk group. It does this on a 'file' basis, and
in the database, a 'datafile' assigned to a tablespace is a 'file'.So when you add a new datafile, ASM tries
to spread that file across all available disks in the diskgroup.
If you add another disk, or if you remove a disk (or it fails) ASM will automatically re-spread all files across
the new disk layout for that group. This re-spread is called 'rebalance', which happens at disk add/remove
time. Normally a separate process is fired up to do that rebalance. This will take a certain amount of time.
If you want it to happen faster, fire up more processes. You tell ASM it can add more processes by
increasing the rebalance power.
--------------------------------------------------------------------------------------------------------------------------
how to control rebalancing in ASM?
The rebalancing speed is controlled by the ASM_POWER_LIMIT initialization parameter. Setting it to 0
will disable disk rebalancing.
ALTER DISKGROUP data REBALANCE POWER 11;
--------------------------------------------------------------------------------------------------------------------------
Advantages of ASM in Oracle?
Provides automatic load balancing over all the available disks, thus reducing hot spots in the file system
Prevents fragmentation of disks, so you don’t need to manually relocate data to tune I/O performance
Adding disks is straight forward – ASM automatically performs online disk reorganization when you add or
remove storage
Uses redundancy features available in intelligent storage arrays
The storage system can store all types of database files
Using disk group makes configuration easier, as files are placed into disk groups
ASM provides stripping and mirroring (fine and coarse gain – see below)
ASM and non-ASM oracle files can coexist
Striping—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.
--------------------------------------------------------------------------------------------------------------------------
What are characteristics of ASM instance in Oracle?
The ASM functionality is controlled by an ASM instance. This is not a full database instance, just the
memory structures and as such is very small and lightweight.
Characteristics of Oracle ASM instance
1. do not have controlfile and datafiles, do not have online redo logs
2. do have init.ora and a passwordfile
3. for connecting remotely, create passwordfile and set following in init.ora
remote_login_passwordfile=exclusive
create a password file:
$ORACLE_HOME/bin/orapwd file=orapw+ASM1 password=yourpw entries=10
4. ASM instance can not be in open status as there are not datafiles.
--------------------------------------------------------------------------------------------------------------------------
What are ASM Background Processes in Oracle?
ARBx These are the slave processes that do the rebalance activity (where xis a number).
CKPT The CKPT process manages cross-instance calls (in RAC).
DBWR This process manages the SGA buffer cache in the ASM instance.DBWR writes out dirty buffers
(changed metadata buffers) from the ASMbuffer cache to disk.
GMON This process is responsible for managing the disk-level activities (drop/offline) and advancing
diskgroup compatibility.
KATE The Konductor or ASM Temporary Errands (KATE) process is usedto process disks online. This
process runs in the ASM instance and is startedonly when an offlined disk is onlined.
LGWR The LGWR process maintains the ASM Active Change Directory (ACD) buffers from the ASM
instance and flushes ACD change records to disk.
MARK The Mark Allocation Unit (AU) for Resync Koordinator (MARK) process coordinates the updates to
the Staleness Registry when the disks gooffline. This process runs in the RDBMS instance and is started
only when disks go offline in ASM redundancy diskgroups.
PING The PING process measures network latency and has the same functionality in RDBMS instances.
PMON This manages processes and process death in the ASM instance.
PSP0 This process spawner process is responsible for creating and managing other Oracle processes.
PZ9x These processes are parallel slave processes (where x is a number), used in fetching data on
behalf of GV$ queries.
RBAL This opens all device files as part of discovery and coordinates the rebalance activity.
SMON This process is the system monitor and also acts as a liaison to the Cluster Synchronization
Services (CSS) process (in Oracle Clusterware) fornode monitoring.
VKTM This process is used to maintain the fast timer and has the samefunctionality in the RDBMS
instances.
------------------------------------------------------------------------------------------------ --------------------------
What are the components of ASM are disk groups?
The main components of ASM are disk groups, each of which comprise of several physical disks that are
controlled as a single unit. The physical disks are known as ASM disks, while the files that reside on the
disks are know as ASM files. The locations and names for the files are controlled by ASM, but user-
friendly aliases and directory structures can be defined for ease of reference.
Failure groups are defined within a disk group to support the required level of redundancy. For two-way
mirroring you would expect a disk group to contain two failure groups so individual files are written to two
locations.
--------------------------------------------------------------------------------------------------------------------------
What are ASM instance initialization parameters?
INSTANCE_TYPE – Set to ASM or RDBMS depending on the instance type. The default is RDBMS.
DB_UNIQUE_NAME – Specifies a globally unique name for the database. This defaults to +ASM but
must be altered if you intend to run multiple ASM instances.
ASM_POWER_LIMIT -The maximum power for a rebalancing operation on an ASM instance. The valid
values range from 1 to 11, with 1 being the default. The higher the limit the more resources are allocated
resulting in faster rebalancing operations. This value is also used as the default when the POWER clause
is omitted from a rebalance operation.
ASM_DISKGROUPS – The list of disk groups that should be mounted by an ASM instance during
instance startup, or by the ALTER DISKGROUP ALL MOUNT statement. ASM configuration changes are
automatically reflected in this parameter.
ASM_DISKSTRING – Specifies a value that can be used to limit the disks considered for discovery.
Altering the default value may improve the speed of disk group mount time and the speed of adding a
disk to a disk group. Changing the parameter to a value which prevents the discovery of already mounted
disks results in an error. The default value is NULL allowing all suitable disks to be considered.
--------------------------------------------------------------------------------------------------------------------------
What are the files that can be stored within the Oracle ASM?
Files stored in Oracle ASM diskgroup/Oracl ASM filestructures include:
1) Datafile
2) Controlfiles
3) Server Parameter Files(SPFILE)
4) Redo Log files
5) Archived logs & backup files
RAC
What is RAC? What is the benefit of RAC over single instance database?
In Real Application Clusters environments, all nodes concurrently execute transactions against the same
database. Real Application Clusters coordinates each node’s access to the shared data to provide
consistency and integrity.
Benefits:
Improve response time
Scaleup
High availability
Transparency
Load balancing
--------------------------------------------------------------------------------------------------------------------------
What is a virtual IP address or VIP?
A virtual IP address or VIP is an alternate IP address that the client connections use instead of the
standard public IP address. To configure VIP address, we need to reserve a spare IP address for each
node, and the IP addresses must use the same subnet as the public network.
--------------------------------------------------------------------------------------------------------------------------
What is the use of VIP?
If a node fails, then the node’s VIP address fails over to another node on which the VIP address can
accept TCP connections but it cannot accept Oracle connections.
--------------------------------------------------------------------------------------------------------------------------
when does the VIP address failover happens ?
VIP addresses failover happens when the node on which the VIP address runs fails, all interfaces for the
VIP address fails, all interfaces for the VIP address are disconnected from the network.
Using virtual IP we can save our TCP/IP timeout problem because Oracle notification service maintains
communication between each nodes and listeners.

What is the significance of VIP address failover?


When a VIP address failover happens, Clients that attempt to connect to the VIP address receive a rapid
connection refused error .They don’t have to wait for TCP connection timeout messages.
--------------------------------------------------------------------------------------------------------------------------
What is voting disk?
Voting Disk is a file that sits in the shared storage area and must be accessible by all nodes in the cluster.
All nodes in the cluster registers their heart-beat information in the voting disk, so as to confirm that they
are all operational. If heart-beat information of any node in the voting disk is not available that node will be
evicted from the cluster. The CSS (Cluster Synchronization Service) daemon in the clusterware maintains
the heart beat of all nodes to the voting disk. When any node is not able to send heartbeat to voting disk,
then it will reboot itself, thus help avoiding the split-brain syndrome.
For high availability, Oracle recommends that you have a minimum of three or odd number (3 or greater)
of votingdisks.
Voting Disk – is file that resides on shared storage and Manages cluster members. Voting disk reassigns
cluster ownership between the nodes in case of failure.
The Voting Disk Files are used by Oracle Clusterware to determine which nodes are currently members
of the cluster. The voting disk files are also used in concert with other Cluster components such as CRS
to maintain the clusters integrity.
Oracle Database 11g Release 2 provides the ability to store the voting disks in ASM along with the OCR.
Oracle Clusterware can access the OCR and the voting disks present in ASM even if the ASM instance is
down. As a result CSS can continue to maintain the Oracle cluster even if the ASM instance has failed.
--------------------------------------------------------------------------------------------------------------------------
Why we need to keep odd number of voting disks ?
Oracle expects that you will configure at least 3 voting disks for redundancy purposes. You should always
configure an odd number of voting disks >= 3. This is because loss of more than half your voting disks will
cause the entire cluster to fail.
--------------------------------------------------------------------------------------------------------------------------
What are Oracle RAC software components?
Oracle RAC is composed of two or more database instances. They are composed of Memory structures
and background processes same as the single instance database.Oracle RAC instances use two
processes GES(Global Enqueue Service), GCS(Global Cache Service) that enable cache fusion.Oracle
RAC instances are composed of following background processes:
ACMS – Atomic Controlfile to Memory Service (ACMS)
GTX0-j – Global Transaction Process
LMON – Global Enqueue Service Monitor
LMD – Global Enqueue Service Daemon
LMS – Global Cache Service Process
LCK0 – Instance Enqueue Process
RMSn – Oracle RAC Management Processes (RMSn)
RSMN – Remote Slave Monitor
--------------------------------------------------------------------------------------------------------------------------
What are Oracle database background processes specific to RAC?
LMS—Global Cache Service Process
LMD—Global Enqueue Service Daemon
LMON—Global Enqueue Service Monitor
LCK0—Instance Enqueue Process
Oracle RAC instances use two processes, the Global Cache Service (GCS) and the Global Enqueue
Service (GES). The GCS and GES maintain records of the statuses of each data file and each cached
block using a Global Resource Directory (GRD). The GRD contents are distributed across all of the active
instances.
--------------------------------------------------------------------------------------------------------------------------
What is Cache Fusion?
Transfor of data across instances through private interconnect is called cachefusion.Oracle RAC is
composed of two or more instances. When a block of data is read from datafile by an instance within the
cluster and another instance is in need of the same block,it is easy to get the block image from the
insatnce which has the block in its SGA rather than reading from the disk. To enable inter instance
communication Oracle RAC makes use of interconnects. The Global Enqueue Service(GES) monitors
and Instance enqueue process manages the cahce fusion
--------------------------------------------------------------------------------------------------------------------------
What is SCAN?
Single Client Access Name (SCAN) is s a new Oracle Real Application Clusters (RAC) 11g Release 2
feature that provides a single name for clients to access an Oracle Database running in a cluster. The
benefit is clients using SCAN do not need to change if you add or remove nodes in the cluster.
SCAN provides a single domain name via (DNS), allowing and-users to address a RAC cluster as-if it
were a single IP address. SCAN works by replacing a hostname or IP list with virtual IP addresses (VIP).
Single client access name (SCAN) is meant to facilitate single name for all Oracle clients to connect to the
cluster database, irrespective of number of nodes and node location. Until now, we have to keep adding
multiple address records in all clients tnsnames.ora, when a new node gets added to or deleted from the
cluster.
Single Client Access Name (SCAN) eliminates the need to change TNSNAMES entry when nodes are
added to or removed from the Cluster. RAC instances register to SCAN listeners as remote listeners.
Oracle recommends assigning 3 addresses to SCAN, which will create 3 SCAN listeners, though the
cluster has got dozens of nodes.. SCAN is a domain name registered to at least one and up to three IP
addresses, either in DNS (Domain Name Service) or GNS (Grid Naming Service). The SCAN must
resolve to at least one address on the public network. For high availability and scalability, Oracle
recommends configuring the SCAN to resolve to three addresses.
--------------------------------------------------------------------------------------------------------------------------
What are SCAN components in a cluster?
1.SCAN Name
2.SCAN IPs (3)
3.SCAN Listeners (3)
--------------------------------------------------------------------------------------------------------------------------
What is FAN?
Fast application Notification as it abbreviates to FAN relates to the events related to instances,services
and nodes.This is a notification mechanism that Oracle RAC uses to notify other processes about the
configuration and service level information that includes service status changes such as,UP or DOWN
events.Applications can respond to FAN events and take immediate action.
--------------------------------------------------------------------------------------------------------------------------
What is TAF?
TAF (Transparent Application Failover) is a configuration that allows session fail-over between different
nodes of a RAC database cluster.
Transparent Application Failover (TAF). If a communication link failure occurs after a connection is
established, the connection fails over to another active node. Any disrupted transactions are rolled back,
and session properties and server-side program variables are lost. In some cases, if the statement
executing at the time of the failover is a Select statement, that statement may be automatically re-
executed on the new connection with the cursor positioned on the row on which it was positioned prior to
the failover.
After an Oracle RAC node crashes—usually from a hardware failure—all new application transactions are
automatically rerouted to a specified backup node. The challenge in rerouting is to not lose transactions
that were “in flight” at the exact moment of the crash. One of the requirements of continuous availability is
the ability to restart in-flight application transactions, allowing a failed node to resume processing on
another server without interruption. Oracle’s answer to application failover is a new Oracle Net
mechanism dubbed Transparent Application Failover. TAF allows the DBA to configure the type and
method of failover for each Oracle Net client.
TAF architecture offers the ability to restart transactions at either the transaction (SELECT) or session
level.
--------------------------------------------------------------------------------------------------------------------------
What are the requirements for Oracle Clusterware?
1. External Shared Disk to store Oracle Cluster ware file (Voting Disk and Oracle Cluster Registry – OCR)
2. Two network cards on each cluster ware node (and three set of IP address) –
Network Card 1 (with IP address set 1) for public network
Network Card 2 (with IP address set 2) for private network (for inter node communication between rac
nodes used by clusterware and rac database)
IP address set 3 for Virtual IP (VIP) (used as Virtual IP address for client connection and for connection
failover)
3. Storage Option for OCR and Voting Disk – RAW, OCFS2 (Oracle Cluster File System), NFS, …..
--------------------------------------------------------------------------------------------------------------------------
Which enable the load balancing of applications in RAC?
Oracle Net Services enable the load balancing of application connections across all of the instances in an
Oracle RAC database.
--------------------------------------------------------------------------------------------------------------------------
How to find location of OCR file when CRS is down?
If you need to find the location of OCR (Oracle Cluster Registry) but your CRS is down.
When the CRS is down:
Look into “ocr.loc” file, location of this file changes depending on the OS:
On Linux: /etc/oracle/ocr.loc
On Solaris: /var/opt/oracle/ocr.loc
When CRS is UP:
Set ASM environment or CRS environment then run the below command:
./ocrcheck
--------------------------------------------------------------------------------------------------------------------------
In 2 node RAC, how many NIC’s are r using ?
2 network cards on each clusterware node
Network Card 1 (with IP address set 1) for public network
Network Card 2 (with IP address set 2) for private network (for inter node communication between rac
nodes used by clusterware and rac database)
--------------------------------------------------------------------------------------------------------------------------
In 2 node RAC, how many IP’s are r using ?
6 – 3 set of IP address
## eth1-Public: 2
## eth0-Private: 2
## VIP: 2
--------------------------------------------------------------------------------------------------------------------------
How to find IP’s information in RAC ?
cat /etc/hosts
--------------------------------------------------------------------------------------------------------------------------
What is difference between RAC ip addresses ?
Public IP adress is the normal IP address typically used by DBA and SA to manage storage, system and
database. Public IP addresses are reserved for the Internet.
Private IP address is used only for internal clustering processing (Cache Fusion) (aka as interconnect).
Private IP addresses are reserved for private networks.
VIP is used by database applications to enable fail over when one cluster node fails. The purpose for
having VIP is so client connection can be failover to surviving nodes in case there is failure
-------------------------------------------------------------------------------------------- ------------------------------
Can application developer access the private ip ?
No. private IP address is used only for internal clustering processing (Cache Fusion) (aka as
interconnect)

You might also like