Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand Oracle ASM

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces you how to understand Oracle ASM, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Oracle 10g must choose a file storage option during installation, such as "File system", "ASM" and "Naked device". Among them, ASM has been more and more applied to practice. When ASM, Oracle can be freed from the constraints of the OS file system, making file management more convenient, but also improve a lot of hardware properties. Of course, using ASM requires special configuration and creation of an ASM disk group. The following is to find some articles to introduce, a preliminary understanding of ASM.

Oracle database automatic storage management (ASM)

There is a lot of discussion about ASM, but what exactly is ASM? ASM is an effective abstraction layer that allows your Oracle database to be used with an abstract space called DiskGroups instead of using DataFiles directly. This brings a lot of benefits, but it also requires learning new concepts, commands, usage, and management tasks. So before you put it into your production system, look at what it solves, what it manages, and the pros and cons of it.

Why create it?

The best way to answer this question is to directly trace the source, the original architect of Bill Bridge-- automated storage management. Oracle ASM,Bill in the Oracle Press title provides a link where he discusses the problems encountered in using vendor-specific operating system file systems to manage Oracle data file placement:

1. For archived logs and backups, operating system vendors do not provide shared disk file systems.

two。 The logical volume manager hides the location of the files, making it difficult to manage disk Icano and provide good statistics.

3. The existing lvm does not work well when the number of disks exceeds 100.

4. When the database has more than 1000 data files, the operating system and Oracle can not handle the database well.

5. Naming becomes difficult when there are a large number of data files.

6. Features and file system restrictions vary from operating system to operating system.

7. Operating system-level users have access to Oracle files through standard use, but Oracle does not know it.

So he began to solve these problems by setting up Oracle's own file system. His goal is to provide these features:

1. Tightly integrated with Oracle and used with clusters (parallel servers).

two。 Automatically use the new storage and manage it as a disk unit or disk group.

3. Supports thousands of disks.

4. The file does not have a name and is hidden in the operating system.

Who needs it?

Now a quick glance at the above problems and solutions will help you determine who needs ASM. At first, it was used to deal with today's large online databases. So if it includes your store, then you may already be following it, or start implementing ASM. If your database is small and there are not many data files, you may need some more reasons to consider adopting it.

1. You will be familiar with some new technologies, and you should start by building it in your development environment and testing it for a few months.

two。 If you want to get higher performance from your existing disk subsystem and get better statistics for predicting disk Ibank O.

3. If you are using RAC, then you need to consider ASM.

Start

ASM is managed by an instance, very similar to an Oracle database. But the initial parameters are very limited, and the startup process is much simpler.

a. Set your ORACLE_SID to + ASM1

b. Edit init.ora

# as opposed to RDBMS for a normal Oracle instance

INSTANCE_TYPE=ASM

# these names will be used in place of datafile names when you create tablespaces

ASM_DISKGROUPS=SEAN, AARON

Processes=100

# this parameter is platform. Specific and is the path to the raw disk device

ASM_DISKSTRING='/dev/cciss/c0d0p1'

# on 11g you should use diagnostic_dest instead of these

Background_dump_dest=/opt/oracle/admin/+ASM/bdump'

Core_dump_dest=/opt/oracle/admin/+ASM/cdump'

User_dump_dest=/opt/oracle/admin/+ASM/udump'

c. Start the ASM instance

$sqlplus / as sysdba

SQL > startup

d. Create a disk group

SQL > create diskgroup SEAN disk'/ dev/cciss/c0d0p1'

e. Check the creation of tablespaces

You might guess that creating a tablespace will make a slight change. The default method is as follows:

SQL > create tablespace sean_space datafile'+ SEAN' size 1GB

But think about this great feature. If you set the parameter to the init.ora file in your database:

Db_create_file_dest=+SEAN

Then you can do this:

SQL > create tablespace sean_space

Then let Oracle do the rest of the work. In both cases, you will find that the file paths listed in v$datafile are related to the abstract + SEAN disk group, not to an actual operating system data file.

f. More.

