您好,登錄后才能下訂單哦!
1.主機名規劃
vps+3nZEm+sFS5WD4dGxwiwvZtf6bREdK/xxAZgDogXmgGiBOeARA6ZwOS08YsAShUcsbhy8d8Pt2CV2td8W8bG6Qf8HdZh7RPvzWmsAAAAASUVORK5CYII=">
2.OS安裝(具體過程略過)
swap規則: 內存<8G則物理內存2倍,>8G <16G 則等于物理內存,>16G物理內存一半
3.OS準備工作
(1).關閉防火墻
systemctl status firewalld 查看防火墻狀態
systemctl stop firewalld 關閉防火墻
systemctl disable firewalld 禁用防火墻
(2).關閉selinux
getenforce 查看selinux的模式
修改/etc/selinux/config 文件,SELINUX=enforce –> disable
#setenforce 0 配置生效
(3).設置FTP
查看 getsebool -a |grep ftp
修改權限
setsebool ftpd_use_nfs on
setsebool ftp_home_dir on
setsebool ftpd_full_access on
setsebool ftpd_use_passive_mode on
允許root登錄FTP
注釋掉ftpusers和user_list 中的root行
重啟服務systemctl restart vsftpd.service
(4).配置yum
刪除rm /etc/yum.repos.d/packagekit-media.repo
建立 local.repo 文件
[test]
name=test
baseurl="file:///run/media/root/RHEL-7.0 Server.x86_64"
gpgcheck=0
enable=1
# yum clean all
# yum list
(5). 根據官方文檔進行patch
The following packages (or later versions) must be installed:
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)
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)
libxcb-1.9-5.el7 (i686)
libxcb-1.9-5.el7 (x86_64)
libX11-1.6.0-2.1.el7 (i686)
libX11-1.6.0-2.1.el7 (x86_64)
libXau-1.0.8-2.1.el7 (i686)
libXau-1.0.8-2.1.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)
net-tools-2.0-0.17.20131004git.el7 (x86_64) (for Oracle RAC and Oracle Clusterware)
nfs-utils-1.3.0-0.21.el7.x86_64 (for Oracle ACFS)
smartmontools-6.2-4.el7 (x86_64)
sysstat-10.1.5-1.el7 (x86_64)
yum install binutils –y
yum install compat-libcap1.x86_64 –y
yum install glibc.i686 –y
yum install glibc.x86_64 –y
yum install glibc-devel.i686 -y
yum install glibc-devel.x86_64 –y
yum install libaio.i686 –y
yum install libaio.x86_64 -y
yum install libaio-devel.i686 –y
yum install libaio-devel.x86_64 –y
yum install libX11.i686 –y
yum install libX11.x86_64 –y
yum install libXau.i686 -y
yum install libXau.x86_64 –y
yum install libXi.x86_64 –y
yum install libXi.i686 –y
yum install libXtst.i686 –y
yum install libXtst.x86_64 –y
yum install libgcc.i686 –y
yum install libgcc.x86_64 –y
yum install libstdc++.i686 –y
yum install libstdc++.x86_64 –y
yum install libstdc++-devel.i686 –y
yum install libstdc++-devel.x86_64 –y
yum install libxcb.i686 -y
yum install libxcb.x86_64 –y
yum install make.x86_64 –y
yum install net-tools.x86_64 –y
yum install smartmontools.x86_64 –y
yum install sysstat.x86_64 –y
yum install ksh.x86_64 -y
(6).修改hosts文件
#public ip
xxx.xxx.xxx.xxx rac1
xxx.xxx.xxx.xxx rac2
#priv ip
xxx.xxx.xxx.xxx rac1-priv
xxx.xxx.xxx.xxx rac2-priv
#vip ip
xxx.xxx.xxx.xxx rac1-vip
xxx.xxx.xxx.xxx rac2-vip
#scan ip
xxx.xxx.xxx.xxx rac-scan
(7).添加組和用戶
groupadd -g 60001 oinstall
groupadd -g 60002 dba
groupadd -g 60003 oper
groupadd -g 60004 backupdba
groupadd -g 60005 dgdba
groupadd -g 60006 kmdba
groupadd -g 60007 asmdba
groupadd -g 60008 asmoper
groupadd -g 60009 asmadmin
useradd -u 61001 -g oinstall -G asmadmin,asmdba,dba,asmoper grid
useradd -u 61002 -g oinstall -G dba,backupdba,oper,dgdba,kmdba,asmdba,asmadmin oracle
(8).創建軟件安裝目錄
mkdir -p /oracle/app/grid
mkdir -p /oracle/app/12.2.0.1/grid
chown -R grid:oinstall /oracle
mkdir -p /oracle/app/oraInventory
chown -R grid:oinstall /oracle/app/oraInventory
mkdir -p /oracle/app/oracle
chown -R oracle:oinstall /oracle/app/oracle
chmod -R 775 /oracle
(9).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
(10)./etc/security/limits.d/20-nproc.conf
注釋* soft nproc 4096
添加* - nproc 16384
(11)./etc/pam.d/login
添加
#ORACLE SETTING
session required pam_limits.so
(12).修改內核參數
#vi /etc/sysctl.conf
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 524288
kernel.shmmax = 1610612736
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65500
# sysctl –p 配置生效
參考官方文檔
https://docs.oracle.com/database/122/LADBI/minimum-parameter-settings-for-installation.htm#LADBI-GUID-CDEB89D1-4D48-41D9-9AC2-6AD9B0E944E3
kernel | 說明 |
SHMMAX | Linux進程可以分配的單獨共享內存段的最大值。一般設置為內存總大小的一半。這個值的設置應該大于SGA_MAX_TARGET或MEMORY_MAX_TARGET的值 |
SHMMIN | 最小的內存segment的大小 |
shmall | 設置共享內存總頁數SHMMAX/4K |
(13).配置環境變量
grid
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
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=/oracle/app/grid
export ORACLE_HOME=/oracle/app/12.2.0.1/grid
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
export THREADS_FLAG=native
oracle
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
umask 022
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=rac1
export ORACLE_UNQNAME=racdb12c
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1
export ORACLE_SID=racdb12c1
export ORACLE_TERM=xterm
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
export THREADS_FLAG=native
(14).配置SSH
在主節點上以grid,oracle用戶身份生成公鑰和私鑰
mkdir ~/.ssh
ssh-keygen -t rsa
ssh-keygen -t dsa
在另外的節點上執行相同的操作
在1節點使用oracle(grid)用戶執行以下操作
cat ~/.ssh/id_rsa.pub >> ./.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ./.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
在1,2節點上測試ssh
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
4.修改虛擬機配置文件(.vmx),添加以下內容
disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
disk.EnableUUID = "TRUE"
scsi1.sharedBus = "VIRTUAL"
5.配置共享存儲
Name |
Size |
dggrid1 |
40GB |
dggrid2 |
10GB |
dgsystem |
21GB |
dgrecover |
22GB |
dgdata1 |
23GB |
dgdata2 |
24GB |
(1).編輯/etc/scsi_id.config,添加下面內容
options=--whitelisted --replace-whitespace
(2).獲取需要綁定ASM Disk磁盤的uuid
for i in b c d e f g;
do
echo "sd$i" "`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`";
done
sdb 36000c29b0e11cfc09873aa3dc45baf3e
sdc 36000c293313041c3f662d837263cbef3
sdd 36000c2908886e8ba4e0e6b410b456616
sde 36000c29cb127c1af8c28efd8af0d92d4
sdf 36000c29ecd42be581ecb6d8f2b37e2f1
sdg 36000c29e8abe980615022c02a11960d1
(3).編寫udev rules 文件
for i in b c d e f g;
do
echo "KERNEL==\"sd*\",BUS==\"scsi\",PROGRAM==\"/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\",RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\",NAME=\"asm-disk$i\",OWNER=\"grid\",GROUP=\"asmadmin\",MODE=\"0660\""
done
redhat 7
for i in b c d e f g;
do
echo "KERNEL==\"sd*\", ENV{DEVTYPE}==\"disk\", SUBSYSTEM==\"block\", PROGRAM==\"/usr/lib/udev/scsi_id -g -u -d \$devnode\", RESULT==\"`/usr/lib/udev/scsi_id -g -u /dev/sd$i`\", RUN+=\"/bin/sh -c 'mknod /dev/asmdisk$i b \$major \$minor; chown grid:asmadmin /dev/asmdisk$i; chmod 0660 /dev/asmdisk$i'\""
done
KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c2952c880a7bd3b532de2be6e7c1", RUN+="/bin/sh -c 'mknod /dev/asm-dggrid1 b $major $minor; chown grid:asmadmin /dev/asm-dggrid1; chmod 0660 /dev/asm-dggrid1'"
KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29d8069ccccdc4254861e4de50a", RUN+="/bin/sh -c 'mknod /dev/asm-dggrid2 b $major $minor; chown grid:asmadmin /dev/asm-dggrid2; chmod 0660 /dev/asm-dggrid2'"
KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29228ddf02cfb4e980a4a06fbdc", RUN+="/bin/sh -c 'mknod /dev/asm-dgsystem b $major $minor; chown grid:asmadmin /dev/asm-dgsystem; chmod 0660 /dev/asm-dgsystem'"
KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29f3195a284faae34072f347a93", RUN+="/bin/sh -c 'mknod /dev/asm-dgrecover b $major $minor; chown grid:asmadmin /dev/asm-dgrecover; chmod 0660 /dev/asm-dgrecover'"
KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c298e69bb4ea5bf85d9b9b49fd02", RUN+="/bin/sh -c 'mknod /dev/asm-dgdata1 b $major $minor; chown grid:asmadmin /dev/asm-dgdata1; chmod 0660 /dev/asm-dgdata1'"
KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c2918d25c19177895d053c751663", RUN+="/bin/sh -c 'mknod /dev/asm-dgdata2 b $major $minor; chown grid:asmadmin /dev/asm-dgdata2; chmod 0660 /dev/asm-dgdata2'"
# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
#/sbin/udevadm trigger --type=devices --action=change
(4).重啟udev設備
/sbin/udevadm control –reload-rules
/sbin/start_udev #redhat7 整合到systemctl restart systemd-udev-trigger.service 中
ll /dev/asm*
6.安裝VNC
#yum install libvncserver.x86_64 –y
#yum install tigervnc.x86_64 –y
#yum install tigervnc-server.x86_64 –y
# vncserver 開啟服務并設置密碼
7.安裝cvuqdisk包并驗證(所有節點都裝)
# cd /tmp/wwj/GI/cv/rpm
# export CVUQDISK_GRP=oinstall
# rpm -ivh cvuqdisk-1.0.10-1.rpm
./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup –verbose
./runcluvfy.sh stage –post hwos –n rac1,rac2 –verbose
8.安裝GI
su – grid
cd $ORACLE_HOME
unzip -q download_location/grid.zip
執行安裝腳本
gridSetup.sh
安裝后檢查
[root@rac1 ~]# crsctl status res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.DGGRID1.dg
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.net1.network
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.ons
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.proxy_advm
OFFLINE OFFLINE rac1 STABLE
OFFLINE OFFLINE rac2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1 STABLE
ora.MGMTLSNR
1 OFFLINE OFFLINE STABLE
ora.asm
1 ONLINE ONLINE rac1 Started,STABLE
2 ONLINE ONLINE rac2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE rac1 STABLE
ora.qosmserver
1 ONLINE ONLINE rac1 STABLE
ora.rac1.vip
1 ONLINE ONLINE rac1 STABLE
ora.rac2.vip
1 ONLINE ONLINE rac2 STABLE
ora.scan1.vip
1 ONLINE ONLINE rac1 STABLE
[root@rac1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 4
Total space (kbytes) : 409568
Used space (kbytes) : 1848
Available space (kbytes) : 407720
ID : 1005996313
Device/File Name : +DGGRID1
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
[root@rac1 ~]# crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 90f6afc163534f18bf96e54a9bf239db (/dev/asm-grid1) [DGGRID1]
Located 1 voting disk(s).
9.創建ASM磁盤組
su – grid
$asmca
添加OCR磁盤組
[root@rac1 ~]# ocrconfig -add +dggrid2
[root@rac1 ~]# ocrcheck
10.安裝數據庫軟件
su – oracle
export LANG=en_US
./runInstaller
11.創建數據庫
$dbca
SGA大小設置為物理內存的45%~55%
PGA大小設置為物理內存的80%的20%
數據文件不要超過30G
每個表空間設置20G,取消自動擴展
日志文件
至少8個組 每個redo 200m
12.調整歸檔
SQL> alter system set cluster_database=FALSE scope=spfile;
System altered.
關閉數據庫
srvctl stop database –d racdb12c –o immediate
啟動1節點數據庫
SQL>startup mount
SQL> alter system set log_archive_dest_1='location=+DGRECOVER' scope=spfile;
System altered.
SQL>alter database archivelog;
重啟數據庫
srvctl start database –d racdb12c
修改sqlnet.ora,使其他版本客戶端可以連接12c數據庫
SQLNET.ALLOWED_LOGON_VERSION_SERVER=10
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=10
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。