详细文档图形化,可以参考上一篇的附件 OEL 安装配置
本地yum 先传解压镜像的文件包
[root@rac01 ~]# ls
anaconda-ks.cfg CentOS-6.8-x86_64-bin-DVD1 install.log install.log.syslog pdksh-5.2.14-30.x86_64.rpm 公共的 模板 视频 图片 文档 下载 音乐 桌面
[root@rac01 ~]# cd CentOS-6.8-x86_64-bin-DVD1
[root@rac01 CentOS-6.8-x86_64-bin-DVD1]# ls
CentOS_BuildTag EULA images Packages repodata RPM-GPG-KEY-CentOS-Debug-6 RPM-GPG-KEY-CentOS-Testing-6
EFI GPL isolinux RELEASE-NOTES-en-US.html RPM-GPG-KEY-CentOS-6 RPM-GPG-KEY-CentOS-Security-6 TRANS.TBL
[root@rac01 CentOS-6.8-x86_64-bin-DVD1]# cd Packages/
---------------------------------------------------------------------------------------
[root@rac01 Packages]# cd /etc/yum.repos.d
[root@rac01 yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Vault.repo
[root@rac01 yum.repos.d]# rm -rf *
[root@rac01 yum.repos.d]# vi local.repo
[kingsql]
name=This is kingsql repo
baseurl=file:///rpm/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
---------------------------------------------------------------------------------------
[root@rac01 yum.repos.d]# mkdir -p /rpm
[root@rac01 yum.repos.d]# cd /rpm
[root@rac01 rpm]cp /root/CentOS-6.8-x86_64-bin-DVD1/Packages/* /rpm/
复制下面的rpm 包
rpm -ivh vsftpd-2.2.2-12.el6_5.1.x86_64.rpm
rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
rpm -ivh libxml2-2.7.6-14.el6_5.2.x86_64.rpm
rpm -ivh libxml2-python-2.7.6-14.el6_5.2.x86_64.rpm
rpm -ivh createrepo-0.9.9-22.el6.noarch.rpm
[root@rac01 rpm]# createrepo ./
Spawning worker 0 with 3204 pkgs
Worker 0: error: rpmts_HdrFromFdno: headerRead failed: Header sanity check: OK
Worker 0: Error: Could not open local rpm file: /rpm/.//bzr-2.1.1-2.el6.x86_64.rpm: RPM Error opening Package 正在进行
[root@rac01 rpm]# yum clean all
[root@rac01 rpm]# yum makecache
[root@rac01 rpm]#yum install libXp* xterm* unixODBC* sysstat* make* libstdc++* libgomp* libgcc* libaio* kernel-headers* glibc* gcc* elfutils* binutils* bind bind-devel bind-chroot caching-nameserver compat-libcap1* compat-libstdc++-33* openssh* xdpyinfo vi unzip
[root@rac01 ~]# rpm -ivh pdksh-5.2.14-30.x86_64.rpm
--------------------------------------------------------------------------------------------
[root@rac01 ~]# chkconfig iptables off
[root@rac01 ~]# service iptables stop
--------------------------------------------------------------------------------------------
[root@rac01 ~]# vi /etc/selinux/config
--------------------------------------------------------------------------------------------
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
--------------------------------------------------------------------------------------------
groupadd -g 2000 oinstall
groupadd -g 2200 asmadmin
groupadd -g 2201 asmdba
groupadd -g 2202 asmoper
groupadd -g 2300 dba
groupadd -g 2301 oper
useradd -m -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -s /bin/bash -c "Grid Infrastructure Owner" grid
useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
passwd grid
passwd oracle
mkdir -p /opt/ora11g/grid
mkdir -p /opt/ora11g/11.2.4/grid
chown -R grid:oinstall /opt
mkdir -p /opt/ora11g/oracle
chown oracle:oinstall /opt/ora11g/oracle
chmod -R 775 /opt
--------------------------------------------------------------------------------------------
su - oracle
--------------------------------------------------------------------------------------------
[oracle@rac1 ~]$ vi .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
--------------------------------------------------------------------------------------------
export ORACLE_BASE=/opt/ora11g/oracle
export ORACLE_HOME=/opt/ora11g/oracle/product/11.2.4/dbhome_1
export ORACLE_SID=kingsql1
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=/opt/ora11g/ogg:$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=/opt/ora11g/ogg:$ORACLE_HOME/lib:/lib:/usr/lib:$LD_LIBRARY_PATH
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export
export ORACLE_UNQNAME=kingsql
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
--------------------------------------------------------------------------------------------
su - grid
[grid@rac1 ~]$ vi .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
export ORACLE_BASE=/opt/ora11g/grid
export ORACLE_HOME=/opt/ora11g/11.2.4/grid
export ORACLE_SID=+ASM1
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
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
export
----------------------------------------------------------------------------------------------
su - root
vi /etc/sysctl.conf
----------------------------------------------------------------------------------------------
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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@rac01 ~]# /sbin/sysctl -p
----------------------------------------------------------------------------------------------
[root@rac01 ~]# vi /etc/security/limits.conf
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@rac01 ~]# vi /etc/pam.d/login
----------------------------------------------------------------------------------------------
session required pam_limits.so
[root@rac01 ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.102 rac01
192.168.56.102 rac02
192.168.56.111 rac01-vip
192.168.56.111 rac02-vip
192.168.1.74 rac01-priv
192.168.1.74 rac02-priv
192.168.56.158 cluster-scan
192.168.56.158 rac-cluster-scan 以上网址自己根据自己网址更改
-------------------------------------------------------------------------------------------
[root@rac1 ~]# service ntpd stop
关闭 ntpd: [失败]
[root@rac1 ~]# chkconfig ntpd off
[root@rac1 ~]# mv /etc/ntp.conf /etc/ntp.conf.original
[root@rac1 ~]# rm -rf /var/run/ntpd.pid
[root@rac01 ~]# shutdown -h now 关机 虚拟机创建磁盘 (磁盘设置成共享模式)
-------------------------------------------------------------------------------------------
[root@rac01 ~]# fdisk -l
--------------------------------------------------------------------------------------------
查磁盘号
[root@rac1 ~]# /sbin/scsi_id -u -g /dev/sdb
1ATA_VBOX_HARDDISK_VB1274608b-98003b66
[root@rac1 ~]# /sbin/scsi_id -u -g /dev/sdc
1ATA_VBOX_HARDDISK_VBbf237514-f3435ff0
[root@rac1 ~]# /sbin/scsi_id -u -g /dev/sdd
1ATA_VBOX_HARDDISK_VBc894130b-2f10eef0
[root@rac1 ~]# /sbin/scsi_id -u -g /dev/sde
1ATA_VBOX_HARDDISK_VB58f6ed82-b0dc76dc
[root@rac1 ~]# /sbin/scsi_id -u -g /dev/sdf
1ATA_VBOX_HARDDISK_VB0e0cbf34-6238f247
[root@rac1 ~]# /sbin/scsi_id -u -g /dev/sdg
1ATA_VBOX_HARDDISK_VB98788216-29530089
rac1编写文件然后copy到其他节点
--------------------------------------------------------------------------------------------
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="", NAME="asm-disk1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="", NAME="asm-disk2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBc894130b-2f10eef0", NAME="asm-disk3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB58f6ed82-b0dc76dc", NAME="asm-disk4", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB0e0cbf34-6238f247", NAME="asm-disk5", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB98788216-29530089", NAME="asm-disk6", OWNER="grid", GROUP="asmadmin", MODE="0660"
[root@rac1 ~]# scp /etc/udev/rules.d/99-oracle-asmdevices.rules rac02:/etc/udev/rules.d/99-oracle-asmdevices.rules
[root@rac01 ~]# start_udev
Starting udev: [ OK ]
--------------------------------------------------------------------------------------------
[root@rac1 ~]# ls -l /dev/asm*
brw-rw---- 1 grid asmadmin 8, 16 9月 18 11:49 /dev/asm-disk1
brw-rw---- 1 grid asmadmin 8, 32 9月 18 11:49 /dev/asm-disk2
brw-rw---- 1 grid asmadmin 8, 48 9月 18 11:49 /dev/asm-disk3
brw-rw---- 1 grid asmadmin 8, 64 9月 18 11:49 /dev/asm-disk4
brw-rw---- 1 grid asmadmin 8, 80 9月 18 11:49 /dev/asm-disk5
brw-rw---- 1 grid asmadmin 8, 96 9月 18 11:49 /dev/asm-disk6
--------------------------------------------------------------------------------------------
[root@rac01 ~]# mv p13390677_112040_Linux-x86-64_3of7.zip /home/grid/
--------------------------------------------------------------------------------------------
su - grid
--------------------------------------------------------------------------------------------
[grid@rac01 ~]$ unzip p13390677_112040_Linux-x86-64_3of7.zip
[grid@rac01 ~]$ cd grid/
[grid@rac01 grid]$ ls
install response runInstaller sshsetup welcome.html
readme.html rpm runcluvfy.sh stage
[grid@rac01 grid]$ cd rpm/
[grid@rac01 rpm]$ ls
cvuqdisk-1.0.9-1.rpm
--------------------------------------------------------------------------------------------
[grid@rac01 rpm]$ su root
Password:
--------------------------------------------------------------------------------------------
[root@rac1 ~]# rpm -ivh /home/grid/grid/rpm/cvuqdisk-1.0.9-1.rpm
Preparing... ########################################### [100%]
Using default group oinstall to install package
1:cvuqdisk ########################################### [100%]
--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------
su - grid
[grid@rac01 grid]$ ./runInstaller
[root@rac01 ~]# /opt/ora11g/oraInventory/orainstRoot.sh
[root@rac01 ~]# /opt/ora11g/11.2.4/grid/root.sh
[root@rac01 ~]# su - grid
[grid@rac01 ~]$ crsctl status res -t
[grid@rac01 ~]$ ping cluster-scan.kingsql.org
[root@rac01 ~]# ping rac01-vip
--------------------------------------------------------------------------------------------
[root@rac01 ~]# su - oracle
[oracle@rac01 ~]$
[oracle@rac01 ~]$ ls
--------------------------------------------------------------------------------------------
p13390677_112040_Linux-x86-64_1of7.zip p13390677_112040_Linux-x86-64_2of7.zip
[oracle@rac01 ~]$ unzip p13390677_112040_Linux-x86-64_1of7.zip
[oracle@rac01 ~]$ unzip p13390677_112040_Linux-x86-64_2of7.zip
--------------------------------------------------------------------------------------------
[oracle@rac01 database]$ ./runInstaller
--------------------------------------------------------------------------------------------
[root@rac01 ~]# /opt/ora11g/oracle/product/11.2.4/dbhome_1/root.sh
--------------------------------------------------------------------------------------------
[root@rac01 ~]# su - grid
[grid@rac01 ~]$ crsctl status res -t
[oracle@rac01 ~]$ dbca
--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------
[oracle@rac01 ~]$ sqlplus / as sysdba
--------------------------------------------------------------------------------------------
SQL> show parameter db_unique
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string kingsql
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
kingsql1
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@rac01 ~]$ exit
logout
[root@rac01 scripts]# su - grid
[grid@rac01 ~]$ crsctl status res 0t
CRS-2613: Could not find resource '0t'.
[grid@rac01 ~]$ crsctl status res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac01
ora.LISTENER.lsnr
ONLINE ONLINE rac01
ora.OCR.dg
ONLINE ONLINE rac01
ora.asm
ONLINE ONLINE rac01 Started
ora.gsd
OFFLINE OFFLINE rac01
ora.net1.network
ONLINE ONLINE rac01
ora.ons
ONLINE ONLINE rac01
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac01
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rac01
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rac01
ora.cvu
1 ONLINE ONLINE rac01
ora.kingsql.db
1 ONLINE ONLINE rac01 Open
ora.oc4j
1 ONLINE ONLINE rac01
ora.rac01.vip
1 ONLINE ONLINE rac01
ora.scan1.vip
1 ONLINE ONLINE rac01
ora.scan2.vip
1 ONLINE ONLINE rac01
ora.scan3.vip
1 ONLINE ONLINE rac01
[grid@rac01 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue May 15 00:59:29 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> show parameter db_unique
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string +ASM
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
+ASM1
SQL> quit