WINDOWS下的程序员出身,偶尔也写一些linux平台下小程序, 后转行数据库行业,专注于ORACLE和DB2的运维和优化。 同时也是ios移动开发者。欢迎志同道合的朋友一起研究技术。 数据库技术交流群:58308065,23618606
全部博文(599)
分类: Oracle
2009-12-07 22:00:19
Wilson注:可以从 下载这些介质
恭喜,您已经在 VMware Server 上安装了 Enterprise Linux!
在 VMware 控制台上,以 root 用户身份登录。
"/bin/tar: ./inventory/Components21/oracle.ordim.server/10.2.0.1.0: time stamp 2006-11-04 06:24:04 is 25 s in the future"
#boot=/dev/sda default=0 timeout=5 splashimage=(hd0,0)/boot/grub/splash.xpm.gz hiddenmenu title Enterprise (2.6.9-42.0.0.0.1.ELsmp) root (hd0,0) kernel /boot/vmlinuz-2.6.9-42.0.0.0.1.ELsmp ro root=LABEL=/ rhgb quiet clock=pit nosmp noapic nolapic initrd /boot/initrd-2.6.9-42.0.0.0.1.ELsmp.img title Enterprise-up (2.6.9-42.0.0.0.1.EL) root (hd0,0) kernel /boot/vmlinuz-2.6.9-42.0.0.0.1.EL ro root=LABEL=/ rhgb quiet clock=pit nosmp noapic nolapic initrd /boot/initrd-2.6.9-42.0.0.0.1.EL.img
# reboot
# groupadd oinstall # groupadd dba # mkdir -p /export/home/oracle /ocfs # useradd -d /export/home/oracle -g oinstall -G dba -s /bin/ksh oracle # chown oracle:dba /export/home/oracle /u01 # passwd oracle New Password: Re-enter new Password: passwd: password successfully changed for oracle
/export/home/oracle/.profile
export PS1="`/bin/hostname -s`-> " export EDITOR=vi export ORACLE_SID=devdb1 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin: /usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin umask 022
rac1-> mkdir p $ORACLE_BASE/admin rac1-> mkdir p $ORACLE_HOME rac1-> mkdir p $ORA_CRS_HOME rac1-> mkdir -p /u01/oradata/devdb
提高 Oracle 用户的 shell 限制。使用文本编辑器将下面列出的行添加到 /etc/security/limits.conf、/etc/pam.d/login 和 /etc/profile。其他信息可以从中获得。
/etc/security/limits.conf
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
session required /lib/security/pam_limits.so
if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi
从 ISO CD 解压缩这些程序包,并以 root 用户身份执行下面的命令。
# ls libaio-0.3.105-2.i386.rpm openmotif21-2.1.30-11.RHEL4.6.i386.rpm # # rpm -Uvh *.rpm warning: libaio-0.3.105-2.i386.rpm: V3 DSA signature: NOKEY, key ID b38a8516 Preparing... ########################################### [100%] 1:openmotif21 ########################################### [ 50%] 2:libaio ########################################### [100%]
# more /etc/sysctl.conf kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 1048576 net.core.rmem_max = 1048576 net.core.wmem_default = 262144 net.core.wmem_max = 262144
# more /etc/hosts 127.0.0.1 localhost 192.168.2.131 rac1.mycorpdomain.com rac1 192.168.2.31 rac1-vip.mycorpdomain.com rac1-vip 10.10.10.31 rac1-priv.mycorpdomain.com rac1-priv 192.168.2.132 rac2.mycorpdomain.com rac2 192.168.2.32 rac2-vip.mycorpdomain.com rac2-vip 10.10.10.32 rac2-priv.mycorpdomain.com rac2-priv
在 /etc/modprobe.conf 中添加以下行,以设置 hangcheck 内核模块参数。
/etc/modprobe.conf
options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
要立即加载模块,执行“modprobe -v hangcheck-timer”。
为 OCFS2 和 Oracle ASM 创建磁盘分区。为 OCFS2 (/dev/sdb) 和 Oracle ASM(/dev/sdc、/dev/sdd、/dev/sde)准备一组原始磁盘。
在 rac1 上,以 root 用户身份执行
# fdisk /dev/sdb
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-512, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-512, default 512): Using default value 512 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
# fdisk /dev/sdc
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-391, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-391, default 391): Using default value 391 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
# fdisk /dev/sdd
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-391, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-391, default 391): Using default value 391 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
# fdisk /dev/sde
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-261, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-261, default 261): Using default value 261 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 910 7309543+ 83 Linux /dev/sda2 911 1170 2088450 82 Linux swap /dev/sda3 1171 2610 11566800 83 Linux Disk /dev/sdb: 536 MB, 536870912 bytes 64 heads, 32 sectors/track, 512 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 512 524272 83 Linux Disk /dev/sdc: 3221 MB, 3221225472 bytes 255 heads, 63 sectors/track, 391 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 391 3140676 83 Linux Disk /dev/sdd: 3221 MB, 3221225472 bytes 255 heads, 63 sectors/track, 391 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdd1 1 391 3140676 83 Linux Disk /dev/sde: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sde1 1 261 2096451 83 Linux
# rpm -Uvh oracleasmlib-2.0.2-1.i386.rpm Preparing... ########################################### [100%] 1:oracleasmlib ########################################### [100%]
在这个阶段,您应该已经安装了以下 ASM 程序包。
[root@rac1 swdl]# rpm -qa | grep oracleasm oracleasm-support-2.0.3-2 oracleasm-2.6.9-42.0.0.0.1.ELsmp-2.0.3-2 oracleasmlib-2.0.2-1
执行以下任务,将原始设备映射到先前创建的共享分区。每次引导集群节点时,原始设备都必须与块设备绑定。
将以下行添加到 /etc/sysconfig/rawdevices 中。
/etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sdc1 /dev/raw/raw2 /dev/sdd1 /dev/raw/raw3 /dev/sde1
# /sbin/service rawdevices restart Assigning devices: /dev/raw/raw1 --> /dev/sdc1 /dev/raw/raw1: bound to major 8, minor 33 /dev/raw/raw2 --> /dev/sdd1 /dev/raw/raw2: bound to major 8, minor 49 /dev/raw/raw3 --> /dev/sde1 /dev/raw/raw3: bound to major 8, minor 65 done # chown oracle:dba /dev/raw/raw[1-3] # chmod 660 /dev/raw/raw[1-3] # ls -lat /dev/raw/raw* crw-rw---- 1 oracle dba 162, 3 Nov 4 07:04 /dev/raw/raw3 crw-rw---- 1 oracle dba 162, 2 Nov 4 07:04 /dev/raw/raw2 crw-rw---- 1 oracle dba 162, 1 Nov 4 07:04 /dev/raw/raw1
以 oracle 用户身份执行
rac1-> ln -sf /dev/raw/raw1 /u01/oradata/devdb/asmdisk1 rac1-> ln -sf /dev/raw/raw2 /u01/oradata/devdb/asmdisk2 rac1-> ln -sf /dev/raw/raw3 /u01/oradata/devdb/asmdisk3
修改 /etc/udev/permissions.d/50-udev.permissions。原始设备在引导时会重新映射。默认情况下,在引导时原始设备的拥有者将更改为 root 用户。如果拥有者不是 oracle 用户,则 ASM 在访问共享分区时会出现问题。在 /etc/udev/permissions.d/50-udev.permissions 中为原始行“raw/*:root:disk:0660”添加注释,然后添加一个新行“raw/*:oracle:dba:0660”。
/etc/udev/permissions.d/50-udev.permissions
# raw devices ram*:root:disk:0660 #raw/*:root:disk:0660 raw/*:oracle:dba:0660