linux下asm创建

1,关闭selinux

[root@rac1 opt]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#       enforcing - SELinux security policy is enforced.

#       permissive - SELinux prints warnings instead of enforcing.

#       disabled - SELinux is fully disabled.

#SELINUX=enforcing

SELINUX=disabled

# SELINUXTYPE= type of policy in use. Possible values are:

#       targeted - Only targeted network daemons are protected.

#       strict - Full SELinux protection.

SELINUXTYPE=targeted

 

保证selinux的值为:disable,并重启主机

 

2,下载asm软件

[root@rac1 opt]# uname -a

Linux rac1 2.6.18-274.el5 #1 SMP Fri Jul 8 17:36:59 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

找对应的asm软件

地址:http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html

[root@rac1 opt]# rpm -Uvh oracleasm-support-2.1.8-1.el5.x86_64.rpm

warning: oracleasm-support-2.1.8-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

   1:oracleasm-support      ########################################### [100%]

[root@rac1 opt]# rpm -Uvh oracleasm-2.6.18-274.el5-2.0.5-1.el5.x86_64.rpm

warning: oracleasm-2.6.18-274.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

   1:oracleasm-2.6.18-274.el########################################### [100%]

[root@rac1 opt]# rpm -Uvh oracleasmlib-2.0.4-1.el5.x86_64.rpm

warning: oracleasmlib-2.0.4-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ########################################### [100%]

   1:oracleasmlib           ########################################### [100%]

 

3,启动asm

[root@rac1 opt]# /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 <ENTER> without typing an

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

 

Default user to own the driver interface []: Default group to own the driver interface []:

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

Scan for Oracle ASM disks on boot (y/n) [y]:

Writing Oracle ASM library driver configuration: done

Initializing the Oracle ASMLib driver: [  OK  ]

Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@rac1 opt]# /etc/init.d/oracleasm enable

Writing Oracle ASM library driver configuration: done

Initializing the Oracle ASMLib driver: [  OK  ]

Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@rac1 opt]# df -ha | grep oracleasm

oracleasmfs              0     0     0   -  /dev/oracleasm

 

附启用或禁用oracleasm自动启动方法:

# /etc/init.d/oracleasm disable

# /etc/init.d/oracleasm enable

 

4,创建asm磁盘卷

ASM磁盘名可以为大写字母,数字和下划线,且以字母开始:

 

# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1

Marking disk "VOL1" as an ASM disk:                        [   OK   ]

 

如果提示Failed, 可以跟踪日志:

# tail -f /var/log/oracleasm

 

附删除磁盘语句:

# /etc/init.d/oracleasm deletedisk VOL1

 

检查配置情况:

# /etc/init.d/oracleasm querydisk VOL1

# /etc/init.d/oracleasm querydisk /dev/sdb1

# /etc/init.d/oracleasm listdisks

# ls -l /dev/oracleasm/disks/*

# /etc/init.d/oracleasm status


如果oracle要安装在asm磁盘上,需要执行如下步骤!

[root@rac1 CentOS]# /opt/app/oracle/product/10.2.0/bin/localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized


Adding to inittab 
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
        rac1
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)

 

 

你可能感兴趣的:(database)