1)What is ASM?
In Oracle Database 10g/11g there are two types of instances: database and ASM instances. The ASM instance, which is generally named +ASM, is started with the INSTANCE_TYPE=ASM init.ora parameter. This parameter, when set, signals the Oracle initialization routine to start an ASM instance and not a standard database instance. Unlike the standard database instance, the ASM instance contains no physical files; such as logfiles, controlfiles or datafiles, and only requires a few init.ora parameters for startup. Upon startup, an ASM instance will spawn all the basic background processes, plus some new ones that are specific to the operation of ASM. The STARTUP clauses for ASM instances are similar to those for database instances. For example, RESTRICT prevents database instances from connecting to this ASM instance. NOMOUNT starts up an ASM instance without mounting any disk group. MOUNT option simply mounts all defined diskgroups For RAC configurations, the ASM SID is +ASMx instance, where x represents the instance number.
2) What are the key benefits of ASM?
ASM provides filesystem and volume manager capabilities built into the Oracle database kernel. With this capability, ASM simplifies storage management tasks, such as creating/laying out databases and disk space management. Since ASM allows disk management to be done using familiar create/alter/drop SQL statements, DBAs do not need to learn a new skill set or make crucial decisions on provisioning.
The following are some key benefits of ASM:
ASM spreads I/O evenly across all available disk drives to prevent hot spots and maximize performance.
ASM eliminates the need for over provisioning and maximizes storage resource utilization facilitating database consolidation.
Inherent large file support.
Maintains redundant copies of data to provide high availability, or leverages 3rd party RAID functionality.
Supports Oracle Database as well as Oracle Real Application Clusters (RAC).
Capable of leveraging 3rd party multipathing technologies.
For simplicity and easier migration to ASM, an Oracle database can contain ASM and non-ASM files.
Any new files can be created as ASM files whilst existing files can also be migrated to ASM.
RMAN commands enable non-ASM managed files to be relocated to an ASM disk group.
Enterprise Manager Database Control or Grid Control can be used to manage ASM disk and file activities.
3) Describe about ASM architecture.
Automatic Storage Management (ASM) instance, Instance that manages the diskgroup metadata
Disk Groups, Logical grouping of disks Determines file mirroring options
LUNs presented to ASM
Files that are stored in ASM disk groups are called ASM files, this includes database files
ASM PROCESS ARCHITECTURE
Many databases can connect as clients to single ASM instances
ASM instance name should only be +ASM only
One diskgroup can serve many databases
4) How does database connects to ASM Instance?
The database communicates with ASM instance using the ASMB (umblicus process) process. Once the database obtains the necessary extents from extent map, all database IO going forward is processed through by the database processes, bypassing ASM. Thus we say ASM is not really in the IO path. So, the question how do we make ASM go faster…..you don’t have to.
5) What init.ora parameters does a user need to configure for ASM instances?
The default parameter settings work perfectly for ASM. The only parameters needed for 11g ASM:
6) How does the database interact with the ASM instance and how do I make ASM go faster?
ASM is not in the I/O path so ASM does not impede the database file access. Since the RDBMS instance is performing raw I/O, the I/O is as fast as possible.
7) Do I need to define the RDBMS FILESYSTEMIO_OPTIONS parameter when I use ASM?
No. The RDBMS does I/O directly to the raw disk devices, the FILESYSTEMIO_OPTIONS parameter is only for filesystems.
8) Why Oracle recommends two diskgroups?
Oracle recommends two diskgroups to provide a balance of manageability, utilization, and performance.
9) We have a 16 TB database. I’m curious about the number of disk groups we should use; e.g. 1 large disk group, a couple of disk groups, or otherwise?
For VLDBs you will probably end up with different storage tiers; e.g with some of our large customers they have Tier1 (RAID10 FC), Tier2 (RAID5 FC), Tier3 (SATA), etc. Each one of these is mapped to a diskgroup.
10) We have a new app and don’t know our access pattern, but assuming mostly sequential access, what size would be a good AU fit?
For 11g ASM/RDBMS it is recommended to use 4MB ASM AU for disk groups. See Metalink Note 810484.1
11) Would it be better to use BIGFILE tablespaces, or standard tablespaces for ASM?
The use of Bigfile tablespaces has no bearing on ASM (or vice versa). In fact most database object related decisions are transparent to ASM.
12) What is the best LUN size for ASM?
There is no best size! In most cases the storage team will dictate to you based on their standardized LUN size. The ASM administrator merely has to communicate the ASM Best Practices and application characteristics to storage folks :
• Need equally sized / performance LUNs
• Minimum of 4 LUNs
• The capacity requirement
• The workload characteristic (random r/w, sequential r/w) & any response time SLA
Using this info , and their standards, the storage folks should build a nice LUN group set for you.
13) In 11g RAC we want to separate ASM admins from DBAs and create different users and groups. How do we set this up?
• Separate Oracle Home for ASM and RDBMS.
• RDBMS instance connects to ASM using OSDBA group of the ASM instance.
Thus, software owner for each RDBMS instance connecting to ASM must be
a member of ASM’s OSDBA group.
• Choose a different OSDBA group for ASM instance (asmdba) than for
RDBMS instance (dba)
• In 11g, ASM administrator has to be member of a separate SYSASM group to
separate ASM Admin and DBAs.
14) Can my RDBMS and ASM instances run different versions?
Yes. ASM can be at a higher version or at lower version than its client databases. There’s two
components of compatiblity:
Diskgroup compatibility attributes:
15) Where do I run my database listener from; i.e., ASM HOME or DB HOME?
For 11gR2, the SCAN listener is run from GI Home, and database listener from DB HOME.
• For pre-11gR2, it is recommended to run the listener from the ASM HOME. This is particularly important for RAC env, since the listener is a node-level resource. In this config, you can create additional [user] listeners from the database homes as needed.
16) How do I backup my ASM instance?
Not applicable! ASM has no files to backup, as its does not contain controlfile,redo logs etc.
17) When should I use RMAN and when should I use ASMCMD copy?
RMAN is the recommended and most complete and flexible method to backup and transport database files in ASM.
ASMCMD copy is good for copying single files
• Supports all Oracle file types
• Can be used to instantiate a Data Guard environment
• Does not update the controlfile
• Does not create OMF files
18) I’m going to do add disks to my ASM diskgroup, how long will this rebalance take?
Rebalance time is heavily driven by the three items:
1) Amount of data currently in the diskgroup
2) IO bandwidth available on the server
3) ASM_POWER_LIMIT or Rebalance Power Level
19) We are migrating to a new storage array. How do I move my ASM database from storage A to storage B?
Given that the new and old storage are both visible to ASM, simply add the new disks to the ASM disk group and drop the old disks. ASM rebalance will migrate data online.
Note 428681.1 covers how to move OCR/Voting disks to the new storage array
20) Is it possible to unplug an ASM disk group from one platform and plug into a server on another platform (for example, from Solaris to Linux)?
No. Cross-platform disk group migration not supported. To move datafiles between endian-ness platforms, you need to use XTTS, Datapump or Streams.
21) How does ASM work with multipathing software?
It works great! Multipathing software is at a layer lower than ASM, and thus is transparent.
You may need to adjust ASM_DISKSTRING to specify only the path to the multipathing pseudo devices.
22) Is ASM constantly rebalancing to manage “hot spots”?
No…No…Nope!! ASM provides even distribution of extents across all disks in a disk group. Since each disk will equal number of extents, no single disk will be hotter than another. Thus the answer NO, ASM does not dynamically move hot spots, because hot spots simply do not
occur in ASM configurations. Rebalance only occurs on storage configuration changes (e.g. add, drop, or resize disks).
23) What are the file types that ASM support and keep in disk groups?
Data Pump dump sets
Data Guard configuration
Temporary data files
RMAN backup sets
Change tracking bitmaps
Online redo logs
RMAN data file copies
Transport data files
24. 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
25. 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.
26. 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): External redundancy maximum file size is 140 PB. Normal redundancy maximum file size is 42 PB. High redundancy maximum file size is 15 PB.
27) What is a diskgroup?
A disk group consists of multiple disks and is the fundamental object that ASM manages. Each disk group contains the metadata that is required for the management of space in the disk group. The ASM instance manages the metadata about the files in a Disk Group in the same way that a file system manages metadata about its files. However, the vast majority of I/O operations do not pass through the ASM instance. In a moment we will look at how file
I/O works with respect to the ASM instance.
28) Diagram that how database interacts with ASM when a request is to read or open a datafile.
1A. Database issues open of a database file
1B. ASM sends the extent map for the file to database instance. Starting with 11g, the RDBMS only receives first 60 extents the remaining extents in the extent map are paged in on demand, providing a faster open
2A/2B. Database now reads directly from disk
3A.RDBMS foreground initiates a create tablespace for example
3B. ASM does the allocation for its essentially reserving the allocation units
for the file creation
3C. Once allocation phase is done, the extent map is sent to the RDBMS
3D. The RDBMS initialization phase kicks in. In this phase the initializes all
the reserved AUs
3E. If file creation is successful, then the RDBMS commits the file creation
Going forward all I/Os are done by the RDBMS directly.
29) Can my disks in a diskgroup can be varied size? For example one disk is of 100GB and another disk is of 50GB. If so how does ASM manage the extents?
Yes, disk sizes can be varied, Oracle ASM will manage data efficiently and intelligent by placing the extents proportional to the size of the disk in the disk group, bigger diskgroups have more extents than lesser ones.
30) What is Intelligent Data Placement?
31) What is ASM preferred Mirror read? How does it useful?
32) What is ACFS?
33) What is ADVM?
34) What init.ora parameters does a user need to configure for ASM instances?
Ans. The default parameter settings work perfectly for ASM. The only parameters needed for 11g ASM: • PROCESSES • ASM_DISKSTRING* • ASM_DISKGROUPS* • INSTANCE_TYPE*
35) Don’t I lose all the advanced filesystem features when I move to ASM; e.g., direct I/O, write coalescing, and pre-fetech?
Ans. Yes, but that’s okay. • Most of the filesystem features mentioned, though good for general file data performance, interfere and fractionalize the benefits inherently provided by the database; e.g., • DBWR & LGWR does write coalescing, and user processes do sequential pre-fetches • All IO capable processes do un-buffered IO (raw IO) because of ASM
36) This is cool that ASM can now store Vote and OCR files. But how does CSS and CRS startup in this configuration?
Ans. It just does ☺ •There are two keys processes and a lot of crafty coding to get this to work in the correct startup sequence. ASMCMD> pwd +DATA/rst-cluster/OCRFILE ASMCMD> ls -l Type Redund Striped Time Sys Name OCRFILE UNPROT COARSE JUN 25 11:00:00 Y REGISTRY.255.718984285 ASMCMD> lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 203824 193028 0 193028 0 Y DATA/ ASM Configuration How does OCSSD starts if voting disk & OCR resides in ASM Diskgroups? ASM disk headers have new metadata in 11.2: you can use kfed to read the header of an ASM disk containing a voting disk The kfdhdb.vfstart and kfdhdb.vfend fields tell CSS where to find the voting file. This does not require the ASM instance to be up. Once the voting disks are located, CSS can access them and joins the cluster.
37). Do I need 11gR2 Grid Infrastructure to use ASM?
Ans. Yes. ASM is now part of Grid Infrastructure, which includes, Clusterware, ASM and ACFS. So you’ll to Install GI to use ASM • In 11gR2 there are two options for install – GI for Standalone Server (aka Oracle Restart) and GI for Clusterware
38). We have a 16 TB database. I’m curious about the number of disk groups we should use; e.g. 1 large disk group, a couple of disk groups, or otherwise? What about a database consolidation scenario.
Ans. For VLDBs you will probably end up with different storage tiers; e.g with some of our large customers they have Tier1 (RAID10 FC), Tier2 (RAID5 FC), Tier3 (SATA), etc. Each one of these is mapped to a diskgroup. These custs mapped certain tablespaces to specific tiers; eg, system/rollback/syaux and latency senstive tablespaces in Tier1, and not as IO critical on Tier2, etc. For 10g VLDBs its best to set an AU size of 16MB, this is more for metadata space efficiency than for performance. The 16MB recommendation is only necessary if the diskgroup is going to be used by 10g databases. In 11g we introduced variable size extents to solve the metadata problem. This requires compatible.rdbms & compatible.asm to be set to 126.96.36.199. With 11g you should set your AU size to the largest I/O that you wish to issue for sequential access (other parameters need to be set to increase the I/O size issued by Oracle). For random small I/Os the AU size does not matter very much as long as every file is broken into many more extents than there are disks.
39) In 11gR2 can my RDBMS and ASM instances run different versions?
Ans. Yes. But since ASM is now part of GI stack, it must be at the highest version. Keep in mind, there’s two components of compatibility: • Software compatibility • Diskgroup compatibility attributes: compatible.asm compatible.rdbms • Need to have compatible.asm set to 188.8.131.52 for OCR/Vote files and SPFILE in ASM •ACFS also needs 184.108.40.206 compatible.asm •Advance compatible.asm • ALTER DISKGROUP data SET ATTRIBUTE ‘compatible.asm’ = ’220.127.116.11.0’
40) Where do I run my database listener from; i.e., ASM HOME or DB HOME?
Ans. For 11gR2, the SCAN listener is run from GI Home, and database listener from DB HOME. • For pre-11gR2, it is recommended to run the listener from the ASM HOME. This is particularly important for RAC env, since the listener is a node-level resource. In this config, you can create additional [user] listeners from the database homes as needed. - Allows registering multiple databases on the node to register with the listener without being tied to a specific database home - From configuration tool standpoint (netca), we promote best practice of creating one listener per node with node name suffix (that is registered with CRS) and subsequent tools that create/upgrade databases will register instances to that listener. One can always create multiple listeners in different homes and use’em but that would complicate the configuration
41) How do I backup my ASM instance?
Ans. Not applicable! ASM has no files to backup
42). When should I use RMAN and when should I use ASMCMD copy?
Ans. RMAN is the recommended and most complete and flexible method to backup and transport database files in ASM. ASMCMD copy is good for copying single files • Supports all Oracle file types • In some cases. can be used to instantiate a Data Guard environment • Does not update the controlfile • Does not create OMF files ASMCMD> ls +fra/dumpsets/expdp_5_5.dat ASMCMD> cp expdp_5_5.dat firstname.lastname@example.org:+DATA/dumpsets/expdp_5_5.dat source +fra/dumpsets/expdp_5_5.dat target +DATA/dumpsets/expdp_5_5.dat copying file(s)… file, +DATA/dumpsets/expdp_5_5.dat, copy committed.
43). we are migrating to a new storage array. How do I move my ASM database from storage A to storage B?
Ans: • Given that the new and old storage are both visible to ASM, simply add the new disks to the ASM disk group and drop the old disks. ASM rebalance will migratedata online. • For pre-11gR2, See Note 428681.1, which covers how to move OCR/Voting disks to the new storage array ASM_SQL> alter diskgroup DATA drop disk data_legacy1, data_legacy2, data_legacy3 add disk ‘/dev/sddb1’, ‘/dev/sddc1’, ‘/dev/sddd1’; ASM Rebalancing • Automatic online rebalance whenever storage configuration changes • Only move data proportional to storage added • No need for manual I/O tuning • Automatic online rebalance whenever storage configuration changes • Online migration to new storage • Automatic online rebalance whenever storage configuration changes • Online migration to new storage
44). Is it possible to unplug an ASM disk group from one platform and plug into a server on another platform (for example, from Solaris to Linux)?
Ans. No. Cross-platform disk group migration not supported. To move datafiles between endian-ness platforms, you need to use XTTS, Datapump or Streams.
45) What is ASM Cluster File System (ACFS)?
• General purpose scalable file system • Journaling, extent based • Single node and cluster • POSIX, X/OPEN file system solution for UNIX/Linux • Windows file system solution for Windows platforms • Accessible through NAS protocols (NFS, CIFS) • Leverages ASM technology • Integrated with Oracle Clusterware for cluster support • Multi OS platform (Linux and Windows at initial release) • Integrated with Oracle system mgt tools • Oracle installation and configuration • Enterprise Manager and ASM Storage mgt tools • Native OS File System Management tools
Provides filesystem snapshots (FCOW)
• File system integrity and fast recovery via ACFS metadata checksums and journaling.
• ACFS designed as a peer to peer, multi-node, shared file system model and delivers coherent data access
• ACFS file system is installed as a dynamically loadable OS VFS driver
• Starting with RHEL5, Redhat now supports a ‘white list’ -kernel APIs which they commit they will not change in updates or patches. APIs used by ACFS-ADVM were added to their ‘white list’.
• Customers should be able to install an update or patch to the kernel and our drivers should not be impacted
46) Is ACFS supported on other platforms besides Linux
Ans. Yes. Other platforms are forthcoming
47) Can ACFS be used to store database datafiles? What about archive logs?
Ans. No. Currently we will not support database file to bestored in ACFS. This is due to performance reasons. Though you can do this in test/Q&A environments where performance is not essential
48).Can I sue ACFS to store BFILE data or other non-database related data
Ans. Yes. ACFS is POSIX compliant filesystem, and thus can store any file data type (besides database files ☺)
49) Will ACFS support other Data services, such advanced cloning, replication, de-dupe, etc..
Ans. Yes. ACFS Replication will be introduced in the next patchset release. Other advanced features are part of the roadmap.
3rd Party Software
50) How does ASM work with multipathing software?
Ans: It works great! Multipathing software is at a layer lower than ASM, and thus is transparent. You may need to adjust ASM_DISKSTRING to specify only the path to the multipathing pseudo devices.
51). Is ASMLIB required on Linux systems and are there any benefits to using it?
Ans. ASMLIB is not required to run ASM, but it is certainly recommended.
ASMLIB has following benefits:
• Simplified disk discovery
• Persistent disk names
• Efficient use of system resources
52). Is it possible to do rolling upgrades on ASMLIB in a RAC configuration
Ans. ASMLIB is independent of Oracle Clusterware and Oracle Database, and thus can be upgraded on its own.
•ASM requires very few parameters to run
•ASM based databases inherently leverage raw disk performance
•No additional database parameters needed to support ASM
•Mixed ASM-database version support
•Facilitates online storage changes
•RMAN recommended for backing up ASM based databases
•Spreads I/O evenly across all disks to maximize performance and eliminates hot spot
*************************ASM genral questions. *********************
53. How to add/remove disk to/from diskgroup?
54) What is the use of ASM (or) Why ASM preferred over filesystem?
Ans: ASM provides striping and mirroring.
55) What are the init parameters related to ASM?
INSTANCE_TYPE = ASM ASM_POWER_LIMIT = 11 ASM_DISKSTRING = ‘/dev/rdsk/*s2′, ‘/dev/rdsk/c1*’ ASM_DISKGROUPS = DG_DATA, DG_FRA
56) What is rebalancing (or) what is the use of ASM_POWER_LIMIT?
ASM_POWER_LIMIT is dynamic parameter, which will be useful for rebalancing the data across disks. Value can be 1(lowest) to 11 (highest).
57) What are different types of redundancies in ASM & explain?
58) How to copy file to/from ASM from/to filesystem?
By using ASMCMD cp command
59) How to find out the databases, which are using the ASM instance?
SQL> select DB_NAME from V$ASM_CLIENT;
60) What are different types of stripings in ASM & their differences?
select NAME,ALLOCATION_UNIT_SIZE from v$asm_diskgroup;
61) What is allocation unit and what is default value of au_size and how to change?
Every ASM disk is divided into allocation units (AU). An AU is the fundamental unit of allocation within a disk group. A file extent consists of one or more AU. An ASM file consists of one or more file extents. CREATE DISKGROUP disk_group_2 EXTERNAL REDUNDANCY DISK ‘/dev/sde1′ ATRRIBUTE ‘au_size’ = ’32M';
62) What process does the rebalancing?
63) 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 extension 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.
64) 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
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.
For example, if there are six disks in a disk group, pieces of each ASM file are
written to all six disks. These pieces come in 1 MB chunks known as extents.
When a database file is created, it is striped (divided into extents and distributed)
across the six disks, and allocated disk space on all six disks grows evenly.
When reading the file, file extents are read from all six disks in parallel, greatly
Mirroring—ASM can increase availability by optionally mirroring any file. 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, ASM can continue
to access affected files by accessing mirrored copies on the surviving disks in the disk group.
ASM supports 2-way mirroring, where each file extent gets one mirrored copy, and 3-way mirroring,
where each file extent gets two mirrored copies.
Online storage reconfiguration and dynamic rebalancing—ASM permits you to add or remove disks
from your disk storage system while the database is operating. When you add a disk, ASM
automatically redistributes the data so that it is evenly spread across all disks in the
disk group, including the new disk. This redistribution is known as rebalancing. It is done
in the background and with minimal impact to database performance. When you request to remove
a disk, ASM first rebalances by evenly relocating all file extents from the disk being removed
to the other disks in the disk group.
Managed file creation and deletion—ASM further reduces administration tasks by enabling files
stored in ASM disk groups to be Oracle-managed files. ASM automatically assigns filenames when
files are created, and automatically deletes files when they are no longer needed.
65) What is 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. Can be in mount (although there is no controlfile) and nomount status. When in mount status, database can use the diskgroup. The mount status actually means mount disk groups.
66) What are ASM Background Processes in Oracle?
Both an Oracle ASM instance and an Oracle Database instance are built on the same technology. Like a database instance, an Oracle ASM instance has memory structures (System Global Area) and background processes. Besides, Oracle ASM has a minimal performance impact on a server. Rather than mounting a database, Oracle ASM instances mount disk groups to make Oracle ASM files available to database instances. There are at least two new background processes added for an ASM instance: ASM Instance Background Processes: --------------------------------- ARBx (ASM) Rebalance working process ARBn performs the actual rebalance data extent movements in an Automatic Storage Management instance. There can be many of these processes running at a time, named ARB0, ARB1, and so on.These processes are managed by the RBAL process. The number of ARBx processes invoked is directly influenced by the asm_power_limit parameter. RBAL (Re-balancer) RBAL runs in both database and ASM instances. In the database instance, it does a global open of ASM disks. In an ASM instance, it also coordinates rebalance activity for disk groups.RBAL, which coordinates rebalance activities for disk resources controlled by ASM. Database Instance ASM Background Processes: ------------------------------------------ In the database instances, there are three background process to support ASM, namely: ASMB, this process contact CSS using the group name and acquires the associated ASM connect string. The connect string is subsequently used to connect to the ASM instance. RBAL, which performs global opens on all disks in the disk group.A global open means that more than one database instance can be accessing the ASM disks at a time. O00x, a group slave processes, with a numeric sequence starting at 000.
67) What are the components of 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.
68)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.
69) Why should we use separate ASM home?
ASM should be installed separately from the database software in its own ORACLE_HOME directory. This will allow you the flexibility to patch and upgrade ASM and the database software independently.
70) 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).
71) How many diskgroups should one have?
Generally speaking one should have only one disk group for all database files - and, optionally a second for recovery files (see FRA). Data with different storage characteristics should be stored in different disk groups. Each disk group can have different redundancy (mirroring) settings (high, normal and external), different fail-groups, etc. However, it is generally not necessary to create many disk groups with the same storage characteristics (i.e. +DATA1, +DATA2, etc. all on the same type of disks). To get started, create 2 disk groups - one for data and one for recovery files. Here is an example: CREATE DISKGROUP data EXTERNAL REDUNDANCY DISK '/dev/d1', '/dev/d2', '/dev/d3', ....; CREATE DISKGROUP recover EXTERNAL REDUNDANCY DISK '/dev/d10', '/dev/d11', '/dev/d12', ....; Here is an example how you can enable automatic file management with such a setup: ALTER SYSTEM SET db_create_file_dest = '+DATA' SCOPE=SPFILE; ALTER SYSTEM SET db_recovery_file_dest = '+RECOVER' SCOPE=SPFILE; You may also decide to introduce additional disk groups - for example, if you decide to put historic data on low cost disks, or if you want ASM to mirror critical data across 2 storage cabinets.
72) What is ASM Rebalancing?
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;
73) What happens when an Oracle ASM diskgroup is created?
When an ASM diskgroup is created, a hierarchialfilesystem structure is created.
74) How does this filesystem structure appear?
Oracle ASM diskgroup’s filesystem structure is similar to UNIX filesystem hierarchy
or Windows filesystem hierarchy.
75)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.
76)How are the Oracle ASM files stored within the Oracle ASM filesystem structure?
Oralce ASM files are stored within the Oracle ASM filesystem structures as objects
that RDBMS instances/Oracle database instance access. RDBMS/Oracle instance treats
the Oracle ASM files as standard filesystem files.
77) What are the Oracle ASM files that are stored within the Oracle ASM file hierarchy?
Files stored in Oracle ASM diskgroup/Oracl ASM filestructures include:
3) Server Parameter Files(SPFILE)
4) Redo Log files
78) What happens when you create a file/database file in ASM? What commands do you use to create database files?
Some common commands used for creating database files are : 1) Create tabespace 2) Add Datafile 3) Add Logfile For example, SQL> CREATE TABLESPACE TS1 DATAFILE '+DATA1' SIZE 10GB; Above command creates a datafile in DATA1 diskgroup
79) How can you access a databasefile 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.
80) What will be the syntax of ASM filenames?
ASM filename syntax is as follows: +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
81) What is an incarnation number?
An incarnation number is a part of ASM filename syntax. It is derived from the timestamp.
Once the file is created, its incarnation number doesnot change.
82) 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
ASM’s SPFile will be residing inside ASM itself. This could be found out in number of ways, looking at the alert log of ASM when ASM starts
Using parameter settings in server-side spfile +DATA/asm/asmparameterfile/registry.253.766260991
System parameters with non-default values:
large_pool_size = 12M
instance_type = “asm”
asm_diskgroups = “FLASH”
asm_diskgroups = “DATA”
asm_power_limit = 1
diagnostic_dest = “/opt/app/oracle”
Or using the asmcmd’s spget command which shows the spfile location registered with GnP profile
83) What init.ora parameters does a user need to configure for ASM instances?
A. The default parameter settings work perfectly for ASM. The only parameters needed for 11g ASM: • PROCESSES* • ASM_DISKSTRING* • ASM_DISKGROUPS • INSTANCE_TYPE •ASM is a very passive instance in that it doesn’t have a lot concurrent transactions or queries. So the memory footprint is quite small. •Even if you have 20 dbs connected to ASM , the ASM SGA does not need to change. This is b/c the ASM metadata is not directly tied to the number of clients •The 11g MEMORY_TARGET (DEFAULT VALUE) will be more than sufficient. •The processes parameter may need to be modified. Use the formula to determine the approp value: processes = 40 + (10 + [max number of concurrent database file creations, and file extend operations possible])*n Where n is the number of databases connecting to ASM (ASM clients). The source of concurrent file creations can be any of the following: •Several concurrent create tablespace commands •Creation of a Partitioned table with several tablespaces creations •RMAN backup channels •Concurrent archive logfile creations
84) How does the database interact with the ASM instance and how do I make ASM go faster?
A. ASM is not in the I/O path so ASM does not impede the database file access. Since the RDBMS instance is performing raw I/O, the I/O is as fast as possible. •Cover ASM instance architecture •Cover ASM-Communication via ASMB •The database communicates with ASM instance using the ASMB(umblicus process) process. Once the database obtains the necessary extents from extent map, all database IO going forward is processed through by the database processes, bypassing ASM. Thus we say ASM is not really in the IO path. So, the question how do we make ASM go faster…..you don’t have to. RDBMS and ASM Instance Interaction Server Operating System DATABASE ASM (1) Database opens file (1A) OPEN (1B) Extent Map (2) Database Reads file (2A) READ (2B) I/O Completes (3) Database Creates file (3A) CREATE (3B) Allocates file (3C) Extent Map (3D) Initializes file (3D) Commit 1A. Database issues open of a database file 1B. ASM sends the extent map for the file to database instance. Starting with 11g, the RDBMS only receives first 60 extents the remaining extents in the extent map are paged in on demand, providing a faster open 2A/2B. Database now reads directly from disk 3A.RDBMS foreground initiates a create tablespace for example 3B. ASM does the allocation for its essentially reserving the allocation units for the file creation 3C. Once allocation phase is done, the extent map is sent to the RDBMS 3D. The RDBMS initialization phase kicks in. In this phase the initializes all the reserved AUs 3E. If file creation is successful, then the RDBMS commits the file creation Going forward all I/Os are done by the RDBMS.
85) Do I need to define the RDBMS FILESYSTEMIO_OPTIONS parameter when I use ASM?
A. No. The RDBMS does I/O directly to the raw disk devices, the FILESYSTEMIO_OPTIONS parameter is only for filesystems. A. Review what the use of FILESYSTEMIO_OPTIONS parameter; essentially FILESYSTEMIO_OPTIONS is used for filesystem/block storage. This parameter controls which IO options are used. The value may be any of the following: *asynch - This allows asynchronous IO to be used where supported by the OS. *directIO - This allows directIO to be used where supported by the OS. Direct IO bypasses any Unix buffer cache. *setall - Enables both ASYNC and DIRECT IO. "none" - This disables ASYNC IO and DIRECT IO so that Oracle uses normal synchronous writes, without any direct io options. A. RDBMS does raw IO against the ASM disks, so need for FILESYSTEMIO_OPTIONS parameter. The only parameter that needs to be set is disk_asyncio=true, which is true by default. If using ASMLIB then even the disk_async does not need to be set. ASM is also supported for NFS files as ASM disks. In such cases, the required NFS mount options eliminate the need to set FILESYSTEMIO_OPTIONS.
Frequently used SQL Queries for ASM
1) Create Disk Group:
Example 1 : External Redundancy SQL> create diskgroup DATA external redundancy disk '/dev/oracleasm/disks/DISK1' name DATA_1; Example 2 : Normal Redundancy SQL> CREATE DISKGROUP data NORMAL REDUNDANCY FAILGROUP failure_group_1 DISK '/dev/oracleasm/disks/DISK2' NAME DATA_2,'/dev/oracleasm/disks/DISK3' NAME DATA_3, FAILGROUP failure_group_2 DISK '/dev/oracleasm/disks/DISK4' NAME DATA_4,'/dev/oracleasm/disks/DISK5' NAME DATA_5;
2) Drop Disk Group:
SQL> DROP DISKGROUP data INCLUDING CONTENTS;
3) Alter Disk Group:
3.1) Add a disk. SQL> ALTER DISKGROUP data ADD DISK ”/dev/oracleasm/disks/DISK6′ ; 3.2) Drop/remove a disk. SQL> ALTER DISKGROUP data DROP DISK DATA_5; 3.3) Undrop disk SQL> ALTER DISKGROUP data UNDROP DISKS; The UNDROP command used to undo only pending drop of disks. After you drop the disks you cannot revert. 3.4) Diskgroup Rebalance: Disk groups can be rebalanced manually Using REBALANCE clause and you can modify the POWER clause default value. SQL> ALTER DISKGROUP DATA REBALANCE POWER 8; 3.5) MOUNT and DISMOUNT DiskGroups: Normally Disk groups are mounted at ASM instance startup and dismounted at shutdown. Using MOUNT and DISMOUNT options you can make one or more Disk Groups available or unavailable. SQL> ALTER DISKGROUP data MOUNT; SQL> ALTER DISKGROUP data DISMOUNT; SQL> ALTER DISKGROUP ALL MOUNT; SQL> ALTER DISKGROUP ALL DISMOUNT; 3.6) DiskGroup Check: Use CHECK ALL to verify the internal consistency of disk group metadata and repair in case of any error. SQL> ALTER DISKGROUP data CHECK ALL; 3.7) DiskGroup resize: Resize the one or all disks in the Diskgroup. Resize all disks in a failure group. SQL> ALTER DISKGROUP data RESIZE DISKS IN FAILGROUP failure_group_1 SIZE 1024G; Resize a specific disk. SQL> ALTER DISKGROUP data RESIZE DISK DATA_0006 SIZE 100G; Resize all disks in a disk group. SQL> ALTER DISKGROUP data RESIZE ALL SIZE 100G;
4) To find ASM Diskgroup and Disks status
SQL> set lines 132 SQL> col name format a14 SQL> col PATH format a33 SQL> select GROUP_NUMBER,NAME,STATE,TYPE,TOTAL_MB,FREE_MB,VOTING_FILES from v$asm_diskgroup; GROUP_NUMBER NAME STATE TYPE TOTAL_MB FREE_MB V ------------ ------------------------------ ----------- ------ ---------- ---------- - 1 OCR_VOTE MOUNTED EXTERN 152999 152603 Y 2 DB_DATA MOUNTED EXTERN 812000 810198 N
sql> select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,VOTING_FILE,name,path from v$asm_disk; GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE V NAME PATH ------------ ----------- ------- ------------ ------- -------- - -------------- --------------------------------- 1 0 CACHED MEMBER ONLINE NORMAL Y OCR_VOTE_0 /dev/oracleasm/disks/OCR_VOTE01 2 3 CACHED MEMBER ONLINE NORMAL N DB_DATA_3 /dev/oracleasm/disks/DB_DATA04 2 2 CACHED MEMBER ONLINE NORMAL N DB_DATA_2 /dev/oracleasm/disks/DB_DATA03 2 1 CACHED MEMBER ONLINE NORMAL N DB_DATA_1 /dev/oracleasm/disks/DB_DATA02 2 0 CACHED MEMBER ONLINE NORMAL N DB_DATA_0 /dev/oracleasm/disks/DB_DATA01
Changing the disk size in ASM