1. 硬件資源
1. EM流暢運行需要至少1GB的內(nèi)存,這1GB的內(nèi)存并不參與oracle服務(wù)器本身的運行
2. 至少需要1.5GB的swap區(qū)域,oracle建議swap區(qū)域為物理內(nèi)存大小的2倍
3. /tmp目錄需要至少400M的空間
4. oracle軟件本身所需要的磁盤空間,需要1.3GB到3.5GB的空間,具體所占空間依賴我們選擇組件的多少
2. 開始安裝oracle軟件
1. # vim /etc/redhat-release
Red Hat Enterprise Linux Server release 4 (Tikanga) /由于oracle10g不支持rhel5,所以改成4,安裝完后再改回來
2. # vim /etc/hosts
192.168.0.22 station22.example.com station22 /需設(shè)定地址,用127.0.0.1檢測通不過
# vim /etc/sysconfig/network
host station22.example.com
3. 檢查安裝oracle10g所需軟件包(版本可高于所列版本)
setarch-2*
make-3*
glibc-2*
libaio-0*
compat-libstdc++-33-3*
compat-gcc-34-3*
compat-gcc-34-c++-3*
gcc-4*
libXp-1*
openmotif-2*
compat-db-4*
sysstat-5.0.5-1
4. 修改Linux內(nèi)核配置文件,如沒有則自己添加
kernel.shmall = 2097152 /系統(tǒng)一次可以使用的共享內(nèi)存段的總?cè)萘浚ㄒ皂摓閱挝唬,默認值是2097152,通常不需要更改
kernel.shmmax = 2147483648 /單個進程能夠使用的共享內(nèi)存段的最大尺寸(以字節(jié)為單位)。默認為32MB,對于oracle來說,該默認值太低了,通常將其設(shè)置為2GB
kernel.shmmni = 4096 /設(shè)置系統(tǒng)范圍內(nèi)共享內(nèi)存段的最大個數(shù)。該參數(shù)的默認是4096,通常不需要更改
kernel.sem = 250 32000 100 128 /設(shè)置的信號量
fs.file-max = 65536 /文件句柄的最大數(shù)量。文件句柄設(shè)置表示在Linux系統(tǒng)中可以打開的文件數(shù)量
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
# sysctl -p
注:內(nèi)核參數(shù)并非必須修改,可根據(jù)自己初階情況而定。
5. # vim /etc/security/limits.conf /增加操作系統(tǒng)用戶的nofile和nproc的值
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
nofile: 表示操作系統(tǒng)用戶可以同時打開的最大文件數(shù);
nproc: 表示單個用戶同時可執(zhí)行的最大進程數(shù)
6. # /vim /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
7. 因為SELINUX對oracle有影響,所以把SELINUX禁用。
8. 新增組和用戶
# groupadd oinstall
# groupadd dba
# useradd -g oinstall -G dba oracle
# passwd oracle
9. 以oracle身份登錄,設(shè)置用戶oracle的環(huán)境變量,從而在用戶oracle登錄操作系統(tǒng)時,以下的變量就立刻生效。
# su - oracle
# vim .bash_profile
#Oracle Settings
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
# source .bash_profile
10. 創(chuàng)建oracle的安裝目錄,并把權(quán)限賦予oracle用戶
# mkdir -p /u01/app/oracle/product/10.2.0/db_1
# chown -R oracle.oinstall /u01
11. me是訪問hgfs共享來拷貝安裝文件的
# cd /mnt/hgfs/
# cp 10201_database_linux32.zip /
# cd /
# unzip 10201_database_linux32.zip
#ls
# chown -R oracle.oinstall database/
# chmod -R 775 database/
12. 設(shè)置安裝語言,因為中文安裝會有亂碼所以設(shè)置用英文安裝
# export LC_ALL=en_US
13. 進入oracle安裝目錄,執(zhí)行./runInstaller進行安裝
如果提示/database/install/.oui權(quán)限不夠,進入install目錄,執(zhí)行
# chmod u+x .oui
# chmod u+x unzip
后再執(zhí)行
# ./runInstaller
安裝過程中選擇高級安裝,并將數(shù)據(jù)庫語言先中文字符集,選GBK,如果沒有就選擇UTF-8
14. 安裝快完成的時候,會出現(xiàn)提示,必須以root的身份執(zhí)行兩個腳本
# su - root
# /u01/app/oracle/oraInventory/orainstRoot.sh
# /u01/app/oracle/product/10.2.0/db_1/root.sh
3. 創(chuàng)建數(shù)據(jù)庫
1. # dbca
2. 輸入全局數(shù)據(jù)庫名
orcl
3. 輸入相關(guān)用戶的密碼
4. 自動內(nèi)存管理指定為數(shù)據(jù)庫實例分配60%的物理內(nèi)存總量
Character Sets根據(jù)需要選擇不同的字符集,如果數(shù)據(jù)只用來存放中文的話,則可以選擇ZHS16GBK作為數(shù)據(jù)庫字符集