Summarize the process of creating an ASM disk.

Source: Internet
Author: User

Http://space.itpub.net/12361284/viewspace-65136

Summarize the process of creating an ASM disk.
This experiment is based on the CentOS 4.6 system,

1. First, I need to download some ASM lib packages on the Oracle website.
Http://www.oracle.com/technology/tech/linux/asmlib/install.html
Because the experiment environment is based on Linux and rhel as 4, three packages will be downloaded based on the current kernel and OS versions.
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

2. You can install them separately through the 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 ####################################### #### [100%]
[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%]
Create 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
[Root @ orahost01 ASM] # passwd oracle
Changing password for user oracle.
New UNIX password:
Bad password: it is based on a 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 ASM Library File
[Root @ orahost01 home] #/etc/init. d/oracleasm configure
Processing 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 <ENTER> without typing
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 (y/n) [n]: y
Fix permissions of Oracle ASM disks on boot (y/n) [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 operations will load some. o drivers related to ASM and mount the asm file system.

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 disks) into our Server
After
[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 error occurs because we have not partitioned the disk loaded by the/dev/sdb device file, and sdb is not a partition.
Therefore, we need to 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, the system will see an sdb1 device file.

Then we continue to partition sdc, sdd, and sde using the same method above.
------------------------------------------------------
Re-create an 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

Note that in the RAC environment, if an ASM disk is added to a node, the scandisks command is used on other nodes to obtain the change.
For example:
[Root @ orahost01 dev] #/etc/init. d/oracleasm scandisks
Scanning system for ASM disks: [OK]

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

Other operating systems are similar to this, which is very simple. You only need to follow this idea :)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.