下載oracle的安裝包:
下載地址:
注意下載oracle是需要注冊oracle的
http://download.oracle.com/otn/nt/oracle11g
下載兩個包:
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
1、上傳:到服務器:
mkdir -p /usr/local/oracle
cd /usr/local/oracle
將兩個包放在環境中:
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
2、准備oracle的安裝目標目錄
mkdir –p /opt/oracle
3、創建oracle相關用戶和用戶組
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
passwd oracle
輸入密碼:
修改安裝目錄權限:
chown –R oracle:oinstall /opt/oracle
4,掛載安裝載:
上傳安裝盤到服務器:
安裝盤名稱:RHEL_5.6x86_64.iso
掛載目錄:/home/os
mkdir -p /home/os
mount -o loop -t iso9660 RHEL_5.6x86_64.iso os
cd os/Server
5,安裝所需要基本編譯工具:
[root@localhost oracle]#rpm -ivh kernel-headers-
[root@localhost oracle]#rpm -ivh glibc-headers-
[root@localhost oracle]#rpm -ivh glibc-devel-
[root@localhost oracle]#rpm -ivh libgomp-
[root@localhost oracle]#rpm -ivh sysstat-
[root@localhost oracle]#rpm -ivh libaio-devel-
[root@localhost oracle]#rpm -ivh libstdc++-devel-
[root@localhost oracle]#rpm -ivh unixODBC-
[root@localhost oracle]#rpm -ivh unixODBC-devel
[root@localhost oracle]#rpm -ivh gcc-
[root@localhost oracle]#rpm -ivh gcc-c++-
[root@localhost oracle]#rpm -ivh elfutils-libelf-devel- elfutils-libelf-devel-static-
6,設置修改核參數:
打開 /etc/sysctl.conf,在最後加入以下內容
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
使其生效:
sysctl -p
7,修改 /etc/security/limits.conf,oracle 用戶登陸的限制參數:在最後加入以下內容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
8,修改系統環境變量/etc/profile
修改環境變量/etc/profile,加入以下內容
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
9:設置ORACLE環境變量
export ORACLE_SID=orcl
export ORACLE_BASE=/opt/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
10:修改用戶登陸環境變量 .bashrc
export ORACLE_SID=orcl
export ORACLE_BASE=/opt/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
11:執行安裝
安裝第一步:
su - oracle
cd /usr/local/oracle/database
請下載db.rsp 到家目錄 /home/oracle下,然後執行
./runInstaller -silent -noconfig -ignorePrereq -responseFile /home/oracle/db.rsp
執行
查看安裝過程
可以到/home/oracle/oraInventory/logs 目錄下查看安裝進度。
tail -100f installActions2014-09-03_10-36-42AM.log
3)安裝成功提示執行腳本
到最後提示:
/opt/app/oracle/oraInventory/orainstRoot.sh
/opt/app/oracle/product/11.2.0/db_1/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
4. Return to this window and hit "Enter" key to continue
Successfully Setup Software.