linux CentOS7下快速靜默安裝Oracle11GR2數(shù)據(jù)庫并創(chuàng)建實例
本文章適合已經熟悉安裝過程,需要快速操作安裝部署使用。
多行在一起的命令可以復制一起執(zhí)行;
初學者建議分步學習:https://edu.51cto.com/course/15530.html
創(chuàng)新互聯(lián)公司2013年至今,是專業(yè)互聯(lián)網(wǎng)技術服務公司,擁有項目成都網(wǎng)站設計、網(wǎng)站制作網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元渠縣做網(wǎng)站,已為上家服務,為渠縣各地企業(yè)和個人服務,聯(lián)系電話:18982081108
linux.x64_11gR2_database_1of2.zip (oracle官網(wǎng)下載)
linux.x64_11gR2_database_2of2.zip (oracle官網(wǎng)下載)
rlwrap-0.42.tar.gz (51CTO下載里搜)
三個安裝包;
操作系統(tǒng)環(huán)境:最小化安裝 centos7
mkdir -p /data/u01/software
yum -y install lrzsz vim unzip
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
echo "Oracle20190728"| passwd --stdin oracle
mkdir -p /data/u01/app/oracle/product/11.2.0/dbhome_1
mkdir /data/u01/app/oracle/{oradata,inventory,fast_recovery_area}
chown -R oracle:oinstall /data/u01/app/oracle
chmod -R 775 /data/u01/app/oracle
yum -y install gcc gcc-c++ make binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static glibc glibc-common glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel numactl-devel sysstat unixODBC unixODBC-devel kernelheaders pdksh pcre-devel readline*
yum -y update
cd /data/u01/software
ls
cd /data/u01/software
ls
上傳三個包
echo "#"$(date) "quick install oracle11GR2 add vim /etc/sysctl.conf">> /etc/sysctl.conf
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmax = 1073741824" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048576" >> /etc/sysctl.conf
sysctl -p
echo "#"$(date) "quick install oracle11GR2 add vim /etc/security/limits.conf">>/etc/security/limits.conf
echo "oracle soft nproc 2047" >>/etc/security/limits.conf
echo "oracle hard nproc 16384" >>/etc/security/limits.conf
echo "oracle soft nofile 1024" >>/etc/security/limits.conf
echo "oracle hard nofile 65536" >>/etc/security/limits.conf
echo "oracle soft stack 10240" >>/etc/security/limits.conf
echo "#"$(date) "quick install oracle11GR2 add vim /etc/pam.d/login">>/etc/pam.d/login
echo "session required /lib64/security/pam_limits.so">>/etc/pam.d/login
echo "session required pam_limits.so">>/etc/pam.d/login
echo "#"$(date) "quick install oracle11GR2 add vim /etc/profile">>/etc/profile
echo 'if [ $USER = "oracle" ]; then'>>/etc/profile
echo 'if [ $SHELL = "/bin/ksh" ]; then'>>/etc/profile
echo "ulimit -p 16384">>/etc/profile
echo "ulimit -n 65536">>/etc/profile
echo "else">>/etc/profile
echo "ulimit -u 16384 -n 65536">>/etc/profile
echo "fi">>/etc/profile
echo "fi">>/etc/profile
cd /data/u01/software
tar -xvf rlwrap-0.42.tar.gz
cd rlwrap-0.42
./configure
make
make install
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
su - oracle
echo "#"$(date) "quick install oracle11GR2 add vim .bash_profile">>.bash_profile
echo "export ORACLE_BASE=/data/u01/app/oracle">>.bash_profile
echo "export ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1">>.bash_profile
echo "export ORACLE_SID=orcl">>.bash_profile
echo 'export ORACLE_UNQNAME=$ORACLE_SID'>>.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>>.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8">>.bash_profile
echo "alias sqlplus='rlwrap sqlplus'">>.bash_profile
echo "alias rman='rlwrap rman'">>.bash_profile
source .bash_profile
ls
拷貝備份一份響應文件:
cp -R /data/u01/software/database/response/ .
cd response/
vim db_install.rsp
修改內容:
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=localhost.localdomain
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/data/u01/app/oracle/inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/data/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true
切換到解壓的安裝包目錄執(zhí)行安裝:
cd /data/u01/software/database/
./runInstaller -silent -responseFile /home/oracle/response/db_install.rsp -ignorePrereq
sqlplus / as sysdba
配置響應文件:
vim /home/oracle/response/dbca.rsp
修改內容(注意修改選項前面的#要刪除):
GDBNAME = "orcl"
SID = "orcl"
SYSPASSWORD = "輸入密碼"
SYSTEMPASSWORD = "輸入密碼"
SYSMANPASSWORD = "輸入密碼"
DBSNMPPASSWORD = "輸入密碼"
DATAFILEDESTINATION =/data/u01/app/oracle/oradata
RECOVERYAREADESTINATION=/data/u01/app/oracle/fast_recovery_area
CHARACTERSET = "AL32UTF8"
TOTALMEMORY = "2048"
egrep -v "(^#|^$)" /home/oracle/response/dbca.rsp
安裝創(chuàng)建(等第六步成功后執(zhí)行):
cd ~
dbca -silent -responseFile /home/oracle/response/dbca.rsp
lsnrctl start
啟動監(jiān)聽器
lsnrctl stop
停止監(jiān)聽器命令.
lsnrctl status
查看監(jiān)聽狀態(tài).
實測30分鐘內可完成以上操作;
最快17分鐘完成以上操作;
運維、網(wǎng)管必會技能:linux centos7命令行靜默安裝oracle11GR2視頻課程視頻教程:http://edu.51cto.com/course/15530.html
linux CentOS7最小化安裝環(huán)境靜默安裝Oracle11GR2數(shù)據(jù)庫(靜默創(chuàng)建實例)