成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

oracle 19C RAC 安裝必要配置項分享

IT那活兒 / 2273人閱讀
oracle 19C RAC 安裝必要配置項分享

親愛滴伙伴們,又見面了。今天我們講講Linux7平臺下Oracle19C RAC安裝的一些必要配置。


環(huán)境:

操作系統(tǒng):Redhat 7.6

數(shù)據(jù)庫版本:19.7

是否RAC:是


[
防火墻和SELNUX
]


為啥要關(guān)閉防火墻?

之前發(fā)生過由于防火墻的存在,RAC安裝過程中第二個節(jié)點運行root.sh失敗,顯示信息為:OracleCRS堆棧的最終檢查失敗,也存在其他潛在的性能和穩(wěn)定性問題。例如:節(jié)點被錯誤驅(qū)逐,IPC發(fā)送/接收超時等,所以O(shè)racle強烈建議在數(shù)據(jù)服務(wù)器上關(guān)閉防火墻。


關(guān)閉防火墻:

--查看防火墻狀態(tài)

systemctlstatus firewalld


--查看開機是否啟動防火墻服務(wù)

systemctlis-enabled firewalld


--關(guān)閉防火墻

systemctlstop firewalld

systemctlstatus firewalld


--禁用防火墻(系統(tǒng)啟動時不啟動防火墻服務(wù))

systemctldisable firewalld

systemctlis-enabled firewalld


SELINUX具體定義這里不再多說,其主要作用就是最大限度地減小系統(tǒng)中服務(wù)進程可訪問的資源(最小權(quán)限原則)。由于可能會觸發(fā)數(shù)據(jù)庫BUG(例如11GR2版本中BUG9746474),所以建議關(guān)閉SELINUX。


SELINUX關(guān)閉方法:

修改/etc/selinux/config文件,將SELINUX設(shè)置為disabled。


[
Linux 7 systemd服務(wù)
]


為防止Linux7systemd服務(wù)刪除/var/tmp/.oracle導(dǎo)致CRS停止工作。因此需要在/usr/lib/tmpfiles.d/tmp.conf中添加以下內(nèi)容(若已存在請忽略),文檔ID28650460.8有詳細(xì)介紹:

x /tmp/.oracle*

x /var/tmp/.oracle*

x /usr/tmp/.oracle*

x /var/tmp/.oracle

x /tmp/.oracle

x /var/tmp/.oracle

x /usr/tmp/.oracle


[
UDEV
]


在ASMLib及DM不能滿足要求的情況下使用udev來確定ASM磁盤,如果直接使用/dev/sdd的方式可能導(dǎo)致磁盤權(quán)限不穩(wěn)定,配置磁盤后主機務(wù)必要進行一次重啟。


文件命名規(guī)則為:

/etc/udev/rules.d/99-oracle-asmdevices.rules

內(nèi)容如下(使用SCSI_ID):

/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sdd

KERNEL=="sd*",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="369835ed100b92182002322d90000000e", SYMLINK+="asmdiskdata40",OWNER="grid", GROUP="asmadmin",MODE="0660"

KERNEL=="sd*",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="369835ed100b9218200251cdc0000002c", SYMLINK+="asmdiskarch01",OWNER="grid", GROUP="asmadmin",MODE="0660"

KERNEL=="sd*",SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="369835ed100b9218200252c800000002d", SYMLINK+="asmdiskarch02",OWNER="grid", GROUP="asmadmin",MODE="0660"

start_udev


使用路徑:

需要固定/dev/sdd,不能用*代替

KERNEL=="sdd", SUBSYSTEM=="block", NAME="asmdsk1", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sde", SUBSYSTEM=="block", NAME="asmdsk2", OWNER="grid", GROUP="asmadmin", MODE="0660"

start_udev


使用Multipath:

multipath –ll

disk04 (360060e8005bf7b000000bf7b00004209) dm-5 HP,OPEN-V

size=123G features=1 queue_if_no_path hwhandler=0 wp=rw

|-+- policy=round-robin 0 prio=1 status=active

| `- 4:0:0:4  sdg  8:96   active ready running

|-+- policy=round-robin 0 prio=1 status=enabled

| `- 4:0:1:4  sdt  65:48  active ready running

|-+- policy=round-robin 0 prio=1 status=enabled

| `- 5:0:0:4  sdag 66:0   active ready running

`-+- policy=round-robin 0 prio=1 status=enabled