Of course, simplifying the creation of file names and table spaces is just the tip of the iceberg of what ASM can do for you. It can also provide a level of redundancy.

On the database side, external redundancy is mainly when you have redundancy at the hardware level (RAID) or in other external methods that Oracle can see. In other words, if asm_diskstring devices are their own logic, hiding physical disks behind some redundant hardware layers, then you will have external redundancy.

However, if you do not have this redundancy, then ASM can provide. You can specify redundancy, failure groups, and a set of other options to prevent the loss of one or more disks, controllers, or even entire SAM failures. ASM also provides Istroke O, which is evenly distributed among disk groups. Because ASM has a good understanding of what's going on behind it, Oracle can automatically provide you with a better balance of Ibind O to disk.

Challenges in using ASM

ASM is certainly a powerful technology with great potential. But for every technical solution, there will be many challenges. For ASM, it potentially destroys the general balance of power between the Unix system management group and the database / database administrator group. Previous groups managed the disk, hardware, and operating system levels, allowing database administrators to collaborate with them to obtain new resources. This will challenge the balance to some extent, and it will cause some resistance from this group.

Finally, it should be the business requirements that drive its adoption. Also note that ASM is still in the understanding stage of enterprise computing, which is relatively new. There are some vendors whose core business has been in the logical space manager / file system space for many years. In general, maturity is important for software systems and reliability.

Summary

ASM is powerful and provides a solution for the growing large database systems that are currently deployed. It can also provide solutions for smaller database installations or for databases that use clustering. As with any new technology, evaluate, test, and then test more.

Turn to another ASM configuration article

*

Configure Oracle 10g ASM disk

Summarize the disk creation process of ASM

This experiment is based on CentOS 4.6system.

1. First of all, I need some ASM lib packages for download on Oracle's website.

Http://www.oracle.com/technology/tech/linux/asmlib/install.html

Because the environment of my experiment is based on Linux and RHEL AS 4, I will download three packages according to the current version of kernel and OS.

They are:

Oracleasm-2.6.9-67.EL-2.0.3-1.i686.rpm

Oracleasmlib-2.0.2-1.i386.rpm

Oracleasm-support-2.0.3-1.i386.rpm

two。 After that, they can be installed separately through RPM software.

[root@orahost01 ASM] # rpm-Uvh oracleasm-support-2.0.3-1.i386.rpm

Preparing... # [100%]

1:oracleasm-support # # [100%]

[root@orahost01 ASM] # rpm-Uvh oracleasm-2.6.9-67.EL-2.0.3-1.i686.rpm

Preparing... # [100%]

1:oracleasm-2.6.9-67.EL #

[root@orahost01 ASM] # rpm-Uvn oracleasmlib-2.0.2-1.i386.rpm

-Uvn: unknown option

[root@orahost01 ASM] # rpm-Uvh oracleasmlib-2.0.2-1.i386.rpm

Preparing... # [100%]

1:oracleasmlib # # [100%]

And create corresponding Oracle users and groups

[root@orahost01 ASM] # groupadd oinstall

[root@orahost01 ASM] # groupadd dba

[root@orahost01 ASM] # mkdir-p / opt/oracle/product

[root@orahost01 ASM] # mkdir-p / home/oracle

[root@orahost01 ASM] # useradd-g oinstall-G dba-d / home/oracle oracle

[root@orahost01 ASM] # passwd oracle

Changing password for user oracle.

New UNIX password:

BAD PASSWORD: it is based ona dictionary word

Retype new UNIX password:

Passwd: all authentication tokens updated successfully.

[root@orahost01 ASM] # id oracle

Uid=500 (oracle) gid=500 (oinstall) groups=500 (oinstall), 501 (dba)

[root@orahost01 ASM] # chown-R oracle:oinstall / opt/oracle

[root@orahost01 ASM] # cd / home

[root@orahost01 home] # chown-R oracle:oinstall oracle

3. Configure the library files for ASM

[root@orahost01 home] # / etc/init.d/oracleasm configure

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library

Driver. The following questions will determine whether the driver is

