Oracle10g RAC for Linux配置全過程

來源:互聯網
上載者:User

本文是一篇在RedHat Advance Server 3.0上安裝和配置Oracle10g RAC的文檔,不僅僅是個安裝實驗,而是一個生產系統的實際布置過程,所以包括RAC安裝,本地監聽配置,JDBC串連串書寫,CRS服務重新安裝, VIP地址修改等等,相信比一般的安裝教程更有應用上的意思。

1、安裝環境
硬體平台:HP 380 PC伺服器2台。
主機 Hostname IP VIP VIP名稱
Node1 dbtest1 192.168.100.201 10.96.100.103 db-vip01
Node2 dbtest2 192.168.100.203 10.96.100.104 db-vip02

作業系統:RedHat Enterprise Linux 3.0 Update 5。
磁碟陣列:HP ms1000。
資料庫:Oracle10g 10.1.0.3。
2、安裝 Linux
所需核心:
2.4.21-4.EL 或更高版本
驗證核心版本:
# uname -r
2.4.21-32.ELsmp
其他所需程式包的版本(或更高版本):
make-3.79
binutils-2.11.90.0.8-12
gcc-3.2.3-2
compat-db-4.0.14.5
compat-gcc-7.3-2.96.122
compat-gcc-c++-7.3-2.96.122
compat-libstdc++-7.3-2.96.122
compat-libstdc++-devel-7.3-2.96.122
openmotif21-2.1.30-8
setarch-1.3-1
驗證已安裝的程式包:
# rpm –qa make binutils gcc compat-db compat-gcc compat-gcc-c++ compat-libstdc++
compat-libstdc++-devel openmotif setarch
make-3.79.1-17
binutils-2.14.90.0.4-26
gcc-3.2.3-20
compat-db-4.0.14-5
compat-gcc-7.3-2.96.122
compat-gcc-c++-7.3-2.96.122
compat-libstdc++-7.3-2.96.122
compat-libstdc++-devel-7.3-2.96.122
openmotif-2.2.2-16
setarch-1.3-1
3、為 Oracle 配置 Linux
建立 Oracle 組和使用者帳戶
接下來我們將建立用於安裝和維護 Oracle 10g 軟體的 Linux 組和使用者帳戶。 使用者帳戶名是‘oracle’,組是‘oinstall’和‘dba’。 在drpdb01上以 root 使用者身份執行以下命令:
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
使用者識別碼 和組 ID 在所有叢集主機上必須相同。 使用從 id oracle 命令得到的資訊,在drpdb02上建立 Oracle 組和使用者帳戶:
/usr/sbin/groupadd -g 500 oinstall
/usr/sbin/groupadd -g 501 dba
/usr/sbin/useradd -m -u 500 -g oinstall -G dba oracle
id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
設定 oracle 帳戶的口令:
# passwd oracle
Changing password for user oracle.
New password:
Retype new password:
passwd:all authentication tokens updated successfully.
建立掛載點

現在建立儲存 Oracle 10g 軟體的掛載點。
以 root 使用者身份執行以下命令:
# mkdir -p /u01/app/oracle
# chown -R oracle:oinstall /u01/app/oracle
# chmod -R 775 /u01/app/oracle
配置核心參數

以 root 使用者身份登入並在每個主機上配置 Linux 核心參數。
cat >> /etc/sysctl.conf >>EOF
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
kernel.threads-max = 131072
fs.file-max = 131072
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144
EOF
/sbin/sysctl -p
為 oracle 使用者佈建 Shell 限制

Oracle 建議對每個 Linux 帳戶可以使用的進程數量和開啟檔案的數量設定限制。

cat >> /etc/security/limits.conf >>EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF

cat >> /etc/pam.d/login >>EOF
session required /lib/security/pam_limits.so
EOF

cat >> /etc/profile >>EOF
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF

cat >> /etc/csh.login >>EOF
if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
umask 022
endif
EOF
配置 Hangcheck 計時器
modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
cat >> /etc/rc.d/rc.local >>EOF
modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
EOF
配置 /etc/hosts
有些 Linux 發行版本將主機名稱與傳回位址 (127.0.0.1) 相關聯。 如果出現這種情況,則從傳回位址中刪除主機名稱,本次安裝已經修改。
用於此指南的 /etc/hosts 檔案:
127.0.0.1 localhost.localdomain localhost
192.168.100.201 dbtest1 dbtest1
192.168.100.203 dbtest2 dbtest2
192.168.200.1 dbtest1-priv dbtest1-priv
192.168.200.2 dbtest2-priv dbtest2-priv
192.168.100.202 dbtest1-vip dbtest1-vip
192.168.100.204 dbtest2-vip dbtest2-vip
~為使用者等效性配置SSH
在安裝 Oracle RAC 10g 期間,OUI 需要把檔案複製到叢集中的其他主機上並在其上執行程式。 為了允許 OUI 完成此任務,必須配置 SSH 以啟用使用者等效性。 用 SSH 建立使用者等效性就提供了一種在叢集中其他主機上複製檔案和執行程式時不需要口令提示的安全方式。
第一步是產生 SSH 的公用密鑰和專用密鑰。 SSH 協議有兩個版本;版本 1 使用 RSA,版本 2 使用 DSA,因此我們將建立這兩種類型的密鑰,以確保 SSH 能夠使用任一版本。 ssh-keygen 程式將根據傳遞給它的參數產生任一類型的公用密鑰和專用密鑰。

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.