CentOS靜默安裝Oracle 11g(字符界面操作)

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)聽 建庫(kù)

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建庫(kù)?。?!


建庫(kù) (會(huì)清屏,連續(xù)輸入2次密碼即可)

dbca -silent -responseFile etc/dbca.rsp


刪除實(shí)例:(dbca刪除實(shí)例用法,一般建庫(kù)成功就算完畢了)


dbca -silent -deleteDatabase -sourcedb dbsrv2



至此。。安裝建庫(kù)一套操作完成

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容