Linux平臺安裝Oracle11gR2數據庫

 

1. 數據庫安裝先決條件node

1.1 認證的操做系統檢查確認linux

o RHEL4,OEL4 - update 7 or greater c++

o RHEL5,OEL5 - 5.2 or greater 數據庫

o RHEL6,OEL6 - 6.0 or greater bash

o SLES10 - Kernel 2.6.16.21-0.8 or greater 服務器

o SLES11 - Kernel 2.6.27.19-5 or greater session

o Asianux Server 3 SP2 oracle

NOTE: On RHEL6/OEL6, 11.2.0.3 or later is certified (not 11.2.0.1 or 11.2.0.2) app

詳情請參考文檔:Certification Information for Oracle Database on Linux x86-64 (Doc ID 1304727.2)ssh

 

1.2 系統硬件和軟件環境檢查

1) 物理內存至少4G

# grep MemTotal /proc/meminfo

2)swap通常須要和物理內存至關,大於32G則設置32G,不知足須要擴容

# free -g

If RAM between 2 GB and 8 GB then 2 times the size fo RAM.

If RAM between 8 GB to 32 GB then 1.5 times the size of RAM.

If RAM greater than 32 GB then 32 GB

3) Tmp至少1G,不知足需擴容

# df -h

4)建議Oracle軟件所需空間至少80G。

lvcreate -L 80G -n lvoraapp rootvg

mkfs.ext4 /dev/mapper/rootvg-lvoraapp

mkdir /oracle

cp /etc/fstab{,_$(date +%Y%m%d)}

echo "/dev/mapper/rootvg-lvoraapp /oracle ext4 defaults 1 2" >> /etc/fstab

mount -a

5) IP 需求

每一個節點一個public IP,一個virtual IP,一個private IP;

整個集羣須要至少一個SCAN IP;

6)檢查數據庫版本以及內核,注意RHEL6/OEL6操做系統內核支持11.2.0.3或更高的ORACLE數據庫版本,可是不支持11.2.0.1 或者 11.2.0.2(參考文檔ID169706.1)

# uname –a

# lsb_release -a

# cat /etc/redhat-release

7) 檢查防火牆和selinux是否關閉

# 檢查防火牆是否關閉

service iptables status

# 關閉防火牆

chkconfig iptables off

service iptables stop

# 確認防火牆已關閉

service iptables status

chkconfig --list iptables

# 檢查selinux是否禁用

# 禁用selinux,配置/etc/sysconfig/selinux,修改SELINUX項爲disabled

SELINUX=disabled

# 檢查確認,須要重啓操做系統生效

grep 'SELINUX=' /etc/sysconfig/selinux

8)檢查依賴的系統軟件包

<1> Installed the following packages for Oracle Linux5, RHEL5

binutils-2.17.50.0.6-6.el5 (x86_64)

compat-libstdc++-33-3.2.3-61 (x86_64)

compat-libstdc++-33-3.2.3-61 (i386)

elfutils-libelf-0.125-3.el5 (x86_64)

elfutils-libelf-devel-0.125-3 (x86_64)

elfutils-libelf-devel-static-0.125-3 (x86_64)

gcc-4.1.2-42.el5 (x86_64)

gcc-c++-4.1.2-42.el5 (x86_64)

glibc-2.5-24 (x86_64)

glibc-2.5-24 (i686)

glibc-common-2.5-24 (x86_64)

glibc-devel-2.5-24 (x86_64)

glibc-devel-2.5-24 (i386)

glibc-headers-2.5-24 (x86_64)

ksh-20060214-1.7 (x86_64)

libaio-0.3.106-3.2 (x86_64)

libaio-0.3.106-3.2 (i386)

libaio-devel-0.3.106-3.2 (x86_64)

libaio-devel-0.3.106-3.2 (i386)

libgcc-4.1.2-42.el5 (i386)

libgcc-4.1.2-42.el5 (x86_64)

libstdc++-4.1.2-42.el5 (x86_64)

libstdc++-4.1.2-42.el5 (i386)

libstdc++-devel-4.1.2-42 (x86_64)

make-3.81-3.el5 (x86_64)

kernel-headers-2.6.18-92 (x86_64)

libgomp-4.1.2-42 (x86_64)

sysstat-7.0.2-1 (x86_64)

unixODBC-2.2.14 (x86_64)

unixODBC-2.2.14 (i386)

