开始测试oracle 11g rac,本本的性能有限,因此装个单节点rac。步骤如下:
这里不再多说
vi /usr/share/gdm/defaults.conf
将[xdmcp]下的Enable=false 改成 Enable=true
AllowRemoteRoot=false 改成 AllowRemoteRoot=true
使之生效:
gdm-restart
需要安装的包的清单:
binutils-2.15.92.0.2
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.97
elfutils-libelf-devel-0.97
expat-1.95.7
gcc-3.4.6
gcc-c++-3.4.6
glibc-2.3.4-2.41
glibc-2.3.4-2.41 (32 bit)
glibc-common-2.3.4
glibc-devel-2.3.4
glibc-headers-2.3.4
libaio-0.3.105
libaio-0.3.105 (32 bit)
libaio-devel-0.3.105
libaio-devel-0.3.105 (32 bit)
libgcc-3.4.6
libgcc-3.4.6 (32-bit)
libstdc++-3.4.6
libstdc++-3.4.6 (32 bit)
libstdc++-devel 3.4.6
make-3.80
pdksh-5.2.14
sysstat-5.0.5
unixODBC-2.2.11
unixODBC-2.2.11 (32 bit)
unixODBC-devel-2.2.11
unixODBC-devel-2.2.11 (32 bit)
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n'binutils \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel
groupadd -g 1000 oinstall
groupadd -g 1020 asmadmin
groupadd -g 1021 asmdba
groupadd -g 1031 dba
groupadd -g 1022 asmoper
useradd -u 1100 -g oinstall -G asmadmin,asmdba grid
useradd -u 1101 -g oinstall -G dba,asmdba oracle
passwd oracle
passwd grid
cat>>/home/grid/.bashrc<<EOF if [ -t 0 ]; then stty intr ^C fi export ORACLE_BASE=/opt/app/oracle export ORACLE_HOME=/opt/app/11.2.0/grid export ORACLE_SID=+ASM1 export PATH=\$ORACLE_HOME/bin:\$PATH umask 022 EOF
cat>>/home/oracle/.bashrc<<EOF if [ -t 0 ]; then stty intr ^C fi export ORACLE_BASE=/opt/app/oracle export ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1 export ORACLE_SID=oradb1 export PATH=\$ORACLE_HOME/bin:\$PATH umask 022 EOF
cat>>/root/.bashrc<<EOF export PATH=/opt/app/11.2.0/grid/bin:/opt/app/oracle/product/11.2.0/db_1/bin:\$PATH EOF
cat>/etc/hosts<<EOF # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost # Public Network - (eth0,eth1---bond0) 192.168.77.241 rac rac.wildwave.com # Private Interconnect - (eth2,eth3-bond1) 10.10.10.241 rac-priv # Public Virtual IP (VIP) addresses for - (eth0,eth1---bond0) 192.168.77.243 rac-vip EOF
cd /var/named/chroot/etc cat> named.conf<<EOF options { listen-on port 53 { any; }; listen-on-v6 port 53 { ::1; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named_mem_stats.txt"; // Those options should be used carefully because they disable port // randomization // query-source port 53; // query-source-v6 port 53; allow-query { 192.168.77.0/24; }; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; view localhost_resolver { match-clients { 192.168.77.0/24; }; match-destinations { any; }; recursion yes; include "/etc/named.rfc1912.zones"; }; controls { inet 127.0.0.1 allow { localhost; } keys { "rndckey"; }; }; include "/etc/rndc.key"; EOF cat> named.rfc1912.zones<<EOF zone "." IN { type hint; file "named.ca"; }; zone "wildwave.com" IN { type master; file "wildwave.zone"; allow-update { none; }; }; zone "77.168.192.in-addr.arpa" IN { type master; file "named.wildwave"; allow-update { none; }; }; EOF
cd /var/named/chroot/var/named/ cat>named.ca<<EOF ; This file holds the information on root name servers needed to ; initialize cache of Internet domain name servers ; (e.g. reference this file in the "cache . <file>" ; configuration file of BIND domain name servers). ; ; This file is made available by InterNIC ; under anonymous FTP as ; file /domain/named.cache ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; ; last update: Jun 17, 2010 ; related version of root zone: 2010061700 ; ; formerly NS.INTERNIC.NET ; . 3600000 IN NS A.ROOT-SERVERS.NET. A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30 ; ; FORMERLY NS1.ISI.EDU ; . 3600000 NS B.ROOT-SERVERS.NET. B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 ; ; FORMERLY C.PSI.NET ; . 3600000 NS C.ROOT-SERVERS.NET. C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 ; ; FORMERLY TERP.UMD.EDU ; . 3600000 NS D.ROOT-SERVERS.NET. D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 ; ; FORMERLY NS.NASA.GOV ; . 3600000 NS E.ROOT-SERVERS.NET. E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 ; ; FORMERLY NS.ISC.ORG ; . 3600000 NS F.ROOT-SERVERS.NET. F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2F::F ; ; FORMERLY NS.NIC.DDN.MIL ; . 3600000 NS G.ROOT-SERVERS.NET. G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 ; ; FORMERLY AOS.ARL.ARMY.MIL ; . 3600000 NS H.ROOT-SERVERS.NET. H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53 H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803F:235 ; ; FORMERLY NIC.NORDU.NET ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FE::53 ; ; OPERATED BY VERISIGN, INC. ; . 3600000 NS J.ROOT-SERVERS.NET. J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30 ; ; OPERATED BY RIPE NCC ; . 3600000 NS K.ROOT-SERVERS.NET. K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FD::1 ; ; OPERATED BY ICANN ; . 3600000 NS L.ROOT-SERVERS.NET. L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 ; ; OPERATED BY WIDE ; . 3600000 NS M.ROOT-SERVERS.NET. M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 M.ROOT-SERVERS.NET. 3600000 AAAA 2001:DC3::35 ; End of File EOF
cd /var/named/chroot/var/named/ cat>wildwave.zone<<EOF \$TTL 86400 @ IN SOA rac.wildwave.com. root.wildwave.com. ( 2010022101 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum @ IN NS rac.wildwave.com. rac IN A 192.168.77.241 rac-vip IN A 192.168.77.243 rac-scan IN A 192.168.77.245 rac-scan IN A 192.168.77.246 rac-scan IN A 192.168.77.247 EOF
cd /var/named/chroot/var/named/ cat>named.wildwave<<EOF \$TTL 86400 @ IN SOA rac.wildwave.com. root.wildwave.com. ( 2010022101 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum @ IN NS rac.wildwave.com. 241 IN PTR rac.wildwave.com. 243 IN PTR rac-vip.wildwave.com. 245 IN PTR rac-scan.wildwave.com. 246 IN PTR rac-scan.wildwave.com. 247 IN PTR rac-scan.wildwave.com. EOF
chkconfig named on
service named restart
cat>/etc/resolv.conf<<EOF
nameserver 192.168.77.241
EOF
vi /etc/nsswitch.conf
hosts: files dns
顺序改为
hosts:dns files
这个试验里我们使用CTSS
停ntp 时间同步
/etc/init.d/ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.org
chkconfig ntpd on
vi /etc/sysconfig/ntpd
# Drop root to id 'ntp:ntp' by default.
OPTIONS="-x -u ntp:ntp -p/var/run/ntpd.pid"
# Set to 'yes' to sync hw clock aftersuccessful ntpdate
SYNC_HWCLOCK=no
# Additional options for ntpdate
NTPDATE_OPTIONS=""
Then, restart the NTP service.
/sbin/service ntpd restart
cat>>/etc/sysctl.conf <<EOF kernel.shmmax = 4294967295 kernel.shmall = 2097152 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 6815744 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 fs.aio-max-nr=1048576 EOF
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 echo "session required pam_limits.so">>/etc/pam.d/login 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
mkdir -p /opt/app/oraInventory chown -R grid:oinstall /opt/app/oraInventory chmod -R 775 /opt/app/oraInventory mkdir -p /opt/app/11.2.0/grid chown -R grid:oinstall /opt/app/11.2.0/grid chmod -R 775 /opt/app/11.2.0/grid mkdir -p /opt/app/oracle mkdir /opt/app/oracle/cfgtoollogs chown -R oracle:oinstall /opt/app/oracle chmod -R 775 /opt/app/oracle mkdir -p /opt/app/oracle/product/11.2.0/db_1 chown -R oracle:oinstall /opt/app/oracle/product/11.2.0/db_1 chmod -R 775 /opt/app/oracle/product/11.2.0/db_1
rpm -ivh oracleasm-support-2.1.7-1.el5.i386.rpm\
oracleasmlib-2.0.4-1.el5.i386.rpm \
oracleasm-2.6.18-128.el5-2.0.5-1.el5.i686.rpm
/etc/init.d/oracleasm configure
Default user to own the driver interface[]: grid
Default group to own the driver interface[]: asmadmin
Start Oracle ASM library driver on boot(y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n)[y]: y
Writing Oracle ASM library driverconfiguration: done
Initializing the Oracle ASMLib driver: [ OK]
Scanning the system for Oracle ASMLibdisks: [ OK ]
/usr/sbin/oracleasm createdisk DISK1 /dev/sdc1
/usr/sbin/oracleasm createdisk DISK2 /dev/sdc2
/usr/sbin/oracleasm createdisk DISK3 /dev/sdc3
/usr/sbin/oracleasm createdisk DISK4 /dev/sdc4
/usr/sbin/oracleasm scandisks
/usr/sbin/oracleasm listdisks
在grid安装目录中的rpm下,安装这个包
[root@rac rpm]# rpm -ivh cvuqdisk-1.0.9-1.rpm
Preparing... ########################################### [100%]
Using default group oinstall to installpackage
1:cvuqdisk ###########################################[100%]
若cvuqdisk的所有者不为oinstall,则需要设置环境变量CVUQDISK_GRP的值为该用户组
使用grid用户登录,执行runInstaller来安装
这里的cluster name 添集群名称,scan name填上在dns服务器中配置的scan ip对应的名称
创建asm disk group,用于存放ocr和vote,冗余度normal为3倍,high为5倍