一、安裝前準(zhǔn)備
1.安裝介質(zhì)
2、添加oracle用戶(hù)和組
[root@zquathost oracle]# groupadd oinstall
[root@zquathost oracle]# groupadd dba
[root@zquathost oracle]# useradd -g oinstall -G dba -m oracle
[root@zquathost oracle]# passwd oracle
3.創(chuàng)建文件夾并授權(quán)
[root@zquathost oracle]# mkdir /oracle/app
[root@zquathost oracle]# mkdir /oracle/app/oracle
[root@zquathost oracle]# mkdir /oracle/app/oradata
[root@zquathost oracle]# mkdir /oracle/app/oracle/product
[root@zquathost oracle]# chown -R oracle:oinstall /oracle/app
[root@zquathost oracle]# ls -l
4.內(nèi)存參數(shù)設(shè)置
[root@zquathost ~]# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nofile 65536
oracle hard memlock 52428800
oracle soft memlock 52428800
[root@zquathost ~]# vi /etc/sysctl.conf
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
[root@zquathost ~]# sysctl -p
5.oracle用戶(hù)環(huán)境變量設(shè)置
[root@zquathost /]# su - oracle
[oracle@zquathost ~]$ vi .bash_profile
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib:/usr/local/lib
6.安裝oracle依賴(lài)包
[root@zquathost ~]# yum install -y gcc
[root@zquathost ~]# yum install -y libaio-devel
[root@zquathost ~]# yum install -y gcc-c++
[root@zquathost ~]# yum install -y elfutils-libelf-devel
[root@zquathost ~]# yum install -y compat-libstdc++-33
下載pdksh-5.2.14-30.x86_64.rpm包到/home目錄
[root@zquathost ~]# rpm -ivh /home/pdksh-5.2.14-30.x86_64.rpm
注意:如果已經(jīng)有g(shù)cc后就不需要執(zhí)行這一步嫩舟,此步為可選步驟键袱。
二、oracle安裝步驟
1看铆、啟動(dòng)安裝界面
以xdm為例,如果有疑問(wèn),可參考《圖形終端遠(yuǎn)程操作Linux》召廷,鏈接:http://baijiahao.baidu.com/builder/preview/s?id=1564735350184338
安裝好XManager后,啟動(dòng)Xmanager - Passive,會(huì)最小化到狀態(tài)欄,執(zhí)行xclock測(cè)試
將安裝介質(zhì)復(fù)制到/oracle/app中進(jìn)行解壓:
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
也可以在解壓之前先判斷壓縮包是否完整:
unzip –t linux.x64_11gR2_database_1of2.zip
unzip –t linux.x64_11gR2_database_2of2.zip
在/oracle/app/database目錄執(zhí)行./runInstaller.sh账胧,彈出如下界面:
2竞慢、開(kāi)始安裝
3、語(yǔ)言選擇
4治泥、數(shù)據(jù)庫(kù)版本選擇
5筹煮、選擇安裝目錄
6、數(shù)據(jù)庫(kù)類(lèi)型選擇
7居夹、實(shí)例名稱(chēng)
8败潦、參數(shù)設(shè)置
9、設(shè)置數(shù)據(jù)存儲(chǔ)目錄
10准脂、系統(tǒng)用戶(hù)口令
11劫扒、完成安裝
當(dāng)看到上述界面時(shí),說(shuō)明需要使用root用戶(hù)執(zhí)行上述腳本:
執(zhí)行腳本
[root@ zquathost ~]# sh /oracle/app/oraInventory/orainstRoot.sh
Changing permissions of /oracle/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /oracle/app/oraInventory to oinstall.
The execution of the script is complete.
[root@ zquathost ~]# sh /oracle/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER=oracle
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
驗(yàn)證安裝是否完成
[oracle@zquathost ~]$ sqlplus / as sysdba
如果可以訪(fǎng)問(wèn)狸膏,說(shuō)明安裝成功沟饥。