您好,登錄后才能下訂單哦!
這期內容當中小編將會給大家帶來有關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實現共享存儲了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。