Sei sulla pagina 1di 8

# and add disks to it

# Create RAID-1 for two disks from BIOS menu


#
#
# RHEL 5.3 Installation and Post-Configuration
#
### partitioning ###
/dev/sda1 / -- 16Gb (16384 Mb)
/dev/sda2 swap -- 16G (16384 Mb)
/dev/sda3 /opt -- the rest
### network configuration ###
eth0 -- service (form later bond0 with eth2)
eth1 -- private interconnect (form later bond1 with eth3)
hostname: adit-oraN.domain.com (fqdn is important for sendmail) in service netwo
rk
gateway -- service gateway
dns -- your dns servers
### packages selection ###
deselect everything except Base
### first boot ###
disable firewall
disable selinux
#/etc/init.d/iptables stop
#/etc/init.d/ip6tables stop
#chkconfig iptables off
#chkconfig ip6tables off
#sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
#####################################
# it is advisable to use yum to simplify further rpms installation
#mount /dev/cdrom /mnt
#mkdir -p /opt/tmp/rpms52.x86_64
#cp -rp /mnt/Server/*rpm /opt/tmp/rpms52.x86_64/
#rpm -ivh /mnt/Server/createrepo*rpm
#createrepo /opt/tmp/rpms52.x86_64
# create /etc/yum.repos/local.repo file
#echo "[local]" > /etc/yum.repos.d/local.repo
#echo "baseurl=file:///opt/tmp/rpms52.x86_64" >> /etc/yum.repos.d/local.repo
#sed -i 's/gpgcheck=1/gpgcheck=0/' /etc/yum.conf
#to use yum:
#yum install RPM_PACKAGE_NAME
#####################################
### install some packages for our convenience ###
#
yum install vim-enhanced screen xorg-x11-xauth -y
#
### edit /etc/hosts ###
127.0.0.1 localhost.localdomain localhost
#::1 localhost6.localdomain6 localhost6
# service network
10.1.1.60 adit-ora1 adit-ora1.mobixell.com
10.1.1.61 adit-ora2 adit-ora2.mobixell.com
# vip that sits on service network
10.1.1.59 adit-ora1-vip adit-ora1-vip.mobixell.com
10.1.1.62 adit-ora2-vip adit-ora2-vip.mobixell.com
# scan
10.1.1.65 adit-ora
# private interconnect for oracle cluster
192.168.0.100 adit-ora1-priv adit-ora1-priv.mobixell.com
192.168.0.200 adit-ora2-priv adit-ora2-priv.mobixell.com
# storage
10.1.1.63 aditora-storage1 aditora-storage1.mobixell.com
10.1.1.64 aditora-storage2 aditora-storage2.mobixell.com
#

