为什么格式不通用呢?在MS world里调完格式,贴到这里还要调!!! 没劲的重复性劳动,pdf文档下载在这里http://space.itpub.net/11780477/viewspace-713771
目录
EL5U6_11gr2RAC_DNS_DHCP_TGTD_64 (/mnt/sdb1/vmware/EL5U6_11gr2RAC _DNS_DHCP_TGTD_64)
EL5U6_11gr2RAC_rac1_DNS_64 (/mnt/sdc1/vmware/EL5U6_11gr2RAC_rac1_DNS_64)
EL5U6_11gr2RAC_rac2_DNS_64 (/mnt/sdd1/vmware/EL5U6_11gr2RAC_rac1_DNS_64)
EL5U6_11gr2RAC_DNS_DHCP_TGTD_64
简介看ppt
用到的服务 DHCP,DNS,FTP,TGTD,ISCSI,YUM,UDEV
安装介质
VMware-Workstation-Full-8.0.1-528992.i386.bundle
Enterprise-R5-U6-Server-x86_64-dvd.iso
linux_11gR2_database_1of2.zip
linux_11gR2_database_2of2.zip
|
|
VALUE |
|
hostname: |
DDT |
|
network: |
eth0:192.168.1.50/24 |
|
tgtd |
/dev/sdb 5G /dev/sdc 5G /dev/sdd 5G /dev/sde 5G /dev/sdf 5G /dev/sdg 5G |
|
DHCP |
|
|
DNS |
|
|
hostname |
rac1 |
|
network |
eth0:192.168.1.11/24 192.168.1.1 eth1:192.168.2.11/24 eth2:192.168.2.21/24 |
|
iscsi |
/dev/raw/raw1 /dev/sdb /dev/raw/raw2 /dev/sdc /dev/raw/raw3 /dev/sdd /dev/raw/raw4 /dev/sde /dev/raw/raw5 /dev/sdf /dev/raw/raw6 /dev/sdg |
|
ASM datagroup DATA+ |
raw1 raw2 |
|
ASM datagroup DATA1+ |
raw3 raw4 raw5 |
|
candidate raw |
raw6 |
|
hostname |
rac2 |
|
network |
eth0:192.168.1.12/24 192.168.1.1 eth1:192.168.2.12/24 eth2:192.168.2.22/24 |
|
iscsi |
/dev/raw/raw1 /dev/sdb /dev/raw/raw2 /dev/sdc /dev/raw/raw3 /dev/sdd /dev/raw/raw4 /dev/sde /dev/raw/raw5 /dev/sdf /dev/raw/raw6 /dev/sdg |
|
ASM datagroup DATA+ |
raw1 raw2 |
|
ASM datagroup DATA1+ |
raw3 raw4 raw5 |
|
candidate raw |
raw6 |
参看视频ER5U6_64_install_mv.avi
利用vmware-workstation的clone选项从full base系统clone出EL5U6_11gr2RAC _DNS_DHCP_TGTD_64 ,EL5U6_11gr2RAC_rac1_DNS_64 和EL5U6_11gr2RAC_rac2_DNS_64 . EL5U6_11gr2RAC _DNS_DHCP_TGTD_64再另添加6块5GB硬盘.
将hostname 改为DDT
IPADDR=192.168.1.50
192.168.1.50 DDT
192.168.1.11 rac1
192.168.1.12 rac2
|
[root@DDT ~]# mount /dev/cdrom /mnt/ mount: block device /dev/cdrom is write-protected, mounting read-only [root@DDT ~]# rpm -ihv /mnt/Server/dhcp-3.0.5-23.el5_5.2.x86_64.rpm warning: /mnt/Server/dhcp-3.0.5-23.el5_5.2.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:dhcp ########################################### [100%] [root@DDT ~]# |
|
[root@DDT ~]# cat /etc/dhcpd.conf # # DHCP Server Configuration file. # see /usr/share/doc/dhcp*/dhcpd.conf.sample #[root@DDT ~]# cat /usr/share/doc/dhcp*/dhcpd.conf.sample ddns-update-style. interim; ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway option routers 192.168.0.1; option subnet-mask 255.255.255.0;
option nis-domain "domain.org"; option domain-name "domain.org"; option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time # option ntp-servers 192.168.1.1; # option netbios-name-servers 192.168.1.1; # --- Selects point-to-point node (default is hybrid). Don't change this unless # -- you understand Netbios very well # option netbios-node-type 2;
range dynamic-bootp 192.168.0.128 192.168.0.254; default-lease-time 21600; max-lease-time 43200;
# we want the nameserver to appear at a fixed address host ns { next-server marvin.redhat.com; hardware ethernet 12:34:56:78:AB:CD; fixed-address 207.175.42.254; } } [root@DDT ~]# vi /etc/dhcpd.conf
# # DHCP Server Configuration file. # see /usr/share/doc/dhcp*/dhcpd.conf.sample # ddns-update-style. interim; ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.0 {
# --- default gateway option routers 192.168.1.1; option subnet-mask 255.255.255.0;
option nis-domain "DDT"; option domain-name "DDT"; option domain-name-servers 192.168.1.50;
option time-offset -18000; # Eastern Standard Time # option ntp-servers 192.168.1.1; # option netbios-name-servers 192.168.1.1; # --- Selects point-to-point node (default is hybrid). Don't change this unless # -- you understand Netbios very well # option netbios-node-type 2;
range dynamic-bootp 192.168.1.2 192.168.1.254; default-lease-time 21600; max-lease-time 43200;
# we want the nameserver to appear at a fixed address # host ns { # next-server DDT; # hardware ethernet 00:0C:29:A3:E7:AD # fixed-address 192.168.1.50; # } } ~ "/etc/dhcpd.conf" 35L, 1136C written [root@DDT ~]# /etc/init.d/dhcpd restart Starting dhcpd: [ OK ] [root@DDT ~]#
|
|
[root@DDT ~]# mount /dev/cdrom /mnt/ mount: block device /dev/cdrom is write-protected, mounting read-only [root@DDT ~]# rpm -ihv /mnt/Server/bind-9.3.6-16.P1.el5.x86_64.rpm warning: /mnt/Server/bind-9.3.6-16.P1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:bind ########################################### [100%] [root@DDT ~]# rpm -ihv /mnt/Server/bind-chroot-9.3.6-16.P1.el5.x86_64.rpm warning: /mnt/Server/bind-chroot-9.3.6-16.P1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:bind-chroot ########################################### [100%] [root@DDT ~]# rpm -ihv /mnt/Server/caching-nameserver-9.3.6-16.P1.el5.x86_64.rpm warning: /mnt/Server/caching-nameserver-9.3.6-16.P1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:caching-nameserver ########################################### [100%] [root@DDT ~]#
|
|
[root@DDT etc]# cd ~ [root@DDT ~]# cd /var/named/chroot/etc/ [root@DDT etc]# cp named.caching-nameserver.conf named.conf [root@DDT etc]# cat named.conf // // named.caching-nameserver.conf // // Provided by Red Hat caching-nameserver package to configure the // ISC BIND named(8) DNS server as a caching only nameserver // (as a localhost DNS resolver only). // // See /usr/share/doc/bind*/sample/ for example named configuration files. // // DO NOT EDIT THIS FILE - use system-config-bind or an editor // to create named.conf - edits to this file will be lost on // caching-nameserver package upgrade. // 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 { any; }; allow-query-cache { any; }; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; view localhost_resolver { match-clients { any; }; match-destinations { any; }; recursion yes; include "/etc/named.rfc1912.zones"; }; [root@DDT etc]# [root@DDT etc]# cat named.rfc1912.zones // named.rfc1912.zones: // // Provided by Red Hat caching-nameserver package // // ISC BIND named zone configuration for zones recommended by // RFC 1912 section 4.1 : localhost TLDs and address zones // // See /usr/share/doc/bind*/sample/ for example named configuration files. // zone "." IN { type hint; file "named.ca"; };
zone "localdomain" IN { type master; file "localdomain.zone"; allow-update { none; }; };
zone "localhost" IN { type master; file "localhost.zone"; allow-update { none; }; };
zone "0.0.127.in-addr.arpa" IN { type master; file "named.local"; allow-update { none; }; };
zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { type master; file "named.ip6.local"; allow-update { none; }; };
zone "255.in-addr.arpa" IN { type master; file "named.broadcast"; allow-update { none; }; };
zone "0.in-addr.arpa" IN { type master; file "named.zero"; allow-update { none; }; };
zone "1.168.192.in-addr.arpa" IN { type master; file "rac.local"; allow-update { none; }; };
zone "rac" IN { type master; file "rac.zone"; allow-update { none; }; }; [root@DDT etc]# [root@DDT etc]# cd /var/named/chroot/var/named/ [root@DDT named]# cat rac.local $TTL 86400 @ IN SOA rac. root.rac. ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS localhost. 1 IN PTR localhost. 200 IN PTR gns.rac. 201 IN PTR rac-cluster-scan.rac. 202 IN PTR rac-cluster-scan.rac. 203 IN PTR rac-cluster-scan.rac. 204 IN PTR rac-cluster-scan.rac. [root@DDT named]# cat rac.zone $TTL 86400 @ IN SOA rac root.rac ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN A 127.0.0.1 IN AAAA ::1 IN NS rac IN NS localhost gns IN A 192.168.1.200 rac-cluster-scan IN A 192.168.1.201 rac-cluster-scan IN A 192.168.1.202 rac-cluster-scan IN A 192.168.1.203 rac-cluster-scan IN A 192.168.1.204 [root@DDT named]#
|
|
[root@DDT named]# /etc/init.d/named restart Stopping named: .[ OK ] Starting named: [ OK ] [root@DDT named]# nslookup rac-cluster-scan.rac Server: 192.168.1.50 Address: 192.168.1.50#53
Name: rac-cluster-scan.rac Address: 192.168.1.203 Name: rac-cluster-scan.rac Address: 192.168.1.204 Name: rac-cluster-scan.rac Address: 192.168.1.201 Name: rac-cluster-scan.rac Address: 192.168.1.202
200.1.168.192.in-addr.arpa name = gns.rac.
[root@DDT named]# nslookup 192.168.1.200 Server: 192.168.1.50 Address: 192.168.1.50#53
200.1.168.192.in-addr.arpa name = gns.rac.
[root@DDT named]# nslookup 192.168.1.201 Server: 192.168.1.50 Address: 192.168.1.50#53
201.1.168.192.in-addr.arpa name = rac-cluster-scan.rac.
[root@DDT named]# nslookup 192.168.1.202 Server: 192.168.1.50 Address: 192.168.1.50#53
202.1.168.192.in-addr.arpa name = rac-cluster-scan.rac.
[root@DDT named]# nslookup 192.168.1.203 Server: 192.168.1.50 Address: 192.168.1.50#53
203.1.168.192.in-addr.arpa name = rac-cluster-scan.rac.
[root@DDT named]# nslookup 192.168.1.204 Server: 192.168.1.50 Address: 192.168.1.50#53
204.1.168.192.in-addr.arpa name = rac-cluster-scan.rac.
[root@DDT named]#
|
|
[root@DDT ~]# mount /dev/cdrom /mnt/ mount: block device /dev/cdrom is write-protected, mounting read-only [root@DDT ~]# rpm -ihv /mnt/ClusterStorage/scsi-target-utils-1.0.8-0.el5.x86_64.rpm warning: /mnt/ClusterStorage/scsi-target-utils-1.0.8-0.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 error: Failed dependencies: libibverbs.so.1()(64bit) is needed by scsi-target-utils-1.0.8-0.el5.x86_64 librdmacm.so.1()(64bit) is needed by scsi-target-utils-1.0.8-0.el5.x86_64 perl(Config::General) is needed by scsi-target-utils-1.0.8-0.el5.x86_64 [root@DDT ~]# rpm -ihv /mnt/Server/libibverbs-1.1.3-2.el5.* warning: /mnt/Server/libibverbs-1.1.3-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 error: Failed dependencies: libibverbs-driver is needed by libibverbs-1.1.3-2.el5.i386 openib >= 1.0 is needed by libibverbs-1.1.3-2.el5.i386 libibverbs-driver is needed by libibverbs-1.1.3-2.el5.x86_64 openib >= 1.0 is needed by libibverbs-1.1.3-2.el5.x86_64 [root@DDT ~]# rpm -ihv /mnt/Server/openib-1.4.1-5.0.1.el5.noarch.rpm warning: /mnt/Server/openib-1.4.1-5.0.1.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:openib ########################################### [100%] [root@DDT ~]# rpm -ihv /mnt/Server/libibverbs- libibverbs-1.1.3-2.el5.i386.rpm libibverbs-devel-1.1.3-2.el5.i386.rpm libibverbs-static-1.1.3-2.el5.x86_64.rpm libibverbs-1.1.3-2.el5.x86_64.rpm libibverbs-devel-1.1.3-2.el5.x86_64.rpm libibverbs-utils-1.1.3-2.el5.x86_64.rpm [root@DDT ~]# find /mnt/ -name *libibverbs-driver* [root@DDT ~]# rpm -ihv /mnt/Server/libibverbs-1.1.3-2.el5.* warning: /mnt/Server/libibverbs-1.1.3-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 error: Failed dependencies: libibverbs-driver is needed by libibverbs-1.1.3-2.el5.i386 libibverbs-driver is needed by libibverbs-1.1.3-2.el5.x86_64 [root@DDT ~]# find /mnt/ -name *-driver* /mnt/Server/libdbi-drivers-0.8.1a-1.2.2.x86_64.rpm /mnt/Server/xorg-x11-drivers-7.1-4.2.el5.x86_64.rpm [root@DDT ~]# rpm -ihv /mnt/Server/librdmacm-1.0.10-1.el5.* warning: /mnt/Server/librdmacm-1.0.10-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 error: Failed dependencies: libibverbs.so.1 is needed by librdmacm-1.0.10-1.el5.i386 libibverbs.so.1(IBVERBS_1.0) is needed by librdmacm-1.0.10-1.el5.i386 libibverbs.so.1(IBVERBS_1.1) is needed by librdmacm-1.0.10-1.el5.i386 libibverbs.so.1()(64bit) is needed by librdmacm-1.0.10-1.el5.x86_64 libibverbs.so.1(IBVERBS_1.0)(64bit) is needed by librdmacm-1.0.10-1.el5.x86_64 libibverbs.so.1(IBVERBS_1.1)(64bit) is needed by librdmacm-1.0.10-1.el5.x86_64 [root@DDT ~]#
|
太多依赖关系了.而且还找不到libibverbs-driver.
配置yum1安装vsftp包与createrepo包
2把系统安装光盘里的文件全部copy到/var/ftp/pub/EL5U6下
3在EL5U6目录下运行 #createrepo ./
4# vi /etc/yum.repos.d/rhel-debuginfo.repo
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=ftp://127.0.0.1/pub/EL5U6
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
注意ftp文件夹的权限问题(root权限) ftp是否已经起动
yum安装iscsi|
[root@DDT ftp]# /etc/init.d/vsftpd restart Shutting down vsftpd: [FAILED] Starting vsftpd for vsftpd: [ OK ] [root@DDT ftp]# yum search target Loaded plugins: rhnplugin, security This system is not registered with ULN. ULN support will be disabled. rhel-debuginfo | 951 B 00:00 rhel-debuginfo/primary | 1.4 MB 00:00 rhel-debuginfo 3321/3321 =============================================================== Matched: target ================================================================ dejagnu.noarch : A front end for testing other programs. nmap.x86_64 : Network exploration tool and security scanner kdevelop.x86_64 : Integrated Development Environment for C++/C cairo.i386 : A vector graphics library cairo.x86_64 : A vector graphics library cryptsetup-luks.i386 : A utility for setting up encrypted filesystems cryptsetup-luks.x86_64 : A utility for setting up encrypted filesystems iputils.x86_64 : Network monitoring tools including ping. log4j.x86_64 : Java logging package qcairo.i386 : A 2D graphics library qcairo.x86_64 : A 2D graphics library scsi-target-utils.x86_64 : The SCSI target daemon and utility programs selinux-policy-targeted.noarch : SELinux targeted base policy [root@DDT ftp]#
[root@DDT ftp]# yum install scsi-target-utils Loaded plugins: rhnplugin, security This system is not registered with ULN. ULN support will be disabled. rhel-debuginfo | 951 B 00:00 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package scsi-target-utils.x86_64 0:1.0.8-0.el5 set to be updated --> Processing Dependency: perl(Config::General) for package: scsi-target-utils --> Processing Dependency: libibverbs.so.1()(64bit) for package: scsi-target-utils --> Processing Dependency: librdmacm.so.1()(64bit) for package: scsi-target-utils --> Running transaction check ---> Package libibverbs.x86_64 0:1.1.3-2.el5 set to be updated --> Processing Dependency: libibverbs-driver for package: libibverbs ---> Package librdmacm.x86_64 0:1.0.10-1.el5 set to be updated ---> Package perl-Config-General.noarch 0:2.40-1.el5 set to be updated --> Running transaction check ---> Package libnes.x86_64 0:0.9.0-2.el5 set to be updated --> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================================ Package Arch Version Repository Size ================================================================================================================================================ Installing: scsi-target-utils x86_64 1.0.8-0.el5 rhel-debuginfo 151 k Installing for dependencies: libibverbs x86_64 1.1.3-2.el5 rhel-debuginfo 45 k libnes x86_64 0.9.0-2.el5 rhel-debuginfo 13 k librdmacm x86_64 1.0.10-1.el5 rhel-debuginfo 22 k perl-Config-General noarch 2.40-1.el5 rhel-debuginfo 68 k
Transaction Summary ================================================================================================================================================ Install 5 Package(s) Upgrade 0 Package(s)
Total size: 300 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : perl-Config-General 1/5 Installing : libibverbs 2/5
Installing : librdmacm 3/5 Installing : libnes 4/5 Installing : scsi-target-utils 5/5
Installed: scsi-target-utils.x86_64 0:1.0.8-0.el5
Dependency Installed: libibverbs.x86_64 0:1.1.3-2.el5 libnes.x86_64 0:0.9.0-2.el5 librdmacm.x86_64 0:1.0.10-1.el5 perl-Config-General.noarch 0:2.40-1.el5
Complete! [root@DDT ftp]#
[root@DDT ftp]# yum install iscsi-initiator-utils Loaded plugins: rhnplugin, security This system is not registered with ULN. ULN support will be disabled. Setting up Install Process Package iscsi-initiator-utils-6.2.0.872-6.0.2.el5.x86_64 already installed and latest version Nothing to do [root@DDT ftp]#
|
|
[root@DDT ftp]# cd ~ [root@DDT ~]# vi tgtdadm.sh
/etc/init.d/tgtd restart sleep 1 tgtadm --lld iscsi --op new --mode target --tid 1 --targetname storage tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --backing-store /dev/sdb tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 2 --backing-store /dev/sdc tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 3 --backing-store /dev/sdd tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 4 --backing-store /dev/sde tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 5 --backing-store /dev/sdf tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 6 --backing-store /dev/sdg tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL sleep 2 tgtadm --lld iscsi --op show --mode target | grep Target ~ "tgtdadm.sh" 10L, 692C written [root@DDT ~]# [root@DDT ~]# chmod +x tgtdadm.sh [root@DDT ~]# [root@DDT ~]# ./tgtdadm.sh Stopping SCSI target daemon: [ OK ] Starting SCSI target daemon: Starting target framework daemon
Target 1: storage [root@DDT ~]# |
|
[root@DDT ~]# tgtadm --lld iscsi --op show --mode target | grep Target Target 1: storage [root@DDT ~]#
|
|
[root@bogon ~]# vi /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=rac1 "/etc/sysconfig/network" 3L, 48C written [root@bogon ~]#reboot
|
|
[root@rac1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) DEVICE=eth0 #BOOTPROTO=dhcp ONBOOT=yes HWADDR=00:0c:29:d7:6f:53 IPADDR=192.168.1.11 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 "/etc/sysconfig/network-scripts/ifcfg-eth0" 8L, 191C written
[root@rac1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) DEVICE=eth1 #BOOTPROTO=dhcp ONBOOT=yes HWADDR=00:0c:29:d7:6f:5d IPADDR=192.168.2.11 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 "/etc/sysconfig/network-scripts/ifcfg-eth1" 8L, 191C written [root@rac1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth2
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) DEVICE=eth2 #BOOTPROTO=dhcp ONBOOT=yes HWADDR=00:0c:29:d7:6f:67 IPADDR=192.168.2.21 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 "/etc/sysconfig/network-scripts/ifcfg-eth2" 8L, 191C written [root@rac1 ~]# [root@rac1 ~]# /etc/init.d/network restart Shutting down interface eth0: [ OK ] Shutting down interface eth1: [ OK ] Shutting down interface eth2: [ OK ] Shutting down interface eth3: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] Bringing up interface eth1: [ OK ] Bringing up interface eth2: [ OK ] Bringing up interface eth3: Determining IP information for eth3... done. [ OK ] [root@rac1 ~]#
|
|
[root@rac1 ~]# vi /etc/hosts
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 rac1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.1.11 rac1 localhost 192.168.2.11 rac1-priv1 localhost 192.168.2.21 rac1-priv2 localhost
192.168.1.12 rac2 192.168.2.12 rac2-priv1 192.168.2.22 rac2-priv2 ~ "/etc/hosts" 11L, 331C written [root@rac1 ~]#
|
|
[root@rac1 ~]# vi iscsi.sh
/etc/init.d/iscsi restart iscsiadm -m discovery -t sendtargets -p 192.168.1.50 iscsiadm -m node -T storage -p 192.168.1.50 -l ~ "iscsi.sh" [New] 3L, 126C written [root@rac1 ~]# chmod +x iscsi.sh [root@rac1 ~]# ./iscsi.sh Stopping iSCSI daemon: iscsid is stopped [ OK ] iSCSI daemon: [ OK ] [ OK ] Setting up iSCSI targets: iscsiadm: No records found! [ OK ] 192.168.1.50:3260,1 storage Logging in to [iface: default, target: storage, portal: 192.168.1.50,3260] Login to [iface: default, target: storage, portal: 192.168.1.50,3260] successful. [root@rac1 ~]# fdisk -l
Disk /dev/sda: 85.8 GB, 85899345920 bytes 255 heads, 63 sectors/track, 10443 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 10443 83778975 8e Linux LVM
Disk /dev/dm-0: 79.4 GB, 79490449408 bytes 255 heads, 63 sectors/track, 9664 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 6274 MB, 6274678784 bytes 255 heads, 63 sectors/track, 762 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-1 doesn't contain a valid partition table
Disk /dev/sdb: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sdc doesn't contain a valid partition table
Disk /dev/sdd: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sde doesn't contain a valid partition table
Disk /dev/sdf: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sdf doesn't contain a valid partition table
Disk /dev/sdg: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sdg doesn't contain a valid partition table [root@rac1 ~]#
|
|
[root@rac1 ~]# vi /etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here. # # An example would be: # ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N" # to bind /dev/raw/raw1 to /dev/sda, or # ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m" # to bind /dev/raw/raw2 to the device with major 8, minor 1. ACTION=="add", KERNEL=="sdb", RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add", KERNEL=="sdc", RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add", KERNEL=="sdd", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="sde", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="sdf", RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add", KERNEL=="sdg", RUN+="/bin/raw /dev/raw/raw6 %N" ACTION=="add", KERNEL=="raw[1-2]", WNER="grid", GROUP="oinstall", MODE="660" ACTION=="add", KERNEL=="raw[3-6]", WNER="oracle", GROUP="oinstall", MODE="660" ~ "/etc/udev/rules.d/60-raw.rules" 15L, 852C written [root@rac1 ~]# start_udev Starting udev: [ OK ] [root@rac1 ~]# ls -l /dev/raw/ total 0 crw-rw---- 1 grid oinstall 162, 1 Dec 15 13:21 raw1 crw-rw---- 1 grid oinstall 162, 2 Dec 15 13:21 raw2 crw-rw---- 1 oracle oinstall 162, 3 Dec 15 13:21 raw3 crw-rw---- 1 oracle oinstall 162, 4 Dec 15 13:21 raw4 crw-rw---- 1 oracle oinstall 162, 5 Dec 15 13:21 raw5 crw-rw---- 1 oracle oinstall 162, 6 Dec 15 13:21 raw6 [root@rac1 ~]#
|
|
[root@rac1 ~]# echo "nameserver 192.168.1.50" > /etc/resolv.conf [root@rac1 ~]# nslookup rac-cluster-scan.rac Server: 192.168.1.50 Address: 192.168.1.50#53
Name: rac-cluster-scan.rac Address: 192.168.1.202 Name: rac-cluster-scan.rac Address: 192.168.1.203 Name: rac-cluster-scan.rac Address: 192.168.1.204 Name: rac-cluster-scan.rac Address: 192.168.1.201
[root@rac1 ~]#
|
|
[root@rac1 ~]# vi /etc/sysctl.conf
# Kernel sysctl configuration file for Oracle Enterprise Linux # # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and # sysctl.conf(5) for more details.
# Controls IP packet forwarding net.ipv4.ip_forward = 0
# Controls source route verification # See /usr/share/doc/kernel-doc-*/Documentation/networking/ip-sysctl.txt net.ipv4.conf.default.rp_filter = 2
# Do not accept source routing net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel "/etc/sysctl.conf" 36L, 1079C kernel.core_uses_pid = 1
# Controls the use of TCP syncookies net.ipv4.tcp_syncookies = 1
# Controls the maximum size of a message, in bytes kernel.msgmnb = 65536
# Controls the default maxmimum size of a mesage queue kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages kernel.shmall = 4294967296
fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 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 = 1048586 "/etc/sysctl.conf" 48L, 1388C written You have new mail in /var/spool/mail/root [root@rac1 ~]# [root@rac1 ~]# sysctl -p net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 2 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 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 = 1048586 [root@rac1 ~]#
|
必须的安装包参考 http://docs.oracle.com/cd/E11882_01/install.112/e16766/toc.htm#CHDHFGBJ
|
[root@rac1 ~]# vi packages.txt
binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 elfutils-libelf-0.125 elfutils-libelf-devel-0.125 elfutils-libelf-devel-static-0.125 gcc-4.1.2 gcc-c++-4.1.2 glibc-2.5-24 glibc-common-2.5 glibc-devel-2.5 glibc-headers-2.5 kernel-headers-2.6.18 ksh-20060214 libaio-0.3.106 libaio-devel-0.3.106 libgcc-4.1.2 :%s/\-[0-9].*$//
[root@rac1 ~]# while read L ; do echo
"search $L:" ;rpm -qa | grep $L;done search binutils: binutils-2.17.50.0.6-14.el5 search compat-libstdc++: compat-libstdc++-33-3.2.3-61 compat-libstdc++-33-3.2.3-61 compat-libstdc++-296-2.96-138 search elfutils-libelf: elfutils-libelf-devel-static-0.137-3.el5 elfutils-libelf-0.137-3.el5 elfutils-libelf-devel-static-0.137-3.el5 elfutils-libelf-0.137-3.el5 elfutils-libelf-devel-0.137-3.el5 elfutils-libelf-devel-0.137-3.el5 search elfutils-libelf-devel: elfutils-libelf-devel-static-0.137-3.el5 elfutils-libelf-devel-static-0.137-3.el5 elfutils-libelf-devel-0.137-3.el5 elfutils-libelf-devel-0.137-3.el5 search elfutils-libelf-devel-static: elfutils-libelf-devel-static-0.137-3.el5 elfutils-libelf-devel-static-0.137-3.el5 search gcc: gcc-c++-4.1.2-50.el5 libgcc-4.1.2-50.el5 compat-libgcc-296-2.96-138 libgcc-4.1.2-50.el5 gcc-gfortran-4.1.2-50.el5 gcc-4.1.2-50.el5 search gcc-c++: gcc-c++-4.1.2-50.el5 search glibc: glibc-2.5-58 glibc-2.5-58 glibc-common-2.5-58 glibc-headers-2.5-58 glibc-devel-2.5-58 glibc-devel-2.5-58 search glibc-common: glibc-common-2.5-58 search glibc-devel: glibc-devel-2.5-58 glibc-devel-2.5-58 search glibc-headers: glibc-headers-2.5-58 search kernel-headers: search ksh: ksh-20100202-1.el5_5.1 search libaio: libaio-0.3.106-5 libaio-0.3.106-5 search libaio-devel: search libgcc: libgcc-4.1.2-50.el5 compat-libgcc-296-2.96-138 libgcc-4.1.2-50.el5 search libgomp: libgomp-4.4.4-13.el5 libgomp-4.4.4-13.el5 search libstdc++: libstdc++-4.1.2-50.el5 libstdc++-devel-4.1.2-50.el5 compat-libstdc++-33-3.2.3-61 compat-libstdc++-33-3.2.3-61 libstdc++-4.1.2-50.el5 compat-libstdc++-296-2.96-138 search libstdc++-devel: libstdc++-devel-4.1.2-50.el5 search make: automake16-1.6.3-8.el5.1 automake-1.9.6-2.3.el5 make-3.81-3.el5 automake15-1.5-16.el5.2 automake17-1.7.9-7.el5.2 imake-1.0.2-3 automake14-1.4p6-13.el5.1 search sysstat: [root@rac1 ~]#
|
安装
|
[root@rac1 src]# vi /etc/yum.repos.d/rhel-debuginfo.repo
[rhel-debuginfo] name=Red Hat Enterprise Linux $releasever - $basearch - Debug baseurl=ftp://192.168.1.50/pub/EL5U6 enabled=1 gpgcheck=0 #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release "/etc/yum.repos.d/rhel-debuginfo.repo" [New] 6L, 196C written [root@rac1 src]# [root@rac1 ~]# yum install libaio-devel sysstat Loaded plugins: rhnplugin, security This system is not registered with ULN. ULN support will be disabled. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package libaio-devel.i386 0:0.3.106-5 set to be updated ---> Package libaio-devel.x86_64 0:0.3.106-5 set to be updated ---> Package sysstat.x86_64 0:7.0.2-3.el5_5.1 set to be updated --> Finished Dependency Resolution
Dependencies Resolved
===================================================================================== Package Arch Version Repository Size ===================================================================================== Installing: libaio-devel i386 0.3.106-5 rhel-debuginfo 12 k libaio-devel x86_64 0.3.106-5 rhel-debuginfo 11 k sysstat x86_64 7.0.2-3.el5_5.1 rhel-debuginfo 175 k
Transaction Summary ===================================================================================== Install 3 Package(s) Upgrade 0 Package(s)
Total download size: 198 k Is this ok [y/N]: y Downloading Packages: (1/3): libaio-devel-0.3.106-5.x86_64.rpm | 11 kB 00:00 (2/3): libaio-devel-0.3.106-5.i386.rpm | 12 kB 00:00 (3/3): sysstat-7.0.2-3.el5_5.1.x86_64.rpm | 175 kB 00:00 ------------------------------------------------------------------------------------- Total 400 kB/s | 198 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : sysstat 1/3 Installing : libaio-devel 2/3 Installing : libaio-devel 3/3
Installed: libaio-devel.i386 0:0.3.106-5 libaio-devel.x86_64 0:0.3.106-5 sysstat.x86_64 0:7.0.2-3.el5_5.1
Complete! [root@rac1 ~]#
|
|
[root@rac1 ~]# vi group_user_add.sh
groupadd -g 1000 oinstall groupadd -g 1100 asmadmin groupadd -g 1200 dba groupadd -g 1201 oper groupadd -g 1300 asmdba groupadd -g 1301 asmoper useradd -u 1100 -g oinstall -G dba,asmadmin,asmdba,asmoper -c "Grid Infrastructure Owner" grid useradd -u 1101 -g oinstall -G asmdba,dba,oper -c "Oracle Software Owner" oracle ~ "group_user_add.sh" 8L, 320C written [root@rac1 ~]# chmod +x ./group_user_add.sh [root@rac1 ~]# !$ ./group_user_add.sh [root@rac1 ~]# passwd grid Changing password for user grid. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@rac1 ~]# 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@rac1 ~]#
|
|
[root@rac1 ~]# vi mkdir.sh
mkdir -p /u01/app/grid mkdir -p /u01/app/11.2.0/grid chown -R grid:oinstall /u01 mkdir -p /u01/app/oracle chown oracle:oinstall /u01/app/oracle chmod -R 775 /u01 "mkdir.sh" 6L, 162C written [root@rac1 ~]#
|
配置grid用户
|
[root@rac1 ~]# su - grid [grid@rac1 ~]$ cat ~/.bash_profile # .bash_profile
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
# --------------------------------------------------- # .bash_profile # --------------------------------------------------- # OS User: grid # Application: Oracle Grid Infrastructure # Version: Oracle 11g release 2 # ---------------------------------------------------
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
alias ls="ls -FA"
# --------------------------------------------------- # ORACLE_SID # --------------------------------------------------- # Specifies the Oracle system identifier (SID) # for the Automatic Storage Management (ASM)instance # running on this node. #
#Each RAC node must have a unique ORACLE_SID. #
#(i.e. +ASM1, +ASM2,...) # --------------------------------------------------- ORACLE_SID=+ASM1; export ORACLE_SID
# --------------------------------------------------- # JAVA_HOME # --------------------------------------------------- # Specifies the directory of the Java SDK and Runtime # Environment. # --------------------------------------------------- JAVA_HOME=/usr/local/java; export JAVA_HOME
# --------------------------------------------------- # ORACLE_BASE # --------------------------------------------------- # Specifies the base of the Oracle directory structure # for Optimal Flexible Architecture (OFA) compliant # installations. The Oracle base directory for the # grid installation owner is the location where # diagnostic and administrative logs, and other logs # associated with Oracle ASM and Oracle Clusterware # are stored. # --------------------------------------------------- ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
# --------------------------------------------------- # ORACLE_HOME # --------------------------------------------------- # Specifies the directory containing the Oracle # Grid Infrastructure software. For grid # infrastructure for a cluster installations, the Grid # home must not be placed under one of the Oracle base # directories, or under Oracle home directories of # Oracle Database installation owners, or in the home # directory of an installation owner. During # installation, ownership of the path to the Grid # home is changed to root. This change causes # permission errors for other installations. # --------------------------------------------------- ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
# --------------------------------------------------- # ORACLE_PATH # --------------------------------------------------- # Specifies the search path for files used by Oracle # applications such as SQL*Plus. If the full path to # the file is not specified, or if the file is not # in the current directory, the Oracle application # uses ORACLE_PATH to locate the file. # This variable is used by SQL*Plus, Forms and Menu. # --------------------------------------------------- ORACLE_PATH=/u01/app/oracle/common/oracle/sql; export ORACLE_PATH
# --------------------------------------------------- # SQLPATH # --------------------------------------------------- # Specifies the directory or list of directories that # SQL*Plus searches for a login.sql file. # --------------------------------------------------- # SQLPATH=/u01/app/common/oracle/sql; export SQLPATH
# --------------------------------------------------- # ORACLE_TERM # --------------------------------------------------- # Defines a terminal definition. If not set, it # defaults to the value of your TERM environment # variable. Used by all character mode products. # --------------------------------------------------- ORACLE_TERM=xterm; export ORACLE_TERM
# --------------------------------------------------- # NLS_DATE_FORMAT # --------------------------------------------------- # Specifies the default date format to use with the # TO_CHAR and TO_DATE functions. The default value of # this parameter is determined by NLS_TERRITORY. The # value of this parameter can be any valid date # format mask, and the value must be surrounded by # double quotation marks. For example: # # NLS_DATE_FORMAT = "MM/DD/YYYY" # # --------------------------------------------------- NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
# --------------------------------------------------- # TNS_ADMIN # --------------------------------------------------- # Specifies the directory containing the Oracle Net # Services configuration files like listener.ora, # tnsnames.ora, and sqlnet.ora. # --------------------------------------------------- TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
# --------------------------------------------------- # ORA_NLS11 # --------------------------------------------------- # Specifies the directory where the language, # territory, character set, and linguistic definition # files are stored. # --------------------------------------------------- ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
# --------------------------------------------------- # PATH # --------------------------------------------------- # Used by the shell to locate executable programs; # must include the $ORACLE_HOME/bin directory. # --------------------------------------------------- PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin PATH=${PATH}:/u01/app/common/oracle/bin export PATH
# --------------------------------------------------- # LD_LIBRARY_PATH # --------------------------------------------------- # Specifies the list of directories that the shared # library loader searches to locate shared object # libraries at runtime. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the directory or list of directories that # contain compiled Java classes. # --------------------------------------------------- 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 # --------------------------------------------------- # All the tools in the JDK use green threads as a # default. To specify that native threads should be # used, set the THREADS_FLAG environment variable to # "native". You can revert to the use of green # threads by setting THREADS_FLAG to the value # "green". # --------------------------------------------------- THREADS_FLAG=native; export THREADS_FLAG
# --------------------------------------------------- # TEMP, TMP, and TMPDIR # --------------------------------------------------- # Specify the default directories for temporary # files; if set, tools that create temporary files # create them in one of these directories. # --------------------------------------------------- export TEMP=/tmp export TMPDIR=/tmp
# --------------------------------------------------- # UMASK # --------------------------------------------------- # Set the default file mode creation mask # (umask) to 022 to ensure that the user performing # the Oracle software installation creates files # with 644 permissions. # --------------------------------------------------- umask 022 [grid@rac1 ~]$ [grid@rac1 ~]$ . ~/.bash_profile
|
配置oracle用户
|
[root@rac1 ~]# su - oracle [oracle@rac1 ~]$ cat ~/.bash_profile # .bash_profile
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH # --------------------------------------------------- # .bash_profile # --------------------------------------------------- # OS User: oracle # Application: Oracle Database Software Owner # Version: Oracle 11g release 2 # ---------------------------------------------------
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
alias ls="ls -FA"
# --------------------------------------------------- # ORACLE_SID # --------------------------------------------------- # Specifies the Oracle system identifier (SID) for # the Oracle instance running on this node. #
#Each RAC node must have a unique ORACLE_SID. #
#(i.e. racdb1, racdb2,...) # --------------------------------------------------- ORACLE_SID=PROD1; export ORACLE_SID
# --------------------------------------------------- # ORACLE_UNQNAME # --------------------------------------------------- # In previous releases of Oracle Database, you were # required to set environment variables for # ORACLE_HOME and ORACLE_SID to start, stop, and # check the status of Enterprise Manager. With # Oracle Database 11g release 2 (11.2) and later, you # need to set the environment variables ORACLE_HOME # and ORACLE_UNQNAME to use Enterprise Manager. # Set ORACLE_UNQNAME equal to the database unique # name. # --------------------------------------------------- ORACLE_UNQNAME=PROD; export ORACLE_UNQNAME
# --------------------------------------------------- # JAVA_HOME # --------------------------------------------------- # Specifies the directory of the Java SDK and Runtime # Environment. # --------------------------------------------------- JAVA_HOME=/usr/local/java; export JAVA_HOME
# --------------------------------------------------- # ORACLE_BASE # --------------------------------------------------- # Specifies the base of the Oracle directory structure # for Optimal Flexible Architecture (OFA) compliant # database software installations. # --------------------------------------------------- ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
# --------------------------------------------------- # ORACLE_HOME # --------------------------------------------------- # Specifies the directory containing the Oracle # Database software. # --------------------------------------------------- ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
# --------------------------------------------------- # ORACLE_PATH # --------------------------------------------------- # Specifies the search path for files used by Oracle # applications such as SQL*Plus. If the full path to # the file is not specified, or if the file is not # in the current directory, the Oracle application # uses ORACLE_PATH to locate the file. # This variable is used by SQL*Plus, Forms and Menu. # --------------------------------------------------- ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH
# --------------------------------------------------- # SQLPATH # --------------------------------------------------- # Specifies the directory or list of directories that # SQL*Plus searches for a login.sql file. # --------------------------------------------------- # SQLPATH=/u01/app/common/oracle/sql; export SQLPATH
# --------------------------------------------------- # ORACLE_TERM # --------------------------------------------------- # Defines a terminal definition. If not set, it # defaults to the value of your TERM environment # variable. Used by all character mode products. # --------------------------------------------------- ORACLE_TERM=xterm; export ORACLE_TERM
# --------------------------------------------------- # NLS_DATE_FORMAT # --------------------------------------------------- # Specifies the default date format to use with the # TO_CHAR and TO_DATE functions. The default value of # this parameter is determined by NLS_TERRITORY. The # value of this parameter can be any valid date # format mask, and the value must be surrounded by # double quotation marks. For example: # # NLS_DATE_FORMAT = "MM/DD/YYYY" # # --------------------------------------------------- NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
# --------------------------------------------------- # TNS_ADMIN # --------------------------------------------------- # Specifies the directory containing the Oracle Net # Services configuration files like listener.ora, # tnsnames.ora, and sqlnet.ora. # --------------------------------------------------- TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
# --------------------------------------------------- # ORA_NLS11 # --------------------------------------------------- # Specifies the directory where the language, # territory, character set, and linguistic definition # files are stored. # --------------------------------------------------- ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
# --------------------------------------------------- # PATH # --------------------------------------------------- # Used by the shell to locate executable programs; # must include the $ORACLE_HOME/bin directory. # --------------------------------------------------- PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin PATH=${PATH}:/u01/app/common/oracle/bin export PATH
# --------------------------------------------------- # LD_LIBRARY_PATH # --------------------------------------------------- # Specifies the list of directories that the shared # library loader searches to locate shared object # libraries at runtime. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the directory or list of directories that # contain compiled Java classes. # --------------------------------------------------- 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 # --------------------------------------------------- # All the tools in the JDK use green threads as a # default. To specify that native threads should be # used, set the THREADS_FLAG environment variable to # "native". You can revert to the use of green # threads by setting THREADS_FLAG to the value # "green". # --------------------------------------------------- THREADS_FLAG=native; export THREADS_FLAG
# --------------------------------------------------- # TEMP, TMP, and TMPDIR # --------------------------------------------------- # Specify the default directories for temporary # files; if set, tools that create temporary files # create them in one of these directories. # --------------------------------------------------- export TEMP=/tmp export TMPDIR=/tmp
# --------------------------------------------------- # UMASK # --------------------------------------------------- # Set the default file mode creation mask # (umask) to 022 to ensure that the user performing # the Oracle software installation creates files # with 644 permissions. # --------------------------------------------------- umask 022 [oracle@rac1 ~]$ [oracle@rac1 ~]$ . ~/.bash_profile
|
|
[root@bogon ~]# vi /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=rac2 "/etc/sysconfig/network" 3L, 48C written [root@bogon ~]# reboot
|
|
[root@rac2 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) DEVICE=eth0 #BOOTPROTO=dhcp ONBOOT=yes HWADDR=00:0c:29:9e:3b:2f IPADDR=192.168.1.12 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 ~ "/etc/sysconfig/network-scripts/ifcfg-eth0" 8L, 191C written [root@rac2 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) DEVICE=eth1 #BOOTPROTO=dhcp ONBOOT=yes HWADDR=00:0c:29:9e:3b:39 IPADDR=192.168.2.12 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 ~ "/etc/sysconfig/network-scripts/ifcfg-eth1" 8L, 191C written [root@rac2 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth2
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) DEVICE=eth2 #BOOTPROTO=dhcp ONBOOT=yes HWADDR=00:0c:29:9e:3b:43 IPADDR=192.168.2.22 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 ~ "/etc/sysconfig/network-scripts/ifcfg-eth2" 8L, 191C written [root@rac2 ~]# /etc/init.d/network restart Shutting down interface eth0: [ OK ] Shutting down interface eth1: [ OK ] Shutting down interface eth2: [ OK ] Shutting down interface eth3: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] Bringing up interface eth1: [ OK ] Bringing up interface eth2: [ OK ] Bringing up interface eth3: Determining IP information for eth3... done. [ OK ] [root@rac2 ~]#
|
|
[root@rac2 ~]# vi /etc/hosts
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 rac2 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.1.12 rac2 localhost 192.168.2.12 rac2-priv1 localhost 192.168.2.22 rac2-priv2 localhost
192.168.1.11 rac1 192.168.2.11 rac1-priv1 192.168.2.21 rac1-priv2 ~ "/etc/hosts" 12L, 350C written [root@rac2 ~]#
|
|
[root@rac2 ~]# vi iscsi.sh
/etc/init.d/iscsi restart iscsiadm -m discovery -t sendtargets -p 192.168.1.50 iscsiadm -m node -T storage -p 192.168.1.50 -l ~ "iscsi.sh" [New] 3L, 126C written You have new mail in /var/spool/mail/root [root@rac2 ~]# chmod +x iscsi.sh [root@rac2 ~]# ./iscsi.sh Stopping iSCSI daemon: iscsid is stopped [ OK ] iSCSI daemon: [ OK ] [ OK ] Setting up iSCSI targets: iscsiadm: No records found! [ OK ] 192.168.1.50:3260,1 storage Logging in to [iface: default, target: storage, portal: 192.168.1.50,3260] Login to [iface: default, target: storage, portal: 192.168.1.50,3260] successful. [root@rac2 ~]# fdisk -l
Disk /dev/sda: 85.8 GB, 85899345920 bytes 255 heads, 63 sectors/track, 10443 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 10443 83778975 8e Linux LVM
Disk /dev/dm-0: 79.4 GB, 79490449408 bytes 255 heads, 63 sectors/track, 9664 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 6274 MB, 6274678784 bytes 255 heads, 63 sectors/track, 762 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-1 doesn't contain a valid partition table
Disk /dev/sdb: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sdc doesn't contain a valid partition table
Disk /dev/sdd: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sde doesn't contain a valid partition table
Disk /dev/sdf: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sdf doesn't contain a valid partition table
Disk /dev/sdg: 5368 MB, 5368709120 bytes 166 heads, 62 sectors/track, 1018 cylinders Units = cylinders of 10292 * 512 = 5269504 bytes
Disk /dev/sdg doesn't contain a valid partition table [root@rac2 ~]#
|
|
[root@rac2 ~]# vi /etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here. # # An example would be: # ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N" # to bind /dev/raw/raw1 to /dev/sda, or # ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m" # to bind /dev/raw/raw2 to the device with major 8, minor 1. ACTION=="add", KERNEL=="sdb", RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add", KERNEL=="sdc", RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add", KERNEL=="sdd", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="sde", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="sdf", RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add", KERNEL=="sdg", RUN+="/bin/raw /dev/raw/raw6 %N" ACTION=="add", KERNEL=="raw[1-2]", WNER="grid", GROUP="oinstall", MODE="660" ACTION=="add", KERNEL=="raw[3-6]", WNER="oracle", GROUP="oinstall", MODE="660" ~ "/etc/udev/rules.d/60-raw.rules" 16L, 853C written [root@rac2 ~]# start_udev Starting udev: [ OK ] [root@rac2 ~]# ls -l /dev/raw total 0 crw-rw---- 1 grid oinstall 162, 1 Dec 15 13:24 raw1 crw-rw---- 1 grid oinstall 162, 2 Dec 15 13:24 raw2 crw-rw---- 1 oracle oinstall 162, 3 Dec 15 13:24 raw3 crw-rw---- 1 oracle oinstall 162, 4 Dec 15 13:24 raw4 crw-rw---- 1 oracle oinstall 162, 5 Dec 15 13:24 raw5 crw-rw---- 1 oracle oinstall 162, 6 Dec 15 13:24 raw6 [root@rac2 ~]#
|
|
[root@rac2 ~]# echo "nameserver 192.168.1.50" > /etc/resolv.conf [root@rac2 ~]# nslookup rac-cluster-scan.rac Server: 192.168.1.50 Address: 192.168.1.50#53
Name: rac-cluster-scan.rac Address: 192.168.1.201 Name: rac-cluster-scan.rac Address: 192.168.1.202 Name: rac-cluster-scan.rac Address: 192.168.1.203 Name: rac-cluster-scan.rac Address: 192.168.1.204
[root@rac2 ~]#
|
|
[root@rac2 ~]# vi /etc/sysctl.conf
# Kernel sysctl configuration file for Oracle Enterprise Linux # # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and # sysctl.conf(5) for more details.
# Controls IP packet forwarding net.ipv4.ip_forward = 0
# Controls source route verification # See /usr/share/doc/kernel-doc-*/Documentation/networking/ip-sysctl.txt net.ipv4.conf.default.rp_filter = 2
# Do not accept source routing net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel "/etc/sysctl.conf" 36L, 1079C kernel.core_uses_pid = 1
# Controls the use of TCP syncookies net.ipv4.tcp_syncookies = 1
# Controls the maximum size of a message, in bytes kernel.msgmnb = 65536
# Controls the default maxmimum size of a mesage queue kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages kernel.shmall = 4294967296
fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 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 = 1048586 "/etc/sysctl.conf" 48L, 1388C written You have new mail in /var/spool/mail/root [root@rac2 ~]# [root@rac2 ~]# sysctl -p net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 2 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 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 = 1048586 [root@rac2 ~]#
|
|
[root@rac2 ~]# vi /etc/yum.repos.d/rhel-debuginfo.repo
[rhel-debuginfo] name=Red Hat Enterprise Linux $releasever - $basearch - Debug baseurl=ftp://192.168.1.50/pub/EL5U6 enabled=1 gpgcheck=0 #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release "/etc/yum.repos.d/rhel-debuginfo.repo" [New] 6L, 196C written [root@rac2 ~]# [root@rac2 ~]# yum install kernel-headers libaio-devel sysstat Loaded plugins: rhnplugin, security This system is not registered with ULN. ULN support will be disabled. Setting up Install Process Package kernel-headers is obsoleted by kernel-uek-headers, trying to install kernel-uek-headers-2.6.32-100.26.2.el5.x86_64 instead Package kernel-uek-headers-2.6.32-100.26.2.el5.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package libaio-devel.i386 0:0.3.106-5 set to be updated ---> Package libaio-devel.x86_64 0:0.3.106-5 set to be updated ---> Package sysstat.x86_64 0:7.0.2-3.el5_5.1 set to be updated --> Finished Dependency Resolution
Dependencies Resolved
===================================================================================== Package Arch Version Repository Size ===================================================================================== Installing: libaio-devel i386 0.3.106-5 rhel-debuginfo 12 k libaio-devel x86_64 0.3.106-5 rhel-debuginfo 11 k sysstat x86_64 7.0.2-3.el5_5.1 rhel-debuginfo 175 k
Transaction Summary ===================================================================================== Install 3 Package(s) Upgrade 0 Package(s)
Total download size: 198 k Is this ok [y/N]: y Downloading Packages: (1/3): libaio-devel-0.3.106-5.x86_64.rpm | 11 kB 00:00 (2/3): libaio-devel-0.3.106-5.i386.rpm | 12 kB 00:00 (3/3): sysstat-7.0.2-3.el5_5.1.x86_64.rpm | 175 kB 00:00 ------------------------------------------------------------------------------------- Total 875 kB/s | 198 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : sysstat 1/3 Installing : libaio-devel 2/3 Installing : libaio-devel 3/3
Installed: libaio-devel.i386 0:0.3.106-5 libaio-devel.x86_64 0:0.3.106-5 sysstat.x86_64 0:7.0.2-3.el5_5.1
Complete! [root@rac2 ~]#
|
|
[root@rac2 ~]# vi group_user_add.sh
groupadd -g 1000 oinstall groupadd -g 1100 asmadmin groupadd -g 1200 dba groupadd -g 1201 oper groupadd -g 1300 asmdba groupadd -g 1301 asmoper useradd -u 1100 -g oinstall -G dba,asmadmin,asmdba,asmoper -c "Grid Infrastructure Owner" grid useradd -u 1101 -g oinstall -G asmdba,dba,oper -c "Oracle Software Owner" oracle "group_user_add.sh" 9L, 321C written [root@rac2 ~]# chmod +x ./group_user_add.sh [root@rac2 ~]# ./group_user_add.sh [root@rac2 ~]# passwd grid Changing password for user grid. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@rac2 ~]# 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@rac2 ~]#
|
|
[root@rac2 ~]# vi mkdir.sh
mkdir -p /u01/app/grid mkdir -p /u01/app/11.2.0/grid chown -R grid:oinstall /u01 mkdir -p /u01/app/oracle chown oracle:oinstall /u01/app/oracle chmod -R 775 /u01 ~ "mkdir.sh" [New] 6L, 162C written [root@rac2 ~]# chmod +x mkdir.sh [root@rac2 ~]# ./mkdir.sh
|
配置grid用户
|
[root@rac2 ~]# su - grid [grid@rac2 ~]$ cat ~/.bash_profile # .bash_profile
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
# --------------------------------------------------- # .bash_profile # --------------------------------------------------- # OS User: grid # Application: Oracle Grid Infrastructure # Version: Oracle 11g release 2 # ---------------------------------------------------
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
alias ls="ls -FA"
# --------------------------------------------------- # ORACLE_SID # --------------------------------------------------- # Specifies the Oracle system identifier (SID) # for the Automatic Storage Management (ASM)instance # running on this node. #
#Each RAC node must have a unique ORACLE_SID. #
#(i.e. +ASM1, +ASM2,...) # --------------------------------------------------- ORACLE_SID=+ASM2; export ORACLE_SID
# --------------------------------------------------- # JAVA_HOME # --------------------------------------------------- # Specifies the directory of the Java SDK and Runtime # Environment. # --------------------------------------------------- JAVA_HOME=/usr/local/java; export JAVA_HOME
# --------------------------------------------------- # ORACLE_BASE # --------------------------------------------------- # Specifies the base of the Oracle directory structure # for Optimal Flexible Architecture (OFA) compliant # installations. The Oracle base directory for the # grid installation owner is the location where # diagnostic and administrative logs, and other logs # associated with Oracle ASM and Oracle Clusterware # are stored. # --------------------------------------------------- ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
# --------------------------------------------------- # ORACLE_HOME # --------------------------------------------------- # Specifies the directory containing the Oracle # Grid Infrastructure software. For grid # infrastructure for a cluster installations, the Grid # home must not be placed under one of the Oracle base # directories, or under Oracle home directories of # Oracle Database installation owners, or in the home # directory of an installation owner. During # installation, ownership of the path to the Grid # home is changed to root. This change causes # permission errors for other installations. # --------------------------------------------------- ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
# --------------------------------------------------- # ORACLE_PATH # --------------------------------------------------- # Specifies the search path for files used by Oracle # applications such as SQL*Plus. If the full path to # the file is not specified, or if the file is not # in the current directory, the Oracle application # uses ORACLE_PATH to locate the file. # This variable is used by SQL*Plus, Forms and Menu. # --------------------------------------------------- ORACLE_PATH=/u01/app/oracle/common/oracle/sql; export ORACLE_PATH
# --------------------------------------------------- # SQLPATH # --------------------------------------------------- # Specifies the directory or list of directories that # SQL*Plus searches for a login.sql file. # --------------------------------------------------- # SQLPATH=/u01/app/common/oracle/sql; export SQLPATH
# --------------------------------------------------- # ORACLE_TERM # --------------------------------------------------- # Defines a terminal definition. If not set, it # defaults to the value of your TERM environment # variable. Used by all character mode products. # --------------------------------------------------- ORACLE_TERM=xterm; export ORACLE_TERM
# --------------------------------------------------- # NLS_DATE_FORMAT # --------------------------------------------------- # Specifies the default date format to use with the # TO_CHAR and TO_DATE functions. The default value of # this parameter is determined by NLS_TERRITORY. The # value of this parameter can be any valid date # format mask, and the value must be surrounded by # double quotation marks. For example: # # NLS_DATE_FORMAT = "MM/DD/YYYY" # # --------------------------------------------------- NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
# --------------------------------------------------- # TNS_ADMIN # --------------------------------------------------- # Specifies the directory containing the Oracle Net # Services configuration files like listener.ora, # tnsnames.ora, and sqlnet.ora. # --------------------------------------------------- TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
# --------------------------------------------------- # ORA_NLS11 # --------------------------------------------------- # Specifies the directory where the language, # territory, character set, and linguistic definition # files are stored. # --------------------------------------------------- ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
# --------------------------------------------------- # PATH # --------------------------------------------------- # Used by the shell to locate executable programs; # must include the $ORACLE_HOME/bin directory. # --------------------------------------------------- PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin PATH=${PATH}:/u01/app/common/oracle/bin export PATH
# --------------------------------------------------- # LD_LIBRARY_PATH # --------------------------------------------------- # Specifies the list of directories that the shared # library loader searches to locate shared object # libraries at runtime. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the directory or list of directories that # contain compiled Java classes. # --------------------------------------------------- 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 # --------------------------------------------------- # All the tools in the JDK use green threads as a # default. To specify that native threads should be # used, set the THREADS_FLAG environment variable to # "native". You can revert to the use of green # threads by setting THREADS_FLAG to the value # "green". # --------------------------------------------------- THREADS_FLAG=native; export THREADS_FLAG
# --------------------------------------------------- # TEMP, TMP, and TMPDIR # --------------------------------------------------- # Specify the default directories for temporary # files; if set, tools that create temporary files # create them in one of these directories. # --------------------------------------------------- export TEMP=/tmp export TMPDIR=/tmp
# --------------------------------------------------- # UMASK # --------------------------------------------------- # Set the default file mode creation mask # (umask) to 022 to ensure that the user performing # the Oracle software installation creates files # with 644 permissions. # --------------------------------------------------- umask 022
[grid@rac2 ~]$ [grid@rac2 ~]$ . ~/.bash_profile
|
配置oracle用户
|
[oracle@rac2 ~]$ cat ~/.bash_profile # .bash_profile
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
# --------------------------------------------------- # .bash_profile # --------------------------------------------------- # OS User: oracle # Application: Oracle Database Software Owner # Version: Oracle 11g release 2 # ---------------------------------------------------
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
alias ls="ls -FA"
# --------------------------------------------------- # ORACLE_SID # --------------------------------------------------- # Specifies the Oracle system identifier (SID) for # the Oracle instance running on this node. #
#Each RAC node must have a unique ORACLE_SID. #
#(i.e. racdb1, racdb2,...) # --------------------------------------------------- ORACLE_SID=PROD2; export ORACLE_SID
# --------------------------------------------------- # ORACLE_UNQNAME # --------------------------------------------------- # In previous releases of Oracle Database, you were # required to set environment variables for # ORACLE_HOME and ORACLE_SID to start, stop, and # check the status of Enterprise Manager. With # Oracle Database 11g release 2 (11.2) and later, you # need to set the environment variables ORACLE_HOME # and ORACLE_UNQNAME to use Enterprise Manager. # Set ORACLE_UNQNAME equal to the database unique # name. # --------------------------------------------------- ORACLE_UNQNAME=PROD; export ORACLE_UNQNAME
# --------------------------------------------------- # JAVA_HOME # --------------------------------------------------- # Specifies the directory of the Java SDK and Runtime # Environment. # --------------------------------------------------- JAVA_HOME=/usr/local/java; export JAVA_HOME
# --------------------------------------------------- # ORACLE_BASE # --------------------------------------------------- # Specifies the base of the Oracle directory structure # for Optimal Flexible Architecture (OFA) compliant # database software installations. # --------------------------------------------------- ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
# --------------------------------------------------- # ORACLE_HOME # --------------------------------------------------- # Specifies the directory containing the Oracle # Database software. # --------------------------------------------------- ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
# --------------------------------------------------- # ORACLE_PATH # --------------------------------------------------- # Specifies the search path for files used by Oracle # applications such as SQL*Plus. If the full path to # the file is not specified, or if the file is not # in the current directory, the Oracle application # uses ORACLE_PATH to locate the file. # This variable is used by SQL*Plus, Forms and Menu. # --------------------------------------------------- ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH
# --------------------------------------------------- # SQLPATH # --------------------------------------------------- # Specifies the directory or list of directories that # SQL*Plus searches for a login.sql file. # --------------------------------------------------- # SQLPATH=/u01/app/common/oracle/sql; export SQLPATH
# --------------------------------------------------- # ORACLE_TERM # --------------------------------------------------- # Defines a terminal definition. If not set, it # defaults to the value of your TERM environment # variable. Used by all character mode products. # --------------------------------------------------- ORACLE_TERM=xterm; export ORACLE_TERM
# --------------------------------------------------- # NLS_DATE_FORMAT # --------------------------------------------------- # Specifies the default date format to use with the # TO_CHAR and TO_DATE functions. The default value of # this parameter is determined by NLS_TERRITORY. The # value of this parameter can be any valid date # format mask, and the value must be surrounded by # double quotation marks. For example: # # NLS_DATE_FORMAT = "MM/DD/YYYY" # # --------------------------------------------------- NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
# --------------------------------------------------- # TNS_ADMIN # --------------------------------------------------- # Specifies the directory containing the Oracle Net # Services configuration files like listener.ora, # tnsnames.ora, and sqlnet.ora. # --------------------------------------------------- TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
# --------------------------------------------------- # ORA_NLS11 # --------------------------------------------------- # Specifies the directory where the language, # territory, character set, and linguistic definition # files are stored. # --------------------------------------------------- ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
# --------------------------------------------------- # PATH # --------------------------------------------------- # Used by the shell to locate executable programs; # must include the $ORACLE_HOME/bin directory. # --------------------------------------------------- PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin PATH=${PATH}:/u01/app/common/oracle/bin export PATH
# --------------------------------------------------- # LD_LIBRARY_PATH # --------------------------------------------------- # Specifies the list of directories that the shared # library loader searches to locate shared object # libraries at runtime. # --------------------------------------------------- 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 # --------------------------------------------------- # Specifies the directory or list of directories that # contain compiled Java classes. # --------------------------------------------------- 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 # --------------------------------------------------- # All the tools in the JDK use green threads as a # default. To specify that native threads should be # used, set the THREADS_FLAG environment variable to # "native". You can revert to the use of green # threads by setting THREADS_FLAG to the value # "green". # --------------------------------------------------- THREADS_FLAG=native; export THREADS_FLAG
# --------------------------------------------------- # TEMP, TMP, and TMPDIR # --------------------------------------------------- # Specify the default directories for temporary # files; if set, tools that create temporary files # create them in one of these directories. # --------------------------------------------------- export TEMP=/tmp export TMPDIR=/tmp
# --------------------------------------------------- # UMASK # --------------------------------------------------- # Set the default file mode creation mask # (umask) to 022 to ensure that the user performing # the Oracle software installation creates files # with 644 permissions. # --------------------------------------------------- umask 022 [oracle@rac2 ~]$ [oracle@rac2 ~]$ . ~/.bash_profile
|
Grid Infrastructure Install.avi
GII_oracle_software.avi
GII_oracle_database.avi
当Grid Infrastructure使用GNS时,如果DHCP IP地址池的范围很大.会出现前期分配的4个SCAN所获得的IP地址不在DNS解释域名中的情况.此时SCAN失去了本身应有的作用.解决方法将全部地址池中的IP添加到DNS解析当中.
个人不是很喜欢GNS的方式,虽然省去了vip的配置,无形中多添的GNS管理模块又使应用调度复杂了一些.

http://space.itpub.net/11780477/viewspace-707021
http://www.oracle.com/technetwork/articles/hunter-rac11gr2-iscsi-2-088698.html
http://blog.csdn.net/tianlesoftware/article/details/6036263
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11780477/viewspace-713765/ ,如需转载,请注明出处,否则将追究法律责任。