unixODBC-devel-2.2.14 (x86_64)

unixODBC-devel-2.2.14 (i386)

<2> Installed the following packages for Oracle Linux6, RHEL6

binutils-2.20.51.0.2-5.11.el6 (x86_64)

compat-libcap1-1.10-1 (x86_64)

compat-libstdc++-33-3.2.3-69.el6 (x86_64)

compat-libstdc++-33-3.2.3-69.el6.i686

gcc-4.4.4-13.el6 (x86_64)

gcc-c++-4.4.4-13.el6 (x86_64)

glibc-2.12-1.7.el6 (i686)

glibc-2.12-1.7.el6 (x86_64)

glibc-devel-2.12-1.7.el6 (x86_64)

glibc-devel-2.12-1.7.el6.i686

ksh

libgcc-4.4.4-13.el6 (i686)

libgcc-4.4.4-13.el6 (x86_64)

libstdc++-4.4.4-13.el6 (x86_64)

libstdc++-4.4.4-13.el6.i686

libstdc++-devel-4.4.4-13.el6 (x86_64)

libstdc++-devel-4.4.4-13.el6.i686

libaio-0.3.107-10.el6 (x86_64)

libaio-0.3.107-10.el6.i686

libaio-devel-0.3.107-10.el6 (x86_64)

libaio-devel-0.3.107-10.el6.i686

make-3.81-19.el6

sysstat-9.0.4-11.el6 (x86_64)

unixODBC-2.2.14-11.el6 (x86_64) or later

unixODBC-2.2.14-11.el6.i686 or later

unixODBC-devel-2.2.14-11.el6 (x86_64) or later

unixODBC-devel-2.2.14-11.el6.i686 or later

cpp-4.4.4-13.el6(x86_64)

glibc-headers-2.12-1.7.el6(x86_64)

mpfr.x86_64 0:2.4.1-6.el6(x86_64)

<3> Installed the following packages for Oracle Linux7, RHEL7

binutils-2.23.52.0.1-12.el7.x86_64

compat-libcap1-1.10-3.el7.x86_64

compat-libstdc++-33-3.2.3-71.el7.i686

compat-libstdc++-33-3.2.3-71.el7.x86_64

gcc-4.8.2-3.el7.x86_64

gcc-c++-4.8.2-3.el7.x86_64

glibc-2.17-36.el7.i686

glibc-2.17-36.el7.x86_64

glibc-devel-2.17-36.el7.i686

glibc-devel-2.17-36.el7.x86_64

ksh

libaio-0.3.109-9.el7.i686

libaio-0.3.109-9.el7.x86_64

libaio-devel-0.3.109-9.el7.i686

libaio-devel-0.3.109-9.el7.x86_64

libgcc-4.8.2-3.el7.i686

libgcc-4.8.2-3.el7.x86_64

libstdc++-4.8.2-3.el7.i686

libstdc++-4.8.2-3.el7.x86_64

libstdc++-devel-4.8.2-3.el7.i686

libstdc++-devel-4.8.2-3.el7.x86_64

libXi-1.7.2-1.el7.i686

libXi-1.7.2-1.el7.x86_64

libXtst-1.2.2-1.el7.i686

libXtst-1.2.2-1.el7.x86_64

make-3.82-19.el7.x86_64

sysstat-10.1.5-1.el7.x86_64

unixODBC-2.3.1-6.el7.x86_64 or later

unixODBC-2.3.1-6.el7.i686 or later

unixODBC-devel-2.3.1-6.el7.x86_64 or later

unixODBC-devel-2.3.1-6.el7.i686 or later

cpp-4.8.2-16.el7.x86_64

glibc-headers-2.17-55.el7.x86_64

mpfr-3.1.1-4.el7.x86_64

-- 將上面軟件包寫入到/tmp/pkg.info文件

OLDIFS=${IFS}

IFS=$'\n'

for i in $(cat /tmp/pkg.info); do

if [[ "$(uname -r)" =~ "2.6.18" ]]; then

a=${i%-*};

[[ "${i}" =~ "(32" ]] && a=$a.i686

else

a=${i%-*};

a=${a%-*};

[[ "${i}" =~ "i686" ]] && a=$a.i686

fi

rpm -q $a

[[ "$?" = "0" ]] || yum -y install $a

done

IFS=${OLDIFS}

 

# 檢查軟件包

-- linux5

rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc-2.5 glibc-2.5.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat unixODBC.i686 unixODBC-devel unixODBC