#
wget -O- http://akula/misc/aditora/hosts > /etc/hosts
#
### setup bonding ###
add the following to /etc/modprobe.conf:
alias bond0 bonding
options bond0 miimon=100 mode=1 max_bonds=2
alias bond1 bonding
options bond1 miimon=100 mode=1 max_bonds=2
#
sed -i '/bond/d' /etc/modprobe.conf
wget -O- http://akula/misc/aditora/modprobe.bond.conf >> /etc/modprobe.conf
#
use the following examples for ethernet interfaces:
# ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
IPADDR=
NETMASK=
ONBOOT=yes
# ifcfg-eth0
DEVICE=eth0
MASTER=bond0
SLAVE=yes
# ifcfg-eth2
DEVICE=eth2
MASTER=bond0
SLAVE=yes
#
wget -O- http://akula/misc/aditora/aditora.ifcfg-eth.tar | tar xf - -C /etc/sysc
onfig/network-scripts
if [ `hostname | awk -F. '{ print $1 }'` == "adit-ora1" ]; then
wget -O- http://akula/misc/aditora/aditora1-ifcfg-bond.tar | tar xf - -C /etc/sy
sconfig/network-scripts
elif [ `hostname | awk -F. '{ print $1 }'` == "adit-ora2" ]; then
wget -O- http://akula/misc/aditora/aditora2-ifcfg-bond.tar | tar xf - -C /etc/sy
sconfig/network-scripts
fi
#
### exchange ssh keys for root user ###
# NOTE: we need it for oracle user, and 11gR2 sets it automatically
exchange keys
login from all hosts to all hosts or write the following option for the time of
installation:
cat .ssh/config
StrictHostKeyChecking no
#ssh adit-ora1 -o StrictHostKeyChecking=no hostname
#ssh adit-ora2 -o StrictHostKeyChecking=no hostname
# ssh adit-ora1-priv, adit-ora2-priv, ...
#
wget -O- http://akula/misc/aditora/ssh-adiora.tar | tar xf - -C /root
#
### install and configure ntp ###
# NOTE: 11gR2 sets it automatically
#yum install ntp -y
#chkconfig ntpd on
#
#do ONLY on the second host
#change server N.rhel.pool.ntp.org to server adit-ora1-priv
#do ONLY on the first host
#comment server N.rhel.pool.ntp.org to change a server to standalone source
#
##
#if [ `hostname | awk -F. '{ print $1 }'` != "adit-ora1" ]; then
#wget -O- http://akula/misc/aditora/ntp.conf.client > /etc/ntp.conf
#else
#wget -O- http://akula/misc/aditora/ntp.conf.server > /etc/ntp.conf
#fi
##
#/etc/init.d/ntpd restart
#ntpq -p
#
# Storage Configuration
#
### install ### required os packages
yum install kernel-devel make gcc -y
### installing mpp rdac ###
wget -O- http://akula/misc/aditora/RDAC_Linux_2.6_RH5_SLES10SP1/rdac-LINUX-09.03
.0C05.0029-source.tar.gz | tar xzf - -C /root
cd linuxrdac-09.03.0C05.0029
make clean; make; make install
### edit grub file to include new kernel ###
default=1
#
sed -i 's/default=0/default=1/' /etc/grub.conf
#
title Red Hat Enterprise Linux Server (2.6.18-128.el5) with MPP support
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-128.el5 ro root=LABEL=/
initrd /boot/mpp-2.6.18-128.el5.img
#
wget -O- http://akula/misc/aditora/grub.conf.mpp >> /etc/grub.conf
#
### make a reboot at this step ###
### install storage manager software ###
#
mkdir -p /opt/tmp
cd /opt/tmp
wget http://akula/misc/aditora/SMIA-LINUX-10.35.A5.35.bin
sh SMIA-LINUX-10.35.A5.35.bin -i console
#
choose Management Station
or --
rpm -ivh http://akula/misc/aditora/SMclient.rpm http://akula/misc/aditora/SMesm.
rpm http://akula/misc/aditora/SMfirmware.rpm http://akula/misc/aditora/SMfwupgra
de.rpm http://akula/misc/aditora/SMruntime.rpm
# configure storage
yum install xorg-x11-utils xorg-x11-apps xorg-x11-server-utils -y
#wget http://akula/misc/aditora/jre-6u16-linux-x64.bin
#sh jre-6u16-linux-x64.bin -noregister > /dev/null <<EOF
#yes
#EOF
## edit smclient /opt/IBM_DS4000/client/SMclient
#JAVA_EXEC=/opt/tmp/jre1.6.0_15/bin/java
# --nogpgcheck
storage ip adresses (located in the service subnet, should it be in management?)
aditora-storage1
10.1.1.63
aditora-storage2
10.1.1.64
run the gui
/opt/IBM_DS4000/client/SMclient
Configure
one array, give it all 6 disks at raid1 level
then create logical volume disk without partitions
then initialize it from os on one node only!
fdisk /dev/sdb <<EOF
n
p
1

wq
EOF
fdisk -l
#
# Oracle Database and Cluster Installation
#
### add os user and groups ###
groupadd -f oinstall
groupadd -f dba
useradd -g oinstall -G dba oracle
echo mobixell|passwd --stdin oracle
### create directories ###
mkdir -p /opt/app/11.2.0/grid
mkdir -p /opt/app/oracle
chown -R oracle:oinstall /opt/app
chmod 775 /opt/app
### install os packages required by oracle ###
yum install -y binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-deve
l gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc+
+ libstdc++-devel make sysstat unixODBC unixODBC-devel
### install asm lib packages ####
# redhat 5.2 oracleasm-2.6.18-92.el5-2.0.5-1.el5.x86_64.rpm
# redhat 5.3 oracleasm-2.6.18-128.el5-2.0.5-1.el5.x86_64.rpm
rpm -ivh http://akula/misc/aditora/oracleasmlib-2.0.4-1.el5.x86_64.rpm http://ak
ula/misc/aditora/oracleasm-support-2.1.3-1.el5.x86_64.rpm http://akula/misc/adit
ora/oracleasm-2.6.18-128.el5-2.0.5-1.el5.x86_64.rpm
### prepare disks for asm ###
oracleasm configure -i
### create asm disk group and add disks to it ###
/etc/init.d/oracleasm restart
/usr/sbin/oracleasm createdisk DISK1 /dev/sdb1
/etc/init.d/oracleasm restart
/usr/sbin/oracleasm listdisks
### download grid (former clusterware) package and extract it ###
su - oracle
cd /opt/tmp
wget http://akula/oracle/11gR2/x86_64/linux.x64_11gR2_grid.zip
unzip -q linux.x64_11gR2_grid.zip
### install grid infrastructure ###
cd grid
# set environment variables
export LC_COLLATE=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LANG=en_US.UTF-8
./runInstaller
### download oracle database package and extract it ###
wget http://akula/oracle/11gR2/x86_64/linux.x64_11gR2_database_1of2.zip
wget http://akula/oracle/11gR2/x86_64/linux.x64_11gR2_database_2of2.zip
unzip -q linux.x64_11gR2_database_1of2.zip
unzip -q linux.x64_11gR2_database_2of2.zip
# reboot
### check the readiness ###
./runcluvfy.sh stage -pre dbinst -fixup -n adit-ora1,adit-ora2 -osdba dba -verbo
se

