1.關(guān)閉selinux
vim /etc/selinux/conf
SELINUX= disabled
2.安裝軟件包
官方參考:http://docs.oracle.com/cd/E11882_01/install.112/e24326/toc.htm#BHCCADGD
用yum進(jìn)行安裝
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*i686 compat-libstdc++-33*.devel compat-libstdc++-33 compat-libstdc++-33*.devel gcc gcc-c++ glibc glibc*.i686 glibc-devel glibc-devel*.i686 ksh libaio libaio*.i686 libaio-devel libaio-devel*.devel libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.devel libXi libXi*.i686 libXtst libXtst*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686
3.創(chuàng)建oinstall和dba組和oracle用戶
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
驗(yàn)證創(chuàng)建是否正確
[root@oracledb ~]# id oracle
uid=1001(oracle) gid=1001(oinstall) groups=1001(oinstall),1002(dba)
4.配置參數(shù)
vim /etc/sysctl.conf
在下面添加
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912? ?
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
sysctl -p? 使之生效
vim /etc/security/limits.conf
在尾部添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
vim /etc/pam.d/login?
增加或修改以下內(nèi)容
session required /lib64/security/pam_limits.so
session required pam_limits.so
vim /etc/profile
增加或修改以下內(nèi)容
if [ $USER = "oracle" ]; then
? ? if [ $SHELL = "/bin/ksh" ]; then
? ? ? ? ulimit -p 16384
? ? ? ? ulimit -n 65536
? ? else
? ? ? ? ulimit -u 16384 -n 65536
? ? fi
fi
source /etc/profile
使之生效
5.創(chuàng)建安裝路徑功蜓,開始靜默安裝
創(chuàng)建安裝目錄
mkdir -p /u01/app/
chown -R oralce:oinstall
chmod -R 775 /u01/app/
配置環(huán)境變量
su oracle
cd ~
vim .bash_profile
底部添加
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=dbsrv2
使之生效
source .bash_profile
解壓oracle軟件
su root
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_1of2.zip
復(fù)制響應(yīng)文件模板
su oracle
mkdir etc
cp /usr/local/src/database/response/*? /home/oracle/etc/
設(shè)置響應(yīng)文件權(quán)限
su root
chmod 700? /home/oracle/etc/*.rsp
準(zhǔn)備靜默安裝 ,修改安裝Oracle軟件的響應(yīng)文件/home/oracle/etc/db_install.rsp
su oracle
cd ~
vim etc/db_install.rsp
對(duì)著下圖相應(yīng)設(shè)置
開始靜默安裝
cd /usr/local/src/database
./runInstaller -silent -responseFile /home/oracle/etc/db_install.rsp
出現(xiàn)類似如下提示表示安裝完成:
The following configuration scripts need to be executed as the "root" user.?
#!/bin/sh?
#Root scripts to run
/u01/app/oraInventory/orainstRoot.sh
/u01/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.
6.配置監(jiān)聽 建庫
su oracle
cd ~
vim .bash_profile
增加以下內(nèi)容
export ROACLE_PID=ora11g
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export?LANG="zh_CN.UTF-8"
export?NLS_LANG="SIMPLIFIED?CHINESE_CHINA.AL32UTF8"
export?NLS_DATE_FORMAT='yyyy-mm-dd?hh24:mi:ss'
配置監(jiān)聽
netca /silent /responsefile /home/oracle/etc/netca.rsp
啟動(dòng)監(jiān)聽
lsnrctl start
編輯dbca建庫3杪臁J胶场!
建庫 (會(huì)清屏求厕,連續(xù)輸入2次密碼即可)
dbca -silent -responseFile etc/dbca.rsp
刪除實(shí)例:(dbca刪除實(shí)例用法著隆,一般建庫成功就算完畢了)
dbca -silent -deleteDatabase -sourcedb dbsrv2
至此。呀癣。安裝建庫一套操作完成