Loaded on boot and what permissions it will have. The current values

Will be shown in brackets ('[]'). Hitting without typing an

Answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: oracle

Default group to own the driver interface []: dba

Start Oracle ASM library driver on boot (yzone) [n]: y

Fix permissions of Oracle ASM disks on boot (yzone) [y]: y

Writing Oracle ASM library driver configuration: [OK]

Creating / dev/oracleasm mount point: [OK]

Loading module "oracleasm": [OK]

Mounting ASMlib driver filesystem: [OK]

Scanning system for ASM disks: [OK]

The above operation will load some .o drivers related to ASM. And the file system of asm on mount

4. How to disable and enable ASM

[root@orahost01 home] # / etc/init.d/oracleasm disable

Writing Oracle ASM library driver configuration: [OK]

Unmounting ASMlib driver filesystem: [OK]

Unloading module "oracleasm": [OK]

[root@orahost01 home] # / etc/init.d/oracleasm enable

Writing Oracle ASM library driver configuration: [OK]

Loading module "oracleasm": [OK]

Mounting ASMlib driver filesystem: [OK]

Scanning system for ASM disks: [OK]

5. Create an ASM disk

First, insert some disks (4 pieces) into our Server

After that

[root@orahost01 home] # / etc/init.d/oracleasm createdisk myVol1 / dev/sdb

Marking disk "/ dev/sdb" as an ASM disk: asmtool: Device "/ dev/sdb" is not a partition

[FAILED]

The reason for the error here is that we have not partitioned the disk loaded by the / dev/sdb device file, and sdb is not a partition

So let's partition the sdb disk first.

[root@orahost01 dev] # fdisk sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only

Until you decide to write them. After that, of course, the previous

Content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w (rite)

Command (m for help): M

Command action

A toggle a bootable flag

B edit bsd disklabel

C toggle the dos compatibility flag

D delete a partition

L list known partition types

M print this menu

N add a new partition

O create a new empty DOS partition table

P print the partition table

Q quit without saving changes

S create a new empty Sun disklabel

T change a partition's system id

U change display/entry units

V verify the partition table

W write table to disk and exit

X extra functionality (experts only)

Command (m for help): n

Command action

E extended

P primary partition (1-4)

P

Partition number (1-4): 1

First cylinder (1-130, default 1):

Using default value 1

Last cylinder or + size or + sizeM or + sizeK (1-130, default 130):

Using default value 130

Command (m for help): W

The partition table has been altered!

Calling ioctl () to re-read partition table.

Syncing disks.

At this time, a sdb1 device file will appear in the system.

After that, we continue to partition sdc,sdd,sde in the same way as above.

Recreate the ASM disk

[root@orahost01 dev] # / etc/init.d/oracleasm createdisk myVol1 / dev/sdb1

Marking disk "/ dev/sdb1" as an ASM disk: [OK]

[root@orahost01 dev] # / etc/init.d/oracleasm listdisks

MYVOL1

[root@orahost01 dev] # / etc/init.d/oracleasm createdisk myVol2 / dev/sdc1

Marking disk "/ dev/sdc1" as an ASM disk: [OK]

[root@orahost01 dev] # / etc/init.d/oracleasm createdisk myVol3 / dev/sde1

Marking disk "/ dev/sde1" as an ASM disk: [OK]

[root@orahost01 dev] # / etc/init.d/oracleasm createdisk myVol4 / dev/sdd1

Marking disk "/ dev/sdd1" as an ASM disk: [OK]

[root@orahost01 dev] # / etc/init.d/oracleasm listdisks

MYVOL1

MYVOL2

MYVOL3

MYVOL4

It is important to note that if you are in a RAC environment, if you add an ASM disk on one node, you will need to use the scandisks command on other nodes to get this change.

Such as:

[root@orahost01 dev] # / etc/init.d/oracleasm scandisks

Scanning system for ASM disks: [OK]

The physical foundation of the ASM environment has been successfully built.

Other OS is similar to this, it is very simple, just follow this train of thought:)

On how to understand Oracle ASM to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report