初次安裝,花了一天時間。虛擬機(jī)也慢,文檔整理格式不是很好,將就下。
目錄
第 1 部分:安裝 VMware server ,建立虛擬機(jī)
第 2 部分:安裝 Linux
第 3 部分:針對 Oracle 配置 Linux
創(chuàng)建目錄
創(chuàng)建 Oracle 組和用戶帳戶
配置 Linux 內(nèi)核參數(shù)
為 oracle 用戶設(shè)置 Shell 限制
第 4 部分:安裝 Oracle
安裝軟件
第 5 部分:配置存儲
文件系統(tǒng)
自動存儲管理
結(jié)論
附錄
Rhel 5 (DVD)
Oracle Database 11g Release 1 (11.1.0.6.0) (1.7G)
VMware server 1.0.5
硬件要求
內(nèi)存建議1.5G以上,空閑磁盤10G。
主機(jī)名??????????????????????? 操作系 統(tǒng)??????????????????????????????????????????????????????????????????????????????????????????????????????? 處理器??????? 內(nèi)存
db.hjh.com??????? Oracle Enterprise Linux 4(32 位)??????? 1??????????????????????? 1024 MB
虛擬磁盤布局概況:
主機(jī)操作系統(tǒng)上的虛擬磁盤??????? 客戶操作系統(tǒng)上的虛擬磁盤??????? 虛擬設(shè)備節(jié)點??????? 大小 (MB)??????? 描述
d:vm
aclocaldisk.vmdk??????? /dev/sda1??????????????????????????????????????????????????????????????????????????????? SCSI 0:0??????????????????????? 20??????? “/”掛載點
/dev/sda2??????????????? 交換空間
/dev/sda3??????????????? /boot分區(qū)
Oracle 二進(jìn)制文件
d:vm
acasmdisk1.vmdk??????? /dev/sdb??????? SCSI 1:0??????? 3072??????? ASM 磁盤組 1
d:vm
acasmdisk2.vmdk??????? /dev/sdc??????? SCSI 1:1??????? 3072??????? ASM 磁盤組 1
d:vm
acasmdisk3.vmdk??????? /dev/sdd??????? SCSI 1:2??????? 2048??????? ASM 磁盤組 2
d:vm
acasmdisk4.vmdk??????? /dev/sde??????? SCSI 1:3??????? 2048??????? ASM 磁盤組 2
本指南相關(guān)下載:
Rhel Linux 5
Oracle 數(shù)據(jù)庫 11g 第 1 版
ASMLib
第 1 部分:安裝 VMware server ,建立虛擬機(jī)
安裝 VMware server,沒有什么要注意的,注冊碼Google一下。
1.??????? 創(chuàng)建一個新的虛擬機(jī)。
2.??????? 新建虛擬機(jī)向?qū)В簡螕?Next。
3.??????? 選擇適當(dāng)?shù)呐渲茫?
a.??????? 虛擬機(jī)配置:選擇 Custom。
4.??????? 選擇客戶操作系統(tǒng):
a.??????? 客戶操作系統(tǒng):選擇 Linux。
b.??????? 版本:選擇 Red Hat Enterprise Linux 5(或者4)。
5.??????? 命名虛擬機(jī):
a.??????? 虛擬機(jī)名稱:。
b.??????? 位置:。
6.??????? 處理器配置:
a.??????? 處理器:選擇一個處理器。
7.??????? 虛擬機(jī)內(nèi)存:
a.??????? 內(nèi)存:選擇 1024MB。
8.??????? 網(wǎng)絡(luò)類型:
a.??????? 網(wǎng)絡(luò)連接:選擇 Use bridged networking。
9.??????? 選擇 I/O 適配器類型:
a.??????? I/O 適配器類型:選擇 LSI Logic。
10.??????? 選擇磁盤:
a.??????? 磁盤:選擇 Create a new virtual disk。
11.??????? 選擇磁盤類型:
a.??????? 虛擬磁盤類型:選擇 SCSI (Recommended)。
12.??????? 指定磁盤容量:
a.??????? 磁盤容量:輸入“10GB”。 (Linux2.5G+11g5.4G,如果拷貝安裝+1.7G)
b.??????? 取消選擇 Allocate all disk space now。為了節(jié)省空間,您現(xiàn)在不必分配所有磁盤空間。
13.??????? 指定磁盤文件:
a.??????? 磁盤文件。
b.??????? 單擊 Finish。
??????????????????????????????????????? 修改虛擬機(jī)配置,菜單VM-Settings(Ctrl-D)。
14.??????? VMware Server 控制臺:單擊 Edit virtual machine settings。
15.??????? 虛擬機(jī)設(shè)置:單擊 Add。
16.??????? 新增硬件向?qū)В簡螕?Next。
17.??????? 硬件類型:
a.??????? 硬件類型:選擇 Hard Disk。
18.??????? 選擇磁盤:
a.??????? 磁盤:選擇 Create a new virtual disk。
19.??????? 選擇磁盤類型:
a.??????? 虛擬磁盤類型:選擇 SCSI (Recommended)。
20.??????? 指定磁盤容量:
a.??????? 磁盤容量:輸入“2GB”。
b.??????? 選擇 Allocate all disk space now。如果您希望節(jié)省空間,則不必分配所有磁盤空間。出于性能方面的考慮,
您需要為每個虛擬共享磁盤預(yù)先分配所有磁盤空間。特別是在 Oracle 數(shù)據(jù)庫創(chuàng)建期間或者當(dāng)數(shù)據(jù)庫的 DML 活動較頻繁時,
如果共享磁盤的大小增長快速,虛擬機(jī)可能會間歇掛起一段較短的時間甚至崩潰(這種情況很少見)。
21.??????? 指定磁盤文件:
a.??????? 磁盤文件:輸入“d:vm
acasmdisk1.vmdk”。
b.??????? 單擊 Advanced。
22.??????? 新增硬件向?qū)В?
a.??????? 虛擬設(shè)備節(jié)點:選擇 SCSI 1:0。
b.??????? 模式:選擇 Independent,針對所有共享磁盤選擇 Persistent。
c.??????? 單擊 Finish。
第 2 部分:安裝 Rhel Linux 5
最低硬件要求:
32 位 (x86)
● x86 兼容 CPU
● 1 GB RAM
● 10 GB 的可用磁盤空間(3.5 GB 用于 Oracle 軟件 + 1.5 GB 用于數(shù)據(jù)庫 + 3 GB 用于 RHEL5 + 2 GB 交換空間)
注:Linux 和 Oracle 必須安裝在同一體系結(jié)構(gòu)上。
1. 使用第一張 CD 或 DVD 啟動服務(wù)器。
您可能需要更改 BIOS 設(shè)置,以允許從 CD/DVD 啟動。
2. 啟動屏幕出現(xiàn),并在底部顯示 boot:提示符。
選擇 Enter,從控制臺上執(zhí)行圖形安裝。
安裝程序掃描您的硬件
3. Oracle Enterprise Linux splash 屏幕
單擊 Next
4. 語言選擇
接受默認(rèn)值。
5. 配置鍵盤
接受默認(rèn)值。
6. 安裝或升級
選擇 Install 并單擊 Next
7. 設(shè)置磁盤分區(qū)
掛載點: /boot 文件系統(tǒng)類型:ext3 300M
文件系統(tǒng)類型:Swap 2048M
掛載點:???? / 文件系統(tǒng)類型:ext3, Fill to maximum allowable size
8. 網(wǎng)絡(luò)配置
通常情況下,最好使用靜態(tài) IP 地址配置數(shù)據(jù)庫服務(wù)器。為此,單擊 Edit。
出現(xiàn)一個彈出窗口。取消選中 Configure using DHCP 復(fù)選框,并輸入服務(wù)器的 IP 地址和網(wǎng)絡(luò)掩碼。確保選中 Activate on boot,然后單擊 OK。
在 Hostname 框中,選擇 manually 并輸入主機(jī)名。
在 Miscellaneous Settings 框中,輸入其他網(wǎng)絡(luò)設(shè)置。
9. 選擇時區(qū)
選擇適合您區(qū)域的時間設(shè)置。將系統(tǒng)時鐘設(shè)置為 UTC 對服務(wù)器而言通常是一個很好的做法。為此,選擇 System clock uses UTC。
10. 設(shè)置 Root 口令
輸入 root 的口令,并再次輸入以進(jìn)行確認(rèn)。
11. 軟件包安裝
除缺省選擇外,建議選擇:
Development
Development Tools
Legacy Software Development???????????????????????????????????????
Servers
Legacy Network Server(為以后配RAC準(zhǔn)備),單擊 Optional packages。
1.??????? 選擇 rsh-server。
2.??????? 選擇 telnet-server。
Server Configuration Tools。
FTP Server
Windows File Server (訪問Windows共享文件)
Base System
Legacy Software Support
System Tools,單擊 Optional packages。
1.??????? 選擇 sysstat。
注意:別忘了左邊拉到底,下面選擇Languages。另外可以安裝你要使用的軟件,比如FTP ,SMB等等。
12. 安裝程序包
軟件將被復(fù)制到硬盤并被安裝。提示更換磁盤。
13. 軟件安裝結(jié)束后
取出所有 CD/DVD 啟動介質(zhì)。
單擊 Next。
15. 許可協(xié)議
閱讀許可協(xié)議。如果同意其中的條款,選擇 Yes, I agree to the License Agreement 并單擊 Forward。
16. 配置防火墻
出于本演示的需要,將不配置防火墻。選擇 Disabled 并單擊 Forward。
當(dāng)出現(xiàn)“Warning - No Firewall”窗口時,單擊 Yes。
17. SELinux
從下拉菜單中選擇 Disabled 并單擊 Forward。
18. Kdump
不要啟用 Kdump。接受默認(rèn)設(shè)置并單擊 Forward。
19. 日期和時間
設(shè)置日期和時間。
如果要使用 NTP 服務(wù)器(推薦),則選擇 Enable Network Time Protocol 并輸入 NTP 服務(wù)器的名稱。
20. 系統(tǒng)用戶
為自己創(chuàng)建一個帳戶。
此時不要為 oracle 創(chuàng)建帳戶。本部分稍后將介紹如何創(chuàng)建 oracle 帳戶。
21. 聲卡
如果有聲卡,對其進(jìn)行配置并單擊 Forward。
22. 其他 CD
單擊 Finish。
23. 系統(tǒng)將重啟
24. 出現(xiàn)一個圖形登錄屏幕。
25. 恭喜!您的 Rhel5 軟件現(xiàn)已安裝完畢。
安裝必需的軟件包
所需內(nèi)核版本:2.6.18。該內(nèi)核或其他更新的內(nèi)核可用于 Oracle 數(shù)據(jù)庫 11g 第 1 版。
通過運行以下命令檢查內(nèi)核版本:
# uname -r
2.6.18-53.el5xen
所需程序包版本(或更高):
● compat-libstdc++-33-3.2.3-61
● elfutils-libelf-0.125-3.el5
● elfutils-libelf-devel-0.125-3.el5
● glibc-2.5-12
● glibc-devel-2.5-12
● glibc-common-2.5-12
● gcc-4.1.1-52.el5
● gcc-c++-4.1.1-52.el5
● libgcc-4.1.1-52.el5
● libaio-0.3.106-3.2
● libaio-devel-0.3.106-3.2
● libstdc++-4.1.1-52.el5
● libstdc++-devel-4.1.1-52.el5
● unixODBC-2.2.11-7.1
● unixODBC-devel-2.2.11-7.1
● sysstat-7.0.0-3.el5
● binutils-2.17.50.0.6-2.el5
● make-3.81-1.1
如果您已經(jīng)按照 Oracle 的建議執(zhí)行了“默認(rèn) RPM”安裝,則還需要安裝一些必需的程序包:
[root@db Server]# rpm -ivh libaio-devel-0.3.106-3.2.i386.rpm
warning: libaio-devel-0.3.106-3.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...??????????????? ########################################### [100%]
1:libaio-devel?????????? ########################################### [100%]
[root@db Server]# rpm -ivh unixODBC*
warning: unixODBC-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...??????????????? ########################################### [100%]
1:unixODBC?????????????? ########################################### [ 33%]
2:unixODBC-devel???????? ########################################### [ 67%]
3:unixODBC-kde?????????? ########################################### [100%]
[root@db Server]#
第 3 部分:針對 Oracle 配置 Linux
Linux 軟件現(xiàn)已安裝完畢,您需要針對 Oracle 對其進(jìn)行配置。本部分將逐步講解針對 Oracle 數(shù)據(jù)庫 11g 第 1 版配置 Linux 的過程。
創(chuàng)建 Oracle 組和用戶帳戶
接下來,創(chuàng)建用于安裝和維護(hù) Oracle 數(shù)據(jù)庫 11g 第 1 版軟件的 Linux 組和用戶帳戶。用戶帳戶將稱為 oracle,而組將稱為 oinstall
和 dba。以 root 用戶身份執(zhí)行以下命令:
[root@db Server]# groupadd oinstall
[root@db Server]# groupadd dba
[root@db Server]# useradd -m -g oinstall -G dba oracle
[root@db Server]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
[root@db Server]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@db Server]#
創(chuàng)建目錄
現(xiàn)在創(chuàng)建目錄來存放 Oracle 數(shù)據(jù)庫 11g 第 1 版軟件及數(shù)據(jù)庫文件。本指南在創(chuàng)建目錄結(jié)構(gòu)時所用的命名慣例符合最佳靈活結(jié)構(gòu)
(OFA) 規(guī)范。有關(guān) OFA 標(biāo)準(zhǔn)的更多信息,請參閱針對 Linux 的 Oracle 數(shù)據(jù)庫安裝指南 11g 第 1 版 (11.1) 的附錄 D。
以下假設(shè)在根文件系統(tǒng)中創(chuàng)建目錄。這樣做是為了簡便起見,不建議將其作為通用做法。這些目錄通常被創(chuàng)建為單獨的文件系統(tǒng)。
以 root 用戶身份執(zhí)行以下命令:
[root@db Server]# mkdir -p /u01/app/oracle
[root@db Server]# chown -R oracleinstall /u01/app
[root@db Server]# chmod -R 775 /u01/app
[root@db Server]#
配置 Linux 內(nèi)核參數(shù)
Oracle 數(shù)據(jù)庫 11g 第 1 版需要以下所示的內(nèi)核參數(shù)設(shè)置。給出的值都為最小值,因此如果您的系統(tǒng)使用一個更大的值,則不要進(jìn)行更
改。Linux 允許在系統(tǒng)啟動并運行時修改大多數(shù)內(nèi)核參數(shù),所以無需在修改內(nèi)核參數(shù)后重啟系統(tǒng)。
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=4194304
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=262144
注意,OEL 5 已經(jīng)為 kernel.shmall 和 kernel.shmmax 定義了值。如果默認(rèn)值等于或大于要求值,則使用默認(rèn)值。
如果您按照以上說明安裝了 Linux,且內(nèi)核參數(shù)全部采用默認(rèn)值,則只需在以 root 用戶身份登錄后執(zhí)行下命令。
[root@db Server]# cat >> /etc/sysctl.conf << EOF
> kernel.shmmni = 4096
> kernel.sem = 250 32000 100 128
> fs.file-max = 65536
> net.ipv4.ip_local_port_range = 1024 65000
> net.core.rmem_default=4194304
> net.core.wmem_default=262144
> net.core.rmem_max=4194304
> net.core.wmem_max=262144
> EOF
[root@db Server]# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
[root@db Server]#
以 root 用戶身份運行以下命令來驗證您的設(shè)置:
/sbin/sysctl -a | grep shm
/sbin/sysctl -a | grep sem
/sbin/sysctl -a | grep file-max
/sbin/sysctl -a | grep ip_local_port_range
/sbin/sysctl -a | grep rmem_default
/sbin/sysctl -a | grep rmem_max
/sbin/sysctl -a | grep wmem_default
/Esx:b in/sysctl -a | grep wmem_max
[root@db Server]# /sbin/sysctl -a | grep shm
kernel.shmmni = 4096
kernel.shmall = 268435456
kernel.shmmax = 4294967295
[root@db Server]# /sbin/sysctl -a | grep sem
kernel.sem = 250??????? 32000?? 100???? 128
[root@db Server]# /sbin/sysctl -a | grep file-max
fs.file-max = 65536
[root@db Server]# /sbin/sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range = 1024???? 65000
[root@db Server]# /sbin/sysctl -a | grep rmem_default
net.core.rmem_default = 4194304
[root@db Server]# /sbin/sysctl -a | grep rmem_max
net.core.rmem_max = 4194304
[root@db Server]# /sbin/sysctl -a | grep wmem_default
net.core.wmem_default = 262144
[root@db Server]# /sbin/sysctl -a | grep wmem_max
net.core.wmem_max = 262144
[root@db Server]#
為 oracle 用戶設(shè)置 Shell 限制
Oracle 建議對每個 Linux 帳戶可以使用的進(jìn)程數(shù)和打開的文件數(shù)設(shè)置限制。要進(jìn)行這些更改,以 root 用戶的身份執(zhí)行下列命令:
cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
[root@db Server]# cat >> /etc/pam.d/login <<EOF
> session required /lib/security/pam_limits.so
> EOF
修改 bash 和 ksh 的默認(rèn)配置文件以及 cshell 的默認(rèn)登錄腳本。
[root@db Server]# 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
limit descriptors 65536
umask 022
endif[root@db Server]# cat >> /etc/csh.login <<EOF
> if ( $USER == "oracle" ) then
> limit maxproc 16384
> limit descriptors 65536
> umask 022
> endif
> EOF
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
