ASM搭建操作



groupadd -g 1000 oinstall
groupadd -g 1200 asmadmin
groupadd -g 1201 asmdba
groupadd -g 1202 asmoper
groupadd -g 1300 dba
groupadd -g 1301 oper
useradd -m -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -s /bin/bash grid
useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash oracle


export ORACLE_SID=+ASM
export ORACLE_BASE=/u01/grid
export ORACLE_HOME=/u01/app/grid/11.2.0
export PATH=$ORACLE_HOME/bin:$PATH:/usr/local/bin/:.
export TEMP=/tmp
export TMP=/tmp
export TMPDIR=/tmp
umask 022


ORACLE_SID=dave; export ORACLE_SID
ORACLE_UNQNAME=dave; export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/11.2.0/db_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="YYYY:MM:DD HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=american_america.ZHS16GBK; export NLS_LANG
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
umask 022


D:\VirtualBox2\VBoxManage createhd --filename asm01.vdi --size 3072 --format VDI --variant Fixed

D:\VirtualBox2\VBoxManage createhd --filename asm02.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm03.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm04.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm05.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm06.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm07.vdi --size 3072 --format VDI --variant Fixed

D:\VirtualBox2\VBoxManage createhd --filename asm08.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm09.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm10.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm11.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm12.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm13.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage createhd --filename asm14.vdi --size 3072 --format VDI --variant Fixed

D:\VirtualBox2\VBoxManage createhd --filename asm15.vdi --size 3072 --format VDI --variant Fixed


D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 1 --device 0 --type hdd --medium asm01.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 2 --device 0 --type hdd --medium asm02.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 3 --device 0 --type hdd --medium asm03.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 4 --device 0 --type hdd --medium asm04.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 5 --device 0 --type hdd --medium asm05.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 6 --device 0 --type hdd --medium asm06.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 7 --device 0 --type hdd --medium asm07.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 8 --device 0 --type hdd --medium asm08.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 9 --device 0 --type hdd --medium asm09.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 10 --device 0 --type hdd --medium asm10.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 11 --device 0 --type hdd --medium asm11.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 12 --device 0 --type hdd --medium asm12.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 13 --device 0 --type hdd --medium asm13.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 14 --device 0 --type hdd --medium asm14.vdi --mtype shareable

D:\VirtualBox2\VBoxManage storageattach ASM --storagectl "SATA 控制器" --port 15 --device 0 --type hdd --medium asm15.vdi --mtype shareable


D:\VirtualBox2\VBoxManage modifyhd asm01.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm02.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm03.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm04.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm05.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm06.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm07.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm08.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm09.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm10.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm11.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm12.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm13.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm14.vdi --type shareable

D:\VirtualBox2\VBoxManage modifyhd asm15.vdi --type shareable


[root@asm ~]# /sbin/scsi_id -g -u /dev/sdb

1ATA_VBOX_HARDDISK_VBe9df898c-735b4040

用fdisk 命令查看我们的磁盘到k。

for i in b c d e f g h i j k l m n o p;
do
echo    "KERNEL==\"sd*\",    BUS==\"scsi\",   PROGRAM==\"/sbin/scsi_id   -g   -u     /dev/\$name\",
RESULT==\"`/sbin/scsi_id     -g    -u     /dev/sd$i`\",     NAME=\"asm-disk$i\",     OWNER=\"grid\",
GROUP=\"asmadmin\", MODE=\"0660\""
done

KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VB72a9ecf1-b654dbb0",     NAME="asm-diskb",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VB615e7724-c0c8fb8f",     NAME="asm-diskc",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VBbe06f4ea-b6deac17",     NAME="asm-diskd",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VB8af664b9-71c07493",     NAME="asm-diske",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VB34511c08-a2468637",     NAME="asm-diskf",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VBff7a58cd-1687f729",     NAME="asm-diskg",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VB5864ca7d-2111aeb9",     NAME="asm-diskh",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VBa8f8eb33-76ebd397",     NAME="asm-diski",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VB7704fee6-788e1301",     NAME="asm-diskj",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VB192ca93b-9c35c493",     NAME="asm-diskk",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VBcb31720d-e910414c",     NAME="asm-diskl",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VB79345015-eb6a0f84",     NAME="asm-diskm",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VB6f078e17-7b8eadca",     NAME="asm-diskn",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VBc94f881b-6f48557e",     NAME="asm-disko",     OWNER="grid",
GROUP="asmadmin", MODE="0660"
KERNEL=="sd*",    BUS=="scsi",   PROGRAM=="/sbin/scsi_id   -g   -u     /dev/$name",
RESULT=="1ATA_VBOX_HARDDISK_VBf6bb56d5-c99cdebf",     NAME="asm-diskp",     OWNER="grid",
GROUP="asmadmin", MODE="0660"

touch /etc/udev/rules.d/99-oracle-asmdevices.rules


service iptables status
service iptables stop
chkconfig iptables off
chkconfig iptables --list


mkdir -p /u01/grid
mkdir -p /u01/app/grid/11.2.0
chown -R grid:oinstall /u01
mkdir -p /u01/app/oracle/11.2.0/db_1

chown -R oracle:oinstall /u01/app/oracle

chmod -R 775 /u01


cat >> /etc/security/limits.conf <<EOF

grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF


cat >> /etc/pam.d/login <<EOF
session        required         pam_limits.so
EOF


cat >> /etc/profile <<EOF
if [ /$USER = "oracle" ] || [ /$USER = "grid" ]; then
        if [ /$SHELL = "/bin/ksh" ]; then
                ulimit -p 16384
                ulimit -n 65536
        else
                ulimit -u 16384 -n 65536
        fi
        umask 022
fi
EOF

compat-libcap1-1.10
compat-libstdc++-33(x86_64)-3.2.3
ksh-20100621
libaio-devel(x86_64)-0.3.107


/u01/app/grid/11.2.0/perl/bin/perl  -I/u01/app/grid/11.2.0/perl/lib -I/u01/app/grid/11.2.0/crs/install /u01/app/grid/11.2.0/crs/install/roothas.pl
/u01/app/grid/11.2.0/perl/bin/perl  -I/u01/app/grid/11.2.0/perl/lib -I/u01/app/grid/11.2.0/crs/install /u01/app/grid/11.2.0/crs/install/roothas.pl

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值