# add to oracle bashrc


su - oracle
vim .bashrc
if [ -t 0 ]; then
stty intr ^C
fi

# vim /etc/sysctl.conf
# oracle 11g
kernel.sem = 250 32000 100 128
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.shmall = 2097152
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 4194304
fs.aio-max-nr=1048576
/sbin/sysctl -p
yum install -y unzip
unzip -q linux.x64_11gR1_clusterware.zip
unzip -q linux.x64_11gR1_database_1013.zip
yum install smartmontools -y
yum localinstall clusterware/rpm/cvuqdisk-1.0.1-1.rpm -y
CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
# ssh keys for user oracle
# umask 022
/etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
/etc/pam.d/login
session required pam_limits.so
/etc/profile
if [ $USER = "oracle" ]; then
ulimit -u 16384 -n 65536
umask 022
fi
# cluvfy.sh
cd /opt/tmp/clusterware
./runcluvfy.sh comp nodereach -n adit-ora1,adit-ora2 -verbose
./runcluvfy.sh stage -pre crsinst -n adit-ora1,adit-ora2 -verbose
cd /opt
mkdir -p oracrs1 oracrs2
chown oracle.oinstall oracrs?
chmod 750 /opt/oracrs?
# disks permissions
/etc/udev/rules.d/51-udev.rules
# datafiles
KERNEL=="sdb?", OWNER="oracle", GROUP="dba"
# recovery area
KERNEL=="sdc?", OWNER="oracle", GROUP="dba"
# ocr
KERNEL=="sde?", OWNER="root", GROUP="oinstall", MODE="0640"
# vote
KERNEL=="sdd?", OWNER="oracle", GROUP="oinstall", MODE="0640"
# to create SPFILE for ASM on dedicated block device
/etc/init.d/oracleasm createdisk ORADATA /dev/sdb1
/etc/init.d/oracleasm createdisk RECOVERY /dev/sdc1
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks
cd /opt/tmp/clusterware
./runcluvfy.sh stage -post hwos -n adit-ora1,adit-ora2
# ocfs2

#
cd /opt/tmp/clusterware/
./runcluvfy.sh comp ssa -n adit-ora1,adit-ora2
# installing
export ORACLE_BASE=/opt/app/oracle
./runcluvfy.sh stage -pre crsinst -n adit-ora1,adit-ora2 -verbose
# hangcheck timer
#options hangcheck-timer hangcheck_tick=1 hangcheck_margin=10 hangcheck_reboot=1
echo "options hangcheck-timer hangcheck_tick=1 hangcheck_margin=10 hangcheck_reb
oot=1" >> /etc/modprobe.conf
/sbin/modprobe -v hangcheck-timer
echo "modprobe hangcheck-timer" >> /etc/rc.local
su - root
cd /opt/app/crs/bin/
crsctl stop crs
procd stop
crsctl set css diagwait 13 -force
crsctl start crs
crsctl check crs
crs_stat -t
cd /opt/app/crs
cp root.sh root.sh.save.after.install
su - oracle
cd /opt/tmp/clusterware
./runcluvfy.sh stage -post crsinst -n adit-ora1,adit-ora2
# rac database install
./runcluvfy.sh stage -pre dbinst -n adit-ora1,adit-ora2 -r 11gR1 -osdba dba -ver
bose
# edit /etc/sysctl.conf
#net.core.rmem_default = 262144
net.core.rmem_default = 4194304

ocrl ocrl
adit-ora1:1158/em
# edit /etc/oratab
Y
# edit .bash_profile
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=/opt/app/oracle/product/11.1.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orclN, N is the number of instance
###############
create user mobixell identified by mobixell;
CREATE TABLESPACE mobixell_tablespace DATAFILE '+DATA' size 10G;
alter user mobixell default tablespace mobixell_tablespace temporary tablespace
temp;
grant connect, resource to mobixell;
select
sys_context('userenv', 'instance_name') "Instance",
sys_context('userenv', 'server_host') "Host",
sys_context('userenv', 'service_name') "ServiceName"
from dual;
select instance_name from v$instance;