-- linux6

rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat elfutils-libelf-devel elfutils-libelf unixODBC unixODBC-devel smartmontools pdksh compat-libstdc++-33.i686 glibc.i686 glibc-devel.i686  libgcc.i686 libstdc++.i686 libstdc++-devel.i686 libaio.i686 libaio-devel.i686 unixODBC.i686 unixODBC-devel.i686

-- linux7

rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" binutils compat-libcap1 compat-libstdc++-33.i686 compat-libstdc++-33 gcc gcc-c++ glibc.i686 glibc glibc-devel.i686 glibc-devel ksh libaio.i686 libaio libaio-devel.i686 libaio-devel libgcc.i686 libgcc libstdc++.i686 libstdc++ libstdc++-devel.i686 libstdc++-devel libXi.i686 libXi libXtst.i686 libXtst make sysstat unixODBC unixODBC.i686 unixODBC-devel unixODBC-devel.i686

# 安裝軟件包

-- linux5

yum install -y binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc-2.5 glibc-2.5.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat unixODBC.i686 unixODBC-devel unixODBC

-- linux6

yum install -y binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat elfutils-libelf-devel elfutils-libelf unixODBC unixODBC-devel smartmontools pdksh compat-libstdc++-33.i686 glibc.i686 glibc-devel.i686  libgcc.i686 libstdc++.i686 libstdc++-devel.i686 libaio.i686 libaio-devel.i686 unixODBC.i686 unixODBC-devel.i686

-- linux7

yum install -y binutils compat-libcap1 compat-libstdc++-33.i686 compat-libstdc++-33 gcc gcc-c++ glibc.i686 glibc glibc-devel.i686 glibc-devel ksh libaio.i686 libaio libaio-devel.i686 libaio-devel libgcc.i686 libgcc libstdc++.i686 libstdc++ libstdc++-devel.i686 libstdc++-devel libXi.i686 libXi libXtst.i686 libXtst make sysstat unixODBC unixODBC.i686 unixODBC-devel unixODBC-devel.i686

1.3 修改/etc/hosts文件

注1:hostname不容許使用下劃線_,建議統一使用小寫字母和數字組合,不然安裝過程可能會報錯。

cp /etc/hosts{,_$(date +%Y%m%d)}

cat >> /etc/hosts <EOF

127.0.0.1 loopback localhost

::1 loopback localhost

# Public Network - (bond0)

192.168.8.145 orcl1

192.168.8.146 orcl2

# Private Interconnect - (bond1)

192.168.168.145 orcl1-priv

192.168.168.146 orcl2-priv

# Public Virtual IP (VIP) addresses - (bond0:X)

192.168.8.147 orcl1-vip

192.168.8.148 orcl2-vip

# SCAN IP - (bond0:X)

192.168.8.149 orcl-scan

EOF

1.4 建立用戶和組並賦予權限

# 建立用戶組:

/usr/sbin/groupadd -g 1000 oinstall

/usr/sbin/groupadd -g 1031 dba

/usr/sbin/groupadd -g 1032 oper

/usr/sbin/groupadd -g 1020 asmadmin

/usr/sbin/groupadd -g 1021 asmdba

/usr/sbin/groupadd -g 1022 asmoper

# 建立用戶:

useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba -m -d /home/grid -c "Grid Infrastructure Owner" grid

useradd -u 1101 -g oinstall -G dba,asmdba,oper -m -d /home/oracle -c "Oracle Software Owner" oracle

# 修改用戶密碼

echo "p#ssw0rd"|passwd --stdin oracle

echo "p#ssw0rd"|passwd --stdin grid

# su測試一下密碼是否修改爲功

# 檢查確認

id oracle

id grid

1.5 配置/etc/pam.d/login

# 添加以下配置,使得/etc/pam.d/login中的限制資源參數生效

session required pam_limits.so

cp -p /etc/pam.d/login{,_$(date +%Y%m%d)}

cat >> /etc/pam.d/login << EOF

session required pam_limits.so

EOF

1.6 配置/etc/security/limits.conf

cp -p /etc/security/limits.conf{,_$(date +%Y%m%d)}

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

# modify for oracle

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 4096

oracle hard nofile 65536

oracle soft stack 10240

oracle hard stack 32768

# modify for grid

grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 4096

grid hard nofile 65536

grid soft stack 10240

grid hard stack 32768

