Redhat 7.3 +ORACLE 12.2C RAC ASM+UDEV+FAILGROUP
這是參考ORACLE FC+ASM+UDEV+FAILGROUP,自已搭建的基於ORACLE12.2.0.1.0,用兩臺主機加VM的5臺虛擬機器實現該個實驗搭建。
Redhat extent rac
一.環境規劃
主機IP,主機名
hostname | public_ip | priv-ip | vip | sid | scan-ip | |
---|---|---|---|---|---|---|
exrac1 | 192.168.0.70 | 192.168.4.30 | 192.168.0.71 | extora1 | 192.168.0.74 | |
exrac2 | 192.168.0.75 | 192.168.4.31 | 192.168.0.73 | extora2 | 192.168.0.74 |
ASM磁碟組
DATA(10G) | FRA(5G) | REDO(2G) | OCR(8G) | GIMR(40G) | T_OCR(8G) | |
---|---|---|---|---|---|---|
FGA | DATA_A | FRA_A | REDO_A | OCR_A | GIMR_A | T_OCR |
FGB | DATA_B | FRA_B | REDO_B | OCR_B | GIMR_B | |
FGQ | /OCR/VOTE_DISK | |||||
資料檔案 | 歸檔檔案 | 日誌檔案 | OCR檔案 | 資料管理庫 | 臨時OCR盤 |
儲存規劃
儲存A (內網IP 192.168.4.40,外網問IP 192.168.0.40)
卷 | 容量 | 備註 |
---|---|---|
OCR_A | 8G | |
FRA_A | 5G | |
REDO_A | 2G | |
GIMR_A | 40G | |
DATA_A | 10G | |
T_OCR | 8G |
儲存B(內網IP 192.168.4.41,外網問IP 192.168.0.42)
卷 | 容量 | 備註 |
---|---|---|
OCR_B | 8G | |
FRA_B | 5G | |
REDO_B | 2 | |
GIMR_B | 40G | |
DATA_B | 10G | |
NFS
卷 | 容量 | 備註 |
---|---|---|
/ocr/vote_disk | 8g |
二、儲存部置
1.儲存A
-
BLOCK DEVICE MANAGERMENT
-
VOLUME GROUP MANAGEMENT
T_OCR
OCR_A
GIMR-A
Manage Services
把 ISCSCI TARGET 點選modify boot 的ENABLE 把CURRENT STATUS置為RUNNING 也就是點選START
TARGET CONFIGURATION
這裡儲存A為iqn.2020-08.com.openfiler:tsn.extend1
LUNS MAPPING
2.儲存B
-
BLOCK Device Management
-
VOLUME GROUP MANAGEMENT
gimr-b
data-b
fra-b
ocr-b
NETWORK ACCESS CONFIGURATION
這裡的網段為 192.168.0.0,192.168.4.0
Manage Services
把 ISCSCI TARGET 點選modify boot 的ENABLE 把CURRENT STATUS置為RUNNING 也就是點選START
TARGET CONFIGURATION
這裡儲存B為iqn.2020-08.com.openfiler:tsn.extend2
三、在兩臺伺服器連線二臺儲存
1.伺服器A連線儲存A
#在iscsid.conf進行修改,把使用者和密碼設定好
vi /etc/iscsi/iscsid.conf
node.session.auth.authmethod = CHAP
# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
node.session.auth.username = root
node.session.auth.password = password123
儲存退出後
重啟一下 ISCISID 服務
systemctl restart iscsid.service
#探測儲存伺服器
iscsiadm -m discovery -t sendtargets -p 192.168.4.40
#掛載目標
iscsiadm -m node -T iqn.2020-08.com.openfiler:tsn.extent1 -p 192.168.4.40:3260 -l
然後
fdisk -l
2.伺服器A連線儲存B
#探測儲存伺服器
iscsiadm -m discovery -t sendtargets -p 192.168.4.41
#掛載目標
iscsiadm -m node -T iqn.2020-08.com.openfiler:tsn.extent2 -p 192.168.4.41:3260 -l
然後
fdisk -l
3.伺服器B連線儲存A
#在iscsid.conf進行修改,把使用者和密碼設定好
vi /etc/iscsi/iscsid.conf
node.session.auth.authmethod = CHAP
# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
node.session.auth.username = root
node.session.auth.password = password123
儲存退出後
重啟一下 ISCISID 服務
systemctl restart iscsid.service
#探測儲存伺服器
iscsiadm -m discovery -t sendtargets -p 192.168.4.40
#掛載目標
iscsiadm -m node -T iqn.2020-08.com.openfiler:tsn.extend1 -p 192.168.4.40:3260 -l
4.伺服器B連線儲存B
#探測儲存伺服器
iscsiadm -m discovery -t sendtargets -p 192.168.4.41
#掛載目標
iscsiadm -m node -T iqn.2020-8.com.openfiler:tsn.extend2 -p 192.168.4.41:3260 -l
然後
fdisk -l
四 修改/etc/hosts
vi /etc/hosts
#public ip
192.168.0.70 exrac1
192.168.0.75 exrac2
#vip
192.168.0.71 exrac1-vip
192.168.0.73 exrac2-vip
#private ip
192.168.4.40 exrac1-priv
192.168.4.41 exrac2-priv
#scan ip
192.168.0.79 exrac-cluster-scan
五、核心引數檔案
vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
#shmmax=(8*1024*1024*1024*0.9)
kernel.shmmax = 7730941132
#shmall=(2*1024*1024*0.9)
kernel.shmall = 1887436
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_rmem=4096 87380 4194304
net.ipv4.tcp_wmem=4096 16384 4194304
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
#net.ipv4.conf.default.arp_filter = 2
#net.ipv4.conf.all.rp_filter = 2
然後
sysctl -p
六、修改資源限制檔案
vi /etc/security/limits.conf
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
七、關閉防火牆
systemctl stop firewalld.service
systemctl disable firewalld.service
八、關閉 SELINUX
vi /etc/selinux/config
selinux=disabled
九 配置MTU引數(心跳網路將mtu調大至9000):
vi /etc/sysconfig/network-scripts/ifcfg-ens39
MTU=9000
十 配置YUM源
mkdir /mnt/system
mount -o loop rhel-server-7.3-x86_64-dvd.iso /mnt/system
cd /etc/yum.repos.d/
vi rhel.repo
[rhel7]
name=rhel7
baseurl=file:///mnt/system
enabled=1
gpgcheck=0
修改共享記憶體分割槽大小
將如下引數新增到/etc/fstab,具體大小數值根據實際情況調整,因為這個數值和實體記憶體以及MEMORY_TARGET有關。
echo shm /dev/shm tmpfs size=12g 0 0 >> /etc/fstab
修改後,只需重新對shm進行掛載即可:
mount -o remount /dev/shm
十一通過YUM命令安裝RPM
yum -y install bc binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 e2fsprogs e2fsprogs-libs glibc glibc.i686 glibc-devel glibc-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 libX11 libX11.i686 libXau libXau.i686 libXi libXi.i686 libXtst libXtst.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libxcb libxcb.i686 make smartmontools sysstat unzip lrzsz openssh-clients libXrender-devel.i686 libXrender-devel.x86_64 gcc gcc-c++ ksh elfutils-libelf-devel.x86_64
十二。建立使用者
groupadd -g 500 oinstall
groupadd -g 501 dba
groupadd -g 502 oper
groupadd -g 503 asmadmin
groupadd -g 504 asmdba
groupadd -g 505 asmoper
useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
useradd -u 502 -g oinstall -G dba,asmdba,asmadmin oracle
passwd grid
passwd oracle
十三、建立相關目錄
mkdir -p /u01/app/oracle
mkdir -p /u01/app/grid
mkdir -p /u01/app/grid_base
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01
chown -R grid:oinstall /u01/app/grid
chown -R grid:oinstall /u01/app/grid_base
chown -R oracle:oinstall /u01/app/oracle
chown -R grid:oinstall /u01/app/oraInventory
chmod -R 775 /u01
啟動NSCD服務
yum install -y nscd
systemctl enable nscd.service
systemctl start nscd.service
systemctl status nscd.service
十四、禁用NTP
systemctl stop ntpd.service
systemctl disable ntpd.service
mv /etc/ntp.conf /etc/ntp.conf.original
關閉LINUX透明大頁
修改/etc/default/grub檔案,如下是修改之後的效果:
[root@rac1 default]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rhgb quiet transparent_hugepage=never" ---->>> transparent_hugepage=never是新加的
GRUB_DISABLE_RECOVERY="true"
[root@rac1 default]# grub2-mkconfig -o /boot/grub2/grub.cfg ---->>執行該命令
關閉transparent_hugepage的配置
vi /etc/rc.local #註釋:編輯rc.local檔案,增加以下內容
if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi
修改NSSWITCH.CONF
vi /etc/nsswitch.conf
修改行
hosts: files dns
為
hosts: files dns nis
配置NOZEROCONF
vi /etc/sysconfig/network增加以下內容
NOZEROCONF=yes
檢查 cat /sys/block/sda/queue/scheduler
noop [deadline] cfq
十五 停止avahi-daemon服務
systemctl stop avahi-dnsconfd
systemctl stop avahi-daemon
systemctl disable avahi-dnsconfd
systemctl disable avahi-daemon
十六、配置使用者環境變數i
1.GRID
vi /home/grid/.bash_profile
export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/grid_base
export ORACLE_HOME=/u01/app/grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export PATH=$ORACLE_HOME/bin:$PATH
第二節點相應改成+ASM2
2.ORACLEor
export PATH
export ORACLE_SID=exora1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/db_home
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export PATH=$PATH:$ORACLE_HOME/bin
第二節點相應改成+exora2
十七 SSH互信配置
1.grid
[root@exrac1 ~]# su - grid
[grid@exrac1 ~]$ ssh-keygen -t rsa
[root@exrac2 ~]# su - grid
[grid@exrac2 ~]$ ssh-keygen -t rsa
[grid@exrac1 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
[grid@exrac1 ~]$ ssh exrac2 cat /home/grid/.ssh/id_rsa.pub >> .ssh/authorized_keys
[grid@exrac1 ~]$ scp .ssh/authorized_keys exrac2:/home/grid/.ssh
配置完成後分別測試:
[grid@exrac1 ~]$ ssh exrac1 date
[grid@exrac1 ~]$ ssh exrac2 date
[grid@exrac1 ~]$ ssh exrac1-priv date
[grid@exrac1 ~]$ ssh exrac1-priv2 date
[grid@exrac1 ~]$ ssh exrac2-priv1 date
[grid@exrac1 ~]$ ssh exrac2-priv2 date
節點2同樣重複執行,確認SSH互信沒有問題
2.oracle
[root@exrac1 ~]# su - oracle
[oracle@exrac1 ~]$ ssh-keygen -t rsa
[oracle@exrac2 ~]# su - oracle
[oracle@exrac2 ~]$ ssh-keygen -t rsa
[oracle@exrac1 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
[oracle@exrac1 ~]$ ssh exrac2 cat /home/orale/.ssh/id_rsa.pub >> .ssh/authorized_keys
[oracle@exrac1 ~]$ scp .ssh/authorized_keys exrac2:/home/oracle/.ssh
十八 多路徑配置
#安裝多路徑
rpm -qa|grep device-mapper
yum install device-mapper -y
#啟動多路徑軟體
modprobe dm-multipath
modprobe dm-round-robin
lsmod | grep multipath
#設定開機啟動
systemctl enable multipathd.service
systemctl start multipathd.service
#生成配置檔案
mpathconf --enable --find_multipaths y --with_module y --outfile /etc/multipath.conf
multipath -v0 載入
for i in c d e f g h i j k l m n o p;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c455269734d7856772d466d79472d6e47394b", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c4552483046696e432d6e5350772d47527768", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c45526a635065336d2d654f76762d41517564", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c45526856784562792d304763722d586a4776", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c455269734d7856772d466d79472d6e47394b", NAME="asm-diskg", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c4552483046696e432d6e5350772d47527768", NAME="asm-diskh", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c45526856784562792d304763722d586a4776", NAME="asm-diski", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c45527066467151652d6377705a2d744b6670", NAME="asm-diskj", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c45527066467151652d6377705a2d744b6670", NAME="asm-diskk", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c45524750494269302d6c4735332d7a744547", NAME="asm-diskl", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c45524750494269302d6c4735332d7a744547", NAME="asm-diskm", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c45526431566d78322d633965502d767a517a", NAME="asm-diskn", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c45526431566d78322d633965502d767a517a", NAME="asm-disko", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="14f504e46494c4552337256367a702d52436f692d784a4177", NAME="asm-diskp", OWNER="grid", GROUP="asmadmin", MODE="0660"
#查詢/etc/multipath/bindings
vi /etc/multipath/bindings
mpatha 14f504e46494c45526a635065336d2d654f76762d41517564
mpathb 14f504e46494c455269734d7856772d466d79472d6e47394b
mpathc 14f504e46494c4552483046696e432d6e5350772d47527768
mpathd 14f504e46494c45526856784562792d304763722d586a4776
mpathe 14f504e46494c45527066467151652d6377705a2d744b6670
mpathf 14f504e46494c45524750494269302d6c4735332d7a744547
mpathg 14f504e46494c45526431566d78322d633965502d767a517a
mpathh 14f504e46494c4552337256367a702d52436f692d784a4177
mpathi 14f504e46494c45525137537a67352d6b6633472d4343477a
#根據BINDINGS檔案新增到 WWIDs檔案中
vi /etc/multipath/wwids
/14f504e46494c45526a635065336d2d654f76762d41517564/
/14f504e46494c455269734d7856772d466d79472d6e47394b/
/14f504e46494c4552483046696e432d6e5350772d47527768/
/14f504e46494c45526856784562792d304763722d586a4776/
/14f504e46494c45527066467151652d6377705a2d744b6670/
/14f504e46494c45524750494269302d6c4735332d7a744547/
/14f504e46494c45526431566d78322d633965502d767a517a/
/14f504e46494c4552337256367a702d52436f692d784a4177/
/14f504e46494c45525137537a67352d6b6633472d4343477a
配置多路徑檔案
blacklist {
devnode "^sda"
}
multipaths{
multipath{
wwid 14f504e46494c45527066467151652d6377705a2d744b6670
alias FRA_A
uid 0
mode 0600
}
multipath{
wwid 14f504e46494c45526856784562792d304763722d586a4776
alias DATA_A
uid 0
mode 0600
}
multipath{
wwid 14f504e46494c4552483046696e432d6e5350772d47527768
alias GIMR_A
uid 0
mode 0600
}
multipath{
wwid 14f504e46494c455269734d7856772d466d79472d6e47394b
alias OCR_A
uid 0
mode 0600
}
multipath{
wwid 14f504e46494c45526a635065336d2d654f76762d41517564
alias T_OCR
uid 0
mode 0600
}
multipath{
wwid 14f504e46494c45525137537a67352d6b6633472d4343477a
alias OCR_B
uid 0
mode 0600
}
multipath{
wwid 14f504e46494c4552337256367a702d52436f692d784a4177
alias FRA_B
uid 0
mode 0600
}
multipath{
wwid 14f504e46494c45526431566d78322d633965502d767a517a
alias DATA_B
uid 0
mode 0600
}
multipath{
wwid 14f504e46494c45524750494269302d6c4735332d7a744547
alias GIRM_B
uid 0
mode 0600
}
}
#重啟多路徑服務:
systemctl stop multipathd.service
systemctl start multipathd.service
systemctl sta8tus multipathd.service
檢視多路徑狀態
multipath -ll
for i in ;
do
printf "%s %s\n" "$i" "$(udevadm info --query=all --name=/dev/mapper/$i | grep -i dm_uuid)";
done
十九 UDEV許可權繫結
for i in b c d e f g h i j k
do
echo "KERNEL\“dm-*",SUBSYSTEM"block",PROGRAM"/sbin/iscsid --whitelisted --replace-whitespace --device=/dev/mapper/$name",RESULT"/sbin/iscsid --whitelisted --replace-whitespace --device=/dev/mapper/$name",SYMLINK+="asm-disk$i",OWNER="grid",GROUP="asmadmin",MODE="0660""
done
vi /etc/udev/rules.d/99-asm.rules
KERNEL=="dm-*",OWNER="grid",GROUP="asmadmin",MODE="0660",ENV{DM_UUID}==14f504e46494c45526a635065336d2d654f76762d41517564
KERNEL=="dm-*",OWNER="grid",GROUP="asmadmin",MODE="0660",ENV{DM_UUID}==14f504e46494c455269734d7856772d466d79472d6e47394b
KERNEL=="dm-*",OWNER="grid",GROUP="asmadmin",MODE="0660",ENV{DM_UUID}==14f504e46494c4552483046696e432d6e5350772d47527768
KERNEL=="dm-*",OWNER="grid",GROUP="asmadmin",MODE="0660",ENV{DM_UUID}==14f504e46494c45526856784562792d304763722d586a4776
KERNEL=="dm-*",OWNER="grid",GROUP="asmadmin",MODE="0660",ENV{DM_UUID}==14f504e46494c45527066467151652d6377705a2d744b6670
KERNEL=="dm-*",OWNER="grid",GROUP="asmadmin",MODE="0660",ENV{DM_UUID}==14f504e46494c45524750494269302d6c4735332d7a744547
KERNEL=="dm-*",OWNER="grid",GROUP="asmadmin",MODE="0660",ENV{DM_UUID}==14f504e46494c45526431566d78322d633965502d767a517a
KERNEL=="dm-*",OWNER="grid",GROUP="asmadmin",MODE="0660",ENV{DM_UUID}==14f504e46494c4552337256367a702d52436f692d784a4177
KERNEL=="dm-*",OWNER="grid",GROUP="asmadmin",MODE="0660",ENV{DM_UUID}==14f504e46494c45525137537a67352d6b6633472d4343477a
#檢查新的UDEV裝置
/sbin/udevadm trigger --type=devices --action=change
/sbin/udevadm control --reload
二十 建立ASM磁碟
安裝ASMLIB (PRM包i在/opt目錄):
rpm -ivh kmod-oracleasm-2.0.8-17.el7.x86_64.rpm
rpm -ivh oracleasm-support-2.1.8-3.el7.x86_64.rpm
rpm -ivh oracleasmlib-2.0.12-1.el7.x86_64.rpm
配置asmlib
/etc/init.d/oracleasm configure -i
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
建立ASM DISK:
[root@exrac2 opt]# oracleasm deletedisk DATA_A
Clearing disk header: done
Dropping disk: done
[root@exrac2 opt]# oracleasm createdisk DATA_A /dev/mapper/DATA_A
Writing disk header: done
Instantiating disk: done
[root@exrac2 opt]# oracleasm createdisk DATA_B /dev/mapper/DATA_B
Writing disk header: done
Instantiating disk: done
[root@exrac2 opt]# oracleasm createdisk FRA_A /dev/mapper/FRA_A
Writing disk header: done
Instantiating disk: done
[root@exrac2 opt]# oracleasm createdisk FRA_B /dev/mapper/FRA_B
Writing disk header: done
Instantiating disk: done
[root@exrac2 opt]# oracleasm createdisk OCR_A /dev/mapper/OCR_A
Writing disk header: done
Instantiating disk: done
[root@exrac2 opt]# oracleasm createdisk OCR_B /dev/mapper/OCR_B
\Writing disk header: done
Instantiating disk: done
[root@exrac2 opt]# oracleasm createdisk GIMR_A /dev/mapper/GIMR_A
Writing disk header: done
Instantiating disk: done
[root@exrac2 opt]# oracleasm createdisk GIMR_B /dev/mapper/GIMR_B
Writing disk header: done
Instantiating disk: done
[root@exrac2 opt]# oracleasm createdisk T_OCR /dev/mapper/T_OCR
Writing disk header: done
#檢查建立的ASM DISK
[root@exrac2 opt]# oracleasm listdisks
DATA_A
DATA_B
FRA_A
FRA_B
GIMR_A
GIMR_B
OCR_A
OCR_B
REDO_A
REDO_B
T_OCR
[root@exrac1 opt]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "DATA_A"
Instantiating disk "REDO_A"
Instantiating disk "GIMR_A"
Instantiating disk "T_OCR"
Instantiating disk "FRA_A"
Instantiating disk "OCR_A"
Instantiating disk "DATA_B"
Instantiating disk "REDO_B"
Instantiating disk "GIMR_B"
Instantiating disk "FRA_B"
Instantiating disk "OCR_B"
[root@exrac1 opt]# oracleasm listdisks
DATA_A
DATA_B
FRA_A
FRA_B
GIMR_A
GIMR_B
OCR_A
OCR_B
REDO_A
REDO_B
T_OCR
二十一、掛載NFS共享盤
#首先在NFS伺服器設定NFS共享目錄(這裡在192.168.0.43)伺服器上
vi /etc/exports
/ocr 192.168.0.0/24(rw,sync,root_squash)
# showmount -e 192.168.0.43
Export list for 192.168.0.43:
#有兩臺伺服器上對NFS盤MOUNT上
mkdir /ocr
mount -t nfs4 192.168.0.43:/ocr /ocr
vi /etc/fstab
192.168.0.43:/ocr /ocr nfs4 rw,bg,hard,intr,rsize=32768,wsize=32768,tcp,noac,ver
s=3,timeo=600 0 0
二十二 開啟linux大頁
計算需要的頁數
linux一個大頁的大小為2M,開啟大頁的總記憶體應該比sga_max_size稍稍大一點,比如
sga_max_size=180g,則: hugepages > (180*1024)/2 = 92160
*配置**sysctl.conf**檔案,**新增:*
vm.nr_hugepages = 92200
*配置/etc/security/**limit.conf,新增*(比sga_max_size稍大,以K為單位):
oracle soft memlock 188800000
oracle hard memlock 188800000
*禁用透明**大頁**(注意**新增位置**)**