大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
这期内容当中小编将会给大家带来有关Oracle中怎么利用Openfiler实现共享存储,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。
创新互联建站服务项目包括宁蒗网站建设、宁蒗网站制作、宁蒗网页制作以及宁蒗网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,宁蒗网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到宁蒗省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!1、root用户,rac1、rac2关闭防火墙
停止firewall
systemctl stop firewalld.service
禁止firewall开机启动
systemctl disable firewalld.service
查看防火墙状态
firewall-cmd --state
关闭selinux
vi /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
2、root用户,rac1、rac2 修改hosts文件
vi /etc/hosts
#public ip
192.168.0.95 rac1
192.168.0.97 rac2
#priv ip
10.10.0.95 rac1-prv
10.10.0.97 rac2-prv
#vip ip
192.168.0.96 rac1-vip
192.168.0.98 rac2-vip
#scan ip
192.168.0.102 rac-scan
#iscsi
192.168.0.91 iscsi
3、root用户,rac1、rac2 安装依赖包
yum install -y binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc
yum install -y glibc.i686 glibc-devel glibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686
yum install -y libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 libXext
yum install -y libXext.i686 libXtst libXtst.i686 libX11 libX11.i686 libXau libXau.i686 libxcb libxcb.i686 libXi
yum install -y libXi.i686 make sysstat unixODBC unixODBC-devel readline libtermcap-devel pdksh
yum install -y smartmontools net-tools lrzsz unzip xdpyinfo compat-libstdc++ iscsi-initiator-utils nfs-utils
4、root用户,rac1、rac2 创建用户及用户组
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 505 asmoper
groupadd -g 506 asmdba
useradd -g oinstall -G dba,asmdba,oper oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
设置grid、oracle密码
passwd grid
passwd oracle
5、root用户,rac1、rac2 创建文件目录
mkdir -p /u01/app/grid
mkdir -p /u01/app/grid/soft
mkdir -p /u01/app/12.2.01/grid
chown -R grid:oinstall /u01
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/soft
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01
6、root用户,rac1、rac2 修改20-nproc.conf
vi /etc/security/limits.d/20-nproc.conf
# Change this
#注释这行* soft nproc 1024
# To this增加下面一行
* - nproc 16384
7、root用户,rac1、rac2 修改limits.conf
vi /etc/security/limits.conf
#ORACLE SETTING
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
8、root用户,rac1、rac2 修改login
vi /etc/pam.d/login
#ORACLE SETTING
session required pam_limits.so
9、root用户,rac1、rac2 修改/etc/systemd/logind.conf文件
vi /etc/systemd/logind.conf
RemoveIPC=no
重新reload
systemctl daemon-reload
10、root用户,rac1、rac2 修改sysctl.conf
vi /etc/sysctl.conf
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 61847529062 #物理内存*1024*1024*1024*0.9
kernel.shmall = 15099494 #shmmax/1024/4
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
11、root用户,rac1、rac2 添加NOZEROCONF=yes参数
vi /etc/sysconfig/network
NOZEROCONF=yes
12、root用户,rac1、rac2 重启
reboot
13、grid用户,rac1 配置环境变量
su - grid
vi ~/.bash_profile
export PS1="[`whoami`@`hostname`:"'$PWD]$'
umask 022
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac1
export ORACLE_SID=+ASM1
export ORACLE_TERM=xterm
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/12.2.01/grid
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export THREADS_FLAG=native
export DISPLAY=192.168.0.99:0.0
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
14、grid用户,rac2 配置环境变量
su - grid
vi ~/.bash_profile
export PS1="[`whoami`@`hostname`:"'$PWD]$'
umask 022
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac2
export ORACLE_SID=+ASM2
export ORACLE_TERM=xterm
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/12.2.01/grid
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export THREADS_FLAG=native
export DISPLAY=192.168.0.99:0.0
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
15、oracle用户,rac1 配置环境变量
su - oracle
vi ~/.bash_profile
export PS1="[`whoami`@`hostname`:"'$PWD]$'
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac1
export ORACLE_UNQNAME=rac1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.01/db_1
export ORACLE_SID=rac1
export ORACLE_TERM=xterm
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/12.2.01/db_1/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export THREADS_FLAG=native
export DISPLAY=192.168.0.99:0.0
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
16、oracle用户,rac2 配置环境变量
su - oracle
vi ~/.bash_profile
export PS1="[`whoami`@`hostname`:"'$PWD]$'
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac2
export ORACLE_UNQNAME=rac2
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.01/db_1
export ORACLE_SID=rac2
export ORACLE_TERM=xterm
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/12.2.01/db_1/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export THREADS_FLAG=native
export DISPLAY=192.168.0.99:0.0
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
17、root用户,rac1,rac2 配置环境变量
su - root
vi ~/.bash_profile
PATH=$PATH:/u01/app/12.2.01/grid/bin:$HOME/bin
export PATH
18、root用户,rac1,rac2 安装cvuqdisk-1.0.10-1
cd /usr/local/src
上传文件包
rz
安装
export CVUQDISK_GRP=oinstall
rpm -ivh cvuqdisk-1.0.10-1.rpm
19、root、grid、oracle用户,rac1配置免密互信su -root
ssh-keygen
ssh-copy-id root@rac2
su - grid
ssh-keygen
ssh-copy-id grid@rac2
su - oracle
ssh-keygen
ssh-copy-id oracle@rac2
20、root、grid、oracle用户,rac2配置免密互信su -root
ssh-keygen
ssh-copy-id root@rac1
su - grid
ssh-keygen
ssh-copy-id grid@rac1
su - oracle
ssh-keygen
ssh-copy-id oracle@rac1
21、root用户,rac1,rac2 配置共享磁盘
扫描
iscsiadm -m discovery -t sendtargets -p iscsi
配置手动登录
iscsiadm -m node -T iqn.2006-01.com.openfiler:rac.ocr -p iscsi -l
iscsiadm -m node -T iqn.2006-01.com.openfiler:rac.fra -p iscsi -l
iscsiadm -m node -T iqn.2006-01.com.openfiler:rac.data -p iscsi -l
检查磁盘
fdisk -l |grep /dev
重建
dd if=/dev/zero of=/dev/sdb bs=1024 count=2056
dd if=/dev/zero of=/dev/sdc bs=1024 count=2056
dd if=/dev/zero of=/dev/sdd bs=1024 count=2056
dd if=/dev/zero of=/dev/sde bs=1024 count=2056
dd if=/dev/zero of=/dev/sdf bs=1024 count=2056
查找WWID
for i in `cat /proc/partitions | awk {'print $4'} |grep sd`; do echo "### $i: `/lib/udev/scsi_id --whitelist --replace-whitespace /dev/$i`"; done
绑定磁盘
vi /etc/udev/rules.d/55-openiscsi.rules
#/etc/udev/rules.d/55-openiscsi.rules
KERNEL=="sd*",BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",
SYMLINK+="iscsi/%c/part%n",OWNER="grid",GROUP="oinstall",MODE="0660"
~
mkdir -p /etc/udev/scripts
vi /etc/udev/scripts/iscsidev.sh
#!/bin/sh
# FILE:/etc/udev/scripts/iscsidev.sh
BUS=${1}
HOST=${BUS%%:*}
[ -e/sys/class/iscsi_host ] || exit 1
file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/
targetname"
target_name=$(cat${file})
# This is not anopen-scsi drive
if [ -z"${target_name}" ]; then
exit 1
fi
# Check if QNAPdrive
check_qnap_target_name=${target_name%%:*}
if [ $check_qnap_target_name= "iqn.2006-01.com.openfiler" ]; then
target_name=`echo"${target_name%.*}"`
fi
echo"${target_name##*.}"
授权
chmod 775 /etc/udev/scripts/iscsidev.sh
重启
reboot
22、grid用户,rac1安装grid
上传文件
su - grid
[grid@rac1:/u01]$cd /u01/app/grid/soft
[grid@rac1:/u01/soft]$rz
linuxx64_12201_grid_home
解压文件
unzip linuxx64_12201_grid_home.zip
删除压缩包节约空间
[grid@rac1:/u01/soft]$rm -rf linuxx64_12201_grid_home.zip
验证
./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup -verbose
如果报PRVE-0421 : No entry exists in /etc/fstab for mounting /dev/shm
可忽略掉
进行安装
./gridSetup.sh
如果磁盘状态为Member的话,执行重建
dd if=/dev/zero of=/dev/sdb bs=1024 count=2056
23、grid用户,rac1查看集群状态
cd /u01/soft/grid/bin
./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM.lsnr ora....er.type ONLINE ONLINE rac1
ora.CRS.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....AF.lsnr ora....er.type OFFLINE OFFLINE
ora....N1.lsnr ora....er.type ONLINE ONLINE rac1
ora.MGMTLSNR ora....nr.type ONLINE ONLINE rac1
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.chad ora.chad.type ONLINE ONLINE rac1
ora.cvu ora.cvu.type ONLINE ONLINE rac1
ora.mgmtdb ora....db.type ONLINE ONLINE rac1
ora....network ora....rk.type ONLINE ONLINE rac1
ora.ons ora.ons.type ONLINE ONLINE rac1
ora.qosmserver ora....er.type ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
24、grid用户、rac1创建磁盘组
asmca
创建DATA和FRA磁盘组
24、oracle用户,rac1安装Oracle数据库软件
mkdir -p /u01/app/soft/
cd /u01/app/soft/
rz
linuxx64_12201_database.zip
unzip linuxx64_12201_database.zip
rm -rf linuxx64_12201_database.zip
cd database/
./runInstaller
重建完成的图忘记截了(直接点完成就好了)
25、oracle用户,rac1安装数据库
dbca
上述就是小编为大家分享的Oracle中怎么利用Openfiler实现共享存储了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注创新互联-成都网站建设公司行业资讯频道。