oracle soft memlock 1000000

oracle hard memlock 1000000

grid soft memlock 1000000

grid hard memlock 1000000

EOF

# 說明

soft nofile: 可打開的文件描述符的最大數(軟限制)

hard nofile:可打開的文件描述符的最大數(硬限制)

soft nproc:單個用戶可用的最大進程數量(軟限制)

hard nproc:單個用戶可用的最大進程數量(硬限制)

# 檢查確認oracle用戶的配置是否生效

su – oracle

$ ulimit –a

 

1.7 配置/etc/profile

cp -p /etc/profile{,$(date +%Y%m%d)}

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

1.8 配置grid、oracle用戶環境變量

su - grid

cat << EOF >> ${HOME}/.bash_profile

# GI user environments

export ORACLE_SID=+ASM1

export ORACLE_BASE=/apps/oracle/grid

export ORACLE_HOME=/apps/oracle/11.2.0/grid

export PATH=\${PATH}:\${ORACLE_HOME}/bin:\${ORACLE_HOME}/OPatch

umask 022

EOF

exit

su - oracle

cat << EOF >> ${HOME}/.bash_profile

# DB user environments

export ORACLE_SID=orcl1

export ORACLE_BASE=/apps/oracle/database

export ORACLE_HOME=\${ORACLE_BASE}/11.2/db_1

export GI_HOME=/apps/oracle/11.2.0/grid

export LD_LIBRARY_PATH=\${ORACLE_HOME}/lib

export PATH=\${ORACLE_HOME}/bin:\${ORACLE_HOME}/OPatch:\${GI_HOME}/bin:\${HOME}/dba:\$PATH

export TNS_ADMIN=\${GI_HOME}/network/admin

umask 022

EOF

1.9 建立軟件安裝目錄

#建立目錄

mkdir -p /apps/oracle/grid

mkdir -p /apps/oracle/11.2.0/grid

mkdir -p /apps/oracle/oraInventory

chown -R grid:oinstall /apps/oracle

mkdir -p /apps/oracle/database

mkdir -p /apps/oracle/database/11.2/db_1

chown oracle:oinstall /apps/oracle/database

chmod -R 775 /apps/oracle

#檢查目錄屬性,確認修改是否正確

ls -ltrd /apps/oracle/grid /apps/oracle/11.2.0/grid /apps/oracle/database

1.10 配置/etc/sysctl.conf

cp -p /etc/sysctl.conf{,_$(date +%Y%m%d)}

MEMTOTAL=$(free -b | sed -n '2p' | awk '{print $2}')

SHMMAX=$(expr $MEMTOTAL / 2)

SHMMNI=4096

PAGESIZE=$(getconf PAGE_SIZE)

cat >> /etc/sysctl.conf << EOF

# -- The number of asynchronous IO requests at the same time(as per Note 579108.1),for example 1048576 = 1024 * 1024

fs.aio-max-nr = 3145728

# -- 512 * processes (for example 6815744 for 13312 processes)

fs.file-max = 6815744

kernel.shmmax = $SHMMAX

kernel.shmall = $(expr \( $SHMMAX / $PAGESIZE \) \* \( $SHMMNI / 16 \))

kernel.shmmni = $SHMMNI

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 = 1048576

vm.min_free_kbytes=51200

EOF

1.11 配置ntp服務

# 查看當前時區

cat /etc/sysconfig/clock

# 添加ntp服務器,根據實際環境修改服務地址

vi /etc/ntp.conf

server 127.127.0.1

# 配置ntpd的參數,咱們主要強調的是要配置成"微調的模式" 也就是在options中要加入-x的選項

vi /etc/sysconfig/ntpd

OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

# 開機啓動NTPD服務

chkconfig ntpd on

# 重啓服務,使最新配置生效

service ntpd restart

# 檢查是否生效

ntpq -p

ps -ef |grep ntp|grep -v grep

# 安裝完成後須要使用以下命令確認

$ crsctl check ctss

1.12 配置SSH互信

-- 1)人爲配置互相

-- grid用戶, 分別生成密鑰

#su - grid

grid@rac1:~$ mkdir ~/.ssh

grid@rac1:~$ chmod 700 ~/.ssh

grid@rac1:~$ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa

grid@rac1:~$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa

#su - grid

grid@rac2:~$ mkdir ~/.ssh

grid@rac2:~$ chmod 700 ~/.ssh