`- 5:0:1:4  sdat 66:208 active ready running

vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="dm-*", PROGRAM="scsi_id --page=0x83 --whitelisted --device=/dev/%k",RESULT=="360060e8005bf7b000000bf7b00004206", OWNER:="grid", GROUP:=" asmadmin ", MODE="0660"

KERNEL=="dm-*", PROGRAM="scsi_id --page=0x83 --whitelisted --device=/dev/%k",RESULT=="360060e8005bf7b000000bf7b00004207", OWNER:=" grid ", GROUP:=" asmadmin ", MODE="0660"

KERNEL=="dm-*", PROGRAM="scsi_id --page=0x83 --whitelisted --device=/dev/%k",RESULT=="360060e8005bf7b000000bf7b00004208", OWNER:=" grid ", GROUP:=" asmadmin ", MODE="0660"

需要確認(rèn)/dev/mapper/mpathb對應(yīng)的wwid號是一致的。

service multipathd restart


[
HugePage
]


hugepage是在linux2.6內(nèi)核被引入的,主要提供4k的page和比較大的page的選擇,當(dāng)我們訪問內(nèi)存時,首先訪問”pagetable“,然后linux在通過“pagetable”的mapping來訪問真實物理內(nèi)存(ram+swap)。為了提升性能,linux在cpu中申請固定大小的buffer,被稱為TLB,TLB中保存有“pagetable”的部分內(nèi)容,這也遵循了讓數(shù)據(jù)盡可能的靠近cpu原則。在TLB中通過hugetlb來指向hugepage。這些被分配的hugepage作為內(nèi)存文件系統(tǒng)hugetlbfs(類似tmpfs)提供給進程使用。


系統(tǒng)啟動后,hugepage就被分配并保留,不會pagein/pageout,除非人為干預(yù),如改變hugepage的配置等;根據(jù)linux內(nèi)核的版本和HW的架構(gòu),hugepage的大小自定義,具體根據(jù)數(shù)據(jù)庫SGA的大小進行配置。因為采用大page,所以也減少TLB和pagetable的管理壓力。在內(nèi)存較大的情況下推薦使用HugePage,但是需禁用AMM及RHEL7/SESL11的THP。


計算并設(shè)置hugepage參數(shù)

腳本hugepages_settings.sh內(nèi)容如下:





#!/bin/bash

#

#hugepages_settings.sh

#

#Linux bash script to compute values for the

#recommended HugePages/HugeTLB configuration

#on Oracle Linux

#

#Note: This script does calculation for all shared memory

#segments available when the script is run, no matter it

#is an Oracle RDBMS shared memory segment or not.

#

#This script is provided by Doc ID 401749.1 from My Oracle Support

#http://support.oracle.com

#Welcome text

echo"

Thisscript is provided by Doc ID 401749.1 from My Oracle Support

(http://support.oracle.com)where it is intended to compute values for

therecommended HugePages/HugeTLB configuration for the current shared

memorysegments on Oracle Linux. Before proceeding with the execution pleasenote following:

*For ASM instance, it needs to configure ASMM instead of AMM.

*The pga_aggregate_target is outside the SGA and

youshould accommodate this while calculating the overall size.

*In case you changes the DB SGA size,

asthe new SGA will not fit in the previous HugePages configuration,

ithad better disable the whole HugePages,

startthe DB with new SGA size and run the script again.

Andmake sure that:

*Oracle Database instance(s) are up and running

*Oracle Database 11g Automatic Memory Management (AMM) is not setup

(SeeDoc ID 749851.1)

*The shared memory segments can be listed by command:

#ipcs -m

PressEnter to proceed..."

read

#Check for the kernel version

KERN=`uname-r | awk -F. { printf("%d.%d ",$1,$2); }`

#Find out the HugePage size

HPG_SZ=`grepHugepagesize /proc/meminfo | awk {print $2}`

if[ -z "$HPG_SZ" ];then

echo"The hugepages may not be supported in the system where thescript is being executed."

exit1

fi

#Initialize the counter

NUM_PG=0

#Cumulative number of pages required to handle the running sharedmemory segments

forSEG_BYTES in `ipcs -m | cut -c44-300 | awk {print $1} | grep"[0-9][0-9]*"`

do

MIN_PG=`echo"$SEG_BYTES/($HPG_SZ*1024)" | bc -q`

if[ $MIN_PG -gt 0 ]; then

NUM_PG=`echo"$NUM_PG+$MIN_PG+1" | bc -q`

fi

done

RES_BYTES=`echo"$NUM_PG * $HPG_SZ * 1024" | bc -q`

#An SGA less than 100MB does not make sense

#Bail out if that is the case

if[ $RES_BYTES -lt 100000000 ]; then

echo"***********"

echo"** ERROR **"

echo"***********"

echo"Sorry! There are not enough total of shared memory segmentsallocated for

HugePagesconfiguration. HugePages can only be used for shared memory segments

thatyou can list by command:

#ipcs -m

ofa size that can match an Oracle Database SGA. Please make sure that:

*Oracle Database instance is up and running

*Oracle Database 11g Automatic Memory Management (AMM) is notconfigured"

exit1

fi

#Finish with results

case$KERN in

2.4)HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc -q`;

echo"Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;;

2.6)echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;

3.8)echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;

3.10)echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;

4.1)echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;

4.14)echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;

*)echo "Kernel version $KERN is not supported by this script(yet). Exiting." ;;

esac

#End






向上滑動查看更多內(nèi)容


腳本來自MOS文章401749.1,運行腳本是需要啟動所有數(shù)據(jù)庫實例,并禁用AMM,即設(shè)置memory_target=0。


運行腳本計算:

./hugepages_settings.sh

...

Recommendedsetting: vm.nr_hugepages = 1496


設(shè)置參數(shù):

vi/etc/sysctl.conf

vm.nr_hugepages= 1496


重起驗證

調(diào)整數(shù)據(jù)庫參數(shù):

use_large_pages=only

重起主機shutdown-ry 0 (使禁用THP及nr_hugepages參數(shù)生效)


啟動數(shù)據(jù)庫,驗證是否使用:

#grep HugePages /proc/meminfo

AnonHugePages:     0 kB

HugePages_Total:   1496

HugePages_Free:     485

HugePages_Rsvd:     446

HugePages_Surp:       0


[
禁用TransparentHugePages(透明大頁)
]


從RedHat6,OL6,SLES11和UEK2內(nèi)核開始,實現(xiàn)并啟用了透明大頁,以嘗試改善內(nèi)存管理。透明大頁與早期Linux版本中可用的HugePages類似。主要區(qū)別在于,透明大頁是在運行時由內(nèi)核中的khugepaged線程動態(tài)設(shè)置的,而常規(guī)HugePages必須在啟動時進行預(yù)分配。


但是由于透明大頁會導(dǎo)致意外的節(jié)點重啟和RAC性能問題,所以O(shè)racle強烈建議禁用透明大頁。此外,即使在單實例數(shù)據(jù)庫環(huán)境中,透明大頁也可能會導(dǎo)致意外的性能問題或延遲。因此,Oracle建議在所有運行Oracle的數(shù)據(jù)庫服務(wù)器上禁用透明大頁。


RHEL7為例:

編輯/etc/default/grub,將transparent_hugepage=never加入含有GRUB_CMDLINE_LINUX行最后。

vi/etc/default/grub

GRUB_TIMEOUT=5

GRUB_DISTRIBUTOR="$(seds, release .*$,,g /etc/system-release)"

GRUB_DEFAULT=saved

GRUB_DISABLE_SUBMENU=true

GRUB_TERMINAL_OUTPUT="console"

GRUB_CMDLINE_LINUX="crashkernel=autord.lvm.lv=vg_sys/lv_root rd.lvm.lv=vg_sys/lv_swap rhgb quiettransparent_hugepage=never"

GRUB_DISABLE_RECOVERY="true"


運行:grub2-mkconfig-o /boot/grub2/grub.cfg


重起后驗證(也可以稍后調(diào)整系統(tǒng)參數(shù)后重起)

cat/sys/kernel/mm/transparent_hugepage/enabled

alwaysmadvise [never] ?---表示選中了never


好了,本次19C配置分享到此結(jié)束,我們下回分解見。

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/130181.html

相關(guān)文章

  • Oracle Linux And Oracle Database 11g R2 Intsallati

    摘要:最近工作中用到了作為測試的數(shù)據(jù)庫,在裝和折騰了很久,這篇文章就這兩點對大家分享一些我安裝過程中遇到的問題和注意點,暫時還未配置,稍后找時間補上現(xiàn)在網(wǎng)上找一篇好的文章好難,往往要在一個話題或技術(shù)上找多方資源東拼西湊,互相借鑒才能達成目的,原因 最近工作中用到了Oracle作為Intel測試的數(shù)據(jù)庫,在裝Oracle Linux和Oracle Database 11g R2折騰了很久,這...

    Flands 評論0 收藏0

發(fā)表評論

0條評論

IT那活兒

|高級講師

TA的文章

閱讀更多
最新活動
閱讀需要支付1元查看
<