grid@rac2:~$ ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa

grid@rac2:~$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa

節點一:

-- 將生成的rsa和dsa密鑰複製到authorized_keys

$ cat ~/.ssh/*.pub >> ~/.ssh/authorized_keys

-- 將節點2的生成的密鑰追加到節點1的authorized_keys中,如有多個節點,依次執行

$ ssh node2 "cat ~/.ssh/*.pub" >> ~/.ssh/authorized_keys

-- 將最終的authorized_keys文件傳輸到其它全部節點

$ scp ~/.ssh/authorized_keys node2:~/.ssh/authorized_keys

-- 修改文件權限

grid@rac1:~/.ssh$ chmod 600 ~/.ssh/authorized_keys

-- oracle用戶參照上面步驟配置

-- 互信驗證(oracle,grid)全部節點操做

su - grid

export SSH='ssh -o ConnectTimeout=3 -o ConnectionAttempts=5 -o PasswordAuthentication=no -o StrictHostKeyChecking=no'

$ ${SSH} rac1 date

$ ${SSH} rac1-priv date

$ ${SSH} rac2 date

$ ${SSH} rac2-priv date

2)oralce11g能夠在安裝時進行自動配置ssh,第一次設置,點擊「Setup」,設置成功後點擊「Test」,成功後需兩邊節點測試驗證互信。

1.13 配置HOTPLUG(Network interface going down when dynamically adding disks to storage using udev in RHEL 6 (Doc ID 1569028.1))

添加HOTPLUG="no"配置到/etc/sysconfig/network-scripts目錄下的ifcfg-ethX文件,防止start_udev命令關閉網卡致使VIP漂移或鏈接異常。

注意確認配置是否生效,可在安裝完數據庫以後執行start_udev命令確認。

 

1.14 共享存儲配置(RAC環境須要)

--存儲規劃建議

Ø ocr voting:3個2G的lun,ASM對應劃分1個normal的dg

Ø 控制文件:3個2G的lun,ASM對應劃分3個dg

Ø redo:2個64G的lun(建議raid 1+0,儘可能不用raid5),ASM對應劃分2個dg

Ø 數據文件:最多500G 1個lun,ASM對應劃分1個dg,注意單個dg不超過10T

-- multipath

chkconfig multipathd on

service multipathd restart

#設置磁盤屬性:

#配置/etc/udev/rules.d/12-dm-permissions.rules參數文件

ENV{DM_NAME}=="ocr1", OWNER:="grid", GROUP:="asmadmin", MODE:="640", SYMLINK+="mapper/$env{DM_NAME}"

ENV{DM_NAME}=="ocr2", OWNER:="grid", GROUP:="asmadmin", MODE:="640", SYMLINK+="mapper/$env{DM_NAME}"

ENV{DM_NAME}=="ocr3", OWNER:="grid", GROUP:="asmadmin", MODE:="640", SYMLINK+="mapper/$env{DM_NAME}"

ENV{DM_NAME}=="ctl1", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="mapper/$env{DM_NAME}"

ENV{DM_NAME}=="ctl2", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="mapper/$env{DM_NAME}"

ENV{DM_NAME}=="ctl3", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="mapper/$env{DM_NAME}"

ENV{DM_NAME}=="redo1", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="mapper/$env{DM_NAME}"

ENV{DM_NAME}=="redo2", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="mapper/$env{DM_NAME}"

ENV{DM_NAME}=="data1", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="mapper/$env{DM_NAME}"

ENV{DM_NAME}=="data2", OWNER:="grid", GROUP:="asmadmin", MODE:="660", SYMLINK+="mapper/$env{DM_NAME}"

# 重啓udev服務並檢查磁盤權限屬性

start_udev

ll /dev/mapper/

ll /dev/dm*

--共享存儲使用RAW方式

vi /etc/udev/rules.d/60-raw.rules

ACTION=="add", KERNEL=="emcpowerg", RUN+="/bin/raw /dev/raw/raw1 %N"

ACTION=="add", KERNEL=="emcpowerh", RUN+="/bin/raw /dev/raw/raw2 %N"

ACTION=="add", KERNEL=="emcpoweri", RUN+="/bin/raw /dev/raw/raw3 %N"

ACTION=="add", KERNEL=="emcpowere", RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add", KERNEL=="emcpowerf", RUN+="/bin/raw /dev/raw/raw5 %N"

RUN+="/bin/sleep 1"

KERNEL=="raw[1-3]*", OWNER="grid", GROUP="asmadmin", MODE="660"

KERNEL=="raw[4-5]*", OWNER="oracle", GROUP="oinstall", MODE="660" 

2. 安裝Oracle數據庫

2.1 預檢查

su - grid

unzip -qo p13390677_112040_Linux-x86-64_3of7.zip

./runcluvfy.sh stage -pre crsinst -n node1,node2 -fixup -verbose

2.2 圖形界面安裝GI軟件

以grid用戶登陸,進入到安裝文件解壓目錄

./runInstaller

…….

-- 用root用戶,分別在兩個節點執行如下腳本

/oracle/app/oraInventory/orainstRoot.sh

/oracle/app/11.2.0/grid/root.sh

 

2.3 檢查集羣狀態

gsd爲OFFLINE狀態正常,配置ntp服務則ora.ctssd爲OBSERVER的狀態

# su - grid

$ crsctl status res -t -init

$ crsctl status res -t

2.4 建立ASM磁盤組

su – grid

$ asmca

 

2.5 圖形界面安裝RDBMS 軟件

注意事項:兩個DB的安裝包需解壓在同個目錄下。

unzip -qo p13390677_112040_Linux-x86-64_1of7.zip

unzip -qo p13390677_112040_Linux-x86-64_2of7.zip

cd database

./runInstaller

……

--雙節點root用戶運行腳本

/oracle/app/oracle/product/11.2.0/dbhome_1/root.sh

 

2.6 dbca建庫

cd ${ORACLE_HOME}/bin

./dbca

 

完成建庫後,檢查數據庫全部資源狀態:

su - grid

crsctl status res –t

 

3. 靜默安裝

3.1 預檢查

su - grid

cd grid

./runcluvfy.sh stage -pre crsinst -n node1,node2 -fixup -verbose

3.2 靜默安裝GI軟件

注意:粗體部分根據實際環境進行相應的修改

su - grid

#配置響應文件/home/grid/grid.rsp

cat > ${HOME}/grid_install.rsp << EOF

oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0

SELECTED_LANGUAGES=en,zh_CN

oracle.install.option=CRS_CONFIG

oracle.install.asm.OSDBA=asmdba

oracle.install.asm.OSOPER=asmoper

oracle.install.asm.OSASM=asmadmin

oracle.install.crs.config.gpnp.configureGNS=false

oracle.install.crs.config.gpnp.gnsSubDomain=

oracle.install.crs.config.gpnp.gnsVIPAddress=

oracle.install.crs.config.autoConfigureClusterNodeVIP=

oracle.install.crs.config.storageOption=ASM_STORAGE

oracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=

oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=

oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=NORMAL

oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=

oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=NORMAL

oracle.install.crs.config.useIPMI=false

oracle.install.crs.config.ipmi.bmcUsername=

oracle.install.crs.config.ipmi.bmcPassword=

oracle.install.asm.diskGroup.name=CRSDG

oracle.install.asm.diskGroup.redundancy=NORMAL

oracle.install.asm.diskGroup.AUSize=1

oracle.install.crs.upgrade.clusterNodes=

oracle.install.asm.upgradeASM=false

oracle.installer.autoupdates.option=SKIP_UPDATES

oracle.installer.autoupdates.downloadUpdatesLoc=

AUTOUPDATES_MYORACLESUPPORT_USERNAME=

AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

PROXY_HOST=

PROXY_PORT=

PROXY_USER=

PROXY_PWD=

PROXY_REALM=

INVENTORY_LOCATION=/apps/oracle/oraInventory

ORACLE_HOME=/apps/oracle/11.2.0/grid

ORACLE_BASE=/apps/oracle/grid

ORACLE_HOSTNAME=node1

oracle.install.crs.config.gpnp.scanName=ora11g-scan

oracle.install.crs.config.gpnp.scanPort=1522

oracle.install.crs.config.clusterName=ora11g-cluster

oracle.install.crs.config.clusterNodes=node1:node1-vip,node2:node2-vip

oracle.install.crs.config.networkInterfaceList=eth0:192.168.10.0:1,eth1:172.168.0.0:2

oracle.install.asm.SYSASMPassword=oracle

oracle.install.asm.diskGroup.disks=/dev/mapper/asm_crs1,/dev/mapper/asm_crs2,/dev/mapper/asm_crs3

oracle.install.asm.monitorPassword=oracle

oracle.install.asm.diskGroup.diskDiscoveryString=/dev/mapper/asm*

EOF

cd /apps/soft/grid

./runInstaller -ignorePrereq -silent -responseFile ${HOME}/grid_install.rsp

#執行正常相似輸出以下

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB. Actual 1632 MB Passed

Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-06-20_08-47-01AM. Please wait ...[grid@node1 grid]$

You can find the log of this install session at:

/apps/oracle/oraInventory/logs/installActions2017-06-20_08-47-01AM.log

The installation of Oracle Grid Infrastructure 11g was successful.

Please check '/apps/oracle/oraInventory/logs/silentInstall2017-06-20_08-47-01AM.log' for more details.

As a root user, execute the following script(s):

1. /apps/oracle/oraInventory/orainstRoot.sh

2. /apps/oracle/11.2.0/grid/root.sh

Execute /apps/oracle/oraInventory/orainstRoot.sh on the following nodes:

[node1, node2]

Execute /apps/oracle/11.2.0/grid/root.sh on the following nodes:

[node1, node2]

As install user, execute the following script to complete the configuration.

1. /apps/oracle/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=<response_file>

Note:

1. This script must be run on the same host from where installer was run.

2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation).

Successfully Setup Software.

--建立相應文件

cat > ${HOME}/pwdrsp.properties << EOF

oracle.assistants.asm|S_ASMPASSWORD=oracle

oracle.assistants.asm|S_ASMMONITORPASSWORD=oracle

EOF

-- # on the install node host

su - grid

cd /apps/oracle/11.2.0/grid/cfgtoollogs

./configToolAllCommands RESPONSE_FILE=${HOME}/pwdrsp.properties

-- 正常輸出以下

Setting the invPtrLoc to /apps/oracle/11.2.0/grid/oraInst.loc

perform - mode is starting for action: configure

Jun 20, 2017 9:33:41 AM oracle.install.driver.oui.config.GenericInternalPlugIn invoke

INFO: Executing ASMCA

Jun 20, 2017 9:33:41 AM oracle.install.driver.oui.config.GenericInternalPlugIn invoke

INFO: Command /apps/oracle/11.2.0/grid/bin/asmca -silent -postConfigureASM -oui_internal

Jun 20, 2017 9:33:41 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: ... GenericInternalPlugIn.handleProcess() entered.

Jun 20, 2017 9:33:41 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: ... GenericInternalPlugIn: getting configAssistantParmas.

Jun 20, 2017 9:33:41 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: ... GenericInternalPlugIn: checking secretArguments.

Jun 20, 2017 9:33:41 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: ... GenericInternalPlugIn: starting read loop.

Jun 20, 2017 9:33:45 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read: SYS_PASSWORD_PROMPT

Jun 20, 2017 9:33:45 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Processing: SYS_PASSWORD_PROMPT for argument tag -sysAsmPassword

Jun 20, 2017 9:33:45 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read: ASMSNMP_PASSWORD_PROMPT

Jun 20, 2017 9:33:45 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Processing: ASMSNMP_PASSWORD_PROMPT for argument tag -asmMonitorPassword

Jun 20, 2017 9:33:45 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: End of argument passing to stdin

Jun 20, 2017 9:33:46 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read:

Jun 20, 2017 9:33:46 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read: PostConfiguration completed successfully

Jun 20, 2017 9:33:46 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read:

perform - mode finished for action: configure

You can see the log file: /apps/oracle/11.2.0/grid/cfgtoollogs/oui/configActions2017-06-20_09-32-40-AM.log

[grid@node1 cfgtoollogs]$

3.3 檢查集羣狀態

# su  - grid

$ crsctl stat res -t -init

3.4 靜默安裝RDBMS 軟件

注意一下,咱們在圖形方式安裝的時候只要建立ORACLE_BASE目錄便可,家目錄會自動建立,但靜默方式不能夠

su - oracle

#編輯配置響應文件db.rsp

su - oracle

cat > ${HOME}/db_install.rsp << EOF

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

oracle.install.option=INSTALL_DB_SWONLY

UNIX_GROUP_NAME=oinstall

SELECTED_LANGUAGES=en,zh_CN

oracle.install.db.InstallEdition=EE

oracle.install.db.EEOptionsSelection=false

oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0

oracle.install.db.DBA_GROUP=dba

oracle.install.db.OPER_GROUP=oper

oracle.install.db.isRACOneInstall=

oracle.install.db.racOneServiceName=

oracle.install.db.config.starterdb.memoryOption=true

oracle.install.db.config.starterdb.installExampleSchemas=false

oracle.install.db.config.starterdb.enableSecuritySettings=true

oracle.install.db.config.starterdb.password.SYS=

oracle.install.db.config.starterdb.password.SYSTEM=

oracle.install.db.config.starterdb.password.SYSMAN=

oracle.install.db.config.starterdb.password.DBSNMP=

oracle.install.db.config.starterdb.control=DB_CONTROL

oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=

oracle.install.db.config.starterdb.automatedBackup.enable=false

oracle.install.db.config.starterdb.automatedBackup.osuid=

oracle.install.db.config.starterdb.automatedBackup.ospwd=

oracle.install.db.config.starterdb.storageType=ASM_STORAGE

oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=

oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

MYORACLESUPPORT_USERNAME=

MYORACLESUPPORT_PASSWORD=

SECURITY_UPDATES_VIA_MYORACLESUPPORT=

DECLINE_SECURITY_UPDATES=true

PROXY_HOST=

PROXY_PORT=

PROXY_USER=

PROXY_PWD=

PROXY_REALM=

COLLECTOR_SUPPORTHUB_URL=

oracle.installer.autoupdates.option=SKIP_UPDATES

oracle.installer.autoupdates.downloadUpdatesLoc=

AUTOUPDATES_MYORACLESUPPORT_USERNAME=

AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

INVENTORY_LOCATION=/apps/oracle/oraInventory

ORACLE_HOME=/apps/oracle/database/11.2/db_1

ORACLE_BASE=/apps/oracle/database

ORACLE_HOSTNAME=node1

oracle.install.db.CLUSTER_NODES=node1,node2

oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

oracle.install.db.config.starterdb.globalDBName=orcl

oracle.install.db.config.starterdb.SID=orcl

oracle.install.db.config.starterdb.characterSet=ZHS16GBK

oracle.install.db.config.starterdb.memoryLimit=800

oracle.install.db.config.starterdb.password.ALL=oracle

oracle.install.db.config.asm.diskGroup=DATADG

oracle.install.db.config.asm.ASMSNMPPassword=oracle

EOF

#執行靜默安裝

su - oracle

cd /apps/soft/database/

./runInstaller -ignorePrereq -silent -responseFile ${HOME}/db_install.rsp

-- 正常輸出以下

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB. Actual 22404 MB Passed

Checking swap space: must be greater than 150 MB. Actual 2970 MB Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-04-23_02-36-18PM. Please wait ...[oracle@dciscdb1 ~]$ You can find the log of this install session at:

/oracle/app/oraInventory/logs/installActions2016-04-23_02-36-18PM.log

--安裝過程10-30分鐘

As a root user, execute the following script(s):

1. /oracle/app/oracle/product/11.2.0/db_1/root.sh

-- 分別在全部節點上執行root.sh腳本

# /oracle/app/oracle/product/11.2.0/db_1/root.sh

3.5 靜默DBCA建庫

先使用asmca建立ASM卷組,再使用dbca建立數據庫

#建立DATA卷

su - grid

$ asmca -silent -createDiskGroup -diskString '/dev/raw/*' -diskGroupName DATA -disk '/dev/raw/raw2' -redundancy EXTERNAL

Disk Group DATA created successfully.

su – oracle

[oracle@node1 ~]$ cat ~/dbca.rsp

[GENERAL]

RESPONSEFILE_VERSION = "11.2.0"

OPERATION_TYPE = "createDatabase"

[CREATEDATABASE]

GDBNAME = "orcl"

SID = "orcl"

TEMPLATENAME = "General_Purpose.dbc"

STORAGETYPE=ASM

DISKGROUPNAME=DATADG

NODELIST=node1,node2

CHARACTERSET = "ZHS16GBK"

NATIONALCHARACTERSET = "AL16UTF16"

DATABASETYPE = "OLTP"

SYSPASSWORD = "oracle"

SYSTEMPASSWORD = "oracle"

ASMSNMP_PASSWORD = "oracle"

[oracle@node1 ~]$

dbca -silent -responseFile ${HOME}/dbca.rsp

 

-- 檢查數據庫狀態

su – grid

crsctl status res –t –init

crsctl status res -t

相關文章
相關標籤/搜索