Centos7.6上静默安装oracle11.2.0.4.0

很多同学使用图形化安装oracle数据库,可是生产上大多数,是不会安装图形化包的,所以必须掌握怎么静默安装oracle数据库,下面就详细介绍怎么静默安装oracle11g数据库 。

Centos7.6上静默安装oracle11.2.0.4.0

文章插图
 
1.配置主机名vi /etc/sysconfig/networkNETWORKING=yesHOSTNAME=host1002.配置hosts信息vi /etc/hosts127.0.0.1localhost localhost.localdomain localhost4 localhost4.localdomain4::1localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.0.100host1003.安装必要的包先检查哪些包没安装
for i in binutils compat-gcc-44 compat-libstdc++-33 control-centergcc gcc-c++ glibc glibc-common glibc-devel libaio libgcc elfutils-libelf-devellibstdc++ libstdc++-devel libXp make compat-libcap1compat-libstdc++-33 libaio-devel sysstat unixODBC unixODBC-devel kshdorpm -q $i &>/dev/null || F="$F $i"done ;echo $F;unset F’缺少的包,用YUM安装就可以
4.修改内核参数vi /etc/sysctl.conf 到末尾 以下只出自oracle-rdbms-server-11gR2-preinstall自动做的修改
用#注释掉kernel.shmmax和kernel.shmall开头的两行
添加如下:
kernel.shmmax = 4398046511104kernel.shmall = 1073741824kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576fs.aio-max-nr = 1048576fs.file-max = 6815744vm.swAppiness=10以上参数为使用oracle 验证包自动配置的参数结果,vm.swappiness=10为减少使用SWAP,该值默认是60
kernel.shmall:表示共享内存总量,以页为单位
kernel.shmmax:参数用来定义单个共享内存段的最大值,单位为Byte(字节) 。
可以用一下脚本,设置kernel.shmall,kernel.shmmax参数值,其它值不用修改
#!/bin/bashpage_size=`getconf PAGE_SIZE`phys_pages=`getconf _PHYS_PAGES`if [ -z "$page_size" ]; thenecho Error:cannot determine page sizeexit 1fiif [ -z "$phys_pages" ]; thenecho Error:cannot determine number of memory pagesexit 2fishmall=`expr $phys_pages`shmmax=`expr $shmall * $page_size`echo # Maximum shared segment size in bytesecho kernel.shmmax = $shmmaxecho # Maximum number of shared memory segments in pagesecho kernel.shmall = $shmall5.修改的oracle用户限制vi /etc/security/limits.conf 末尾添加:
oraclesoftnofile1024oraclehardnofile65536oraclesoftnproc16384oraclehardnproc16384oraclesoftstack10240oraclehardstack327686. 修改的/etc/pam.d/loginvi /etc/pam.d/login 末尾添加:
sessionrequiredpam_limits.so7. 关闭的防火墙和selinux
Centos7.6上静默安装oracle11.2.0.4.0

文章插图
 
关闭的防火墙:
linux6:
service iptables stop
chkconfig iptables off
linux7:
systemctl stop firewalld
systemctl mask firewalld
禁用selinux:
setenforce 0
getenforce
vi /etc/selinux/config 确保以下内容
SELINUX=disabled
8. 更改ulimit 设置vi /etc/profile 末尾添加:
if [ /$USER = "oracle" ]; thenif [ /$SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fiumask 022fi9. 建立组合用户groupadd -g 501 oinstallgroupadd -g 502 dbauseradd -u 501 -g oinstall -G dbaoracle -d /home/oraclepasswd oracle10. 建立安装目录[root@ ~]#mkdir -p /u01/app/oracle/product/11.2.0/db_1mkdir -p /oracle/oradatachmod -R 775 /oraclechmod -R 775 /u01chown -R oracle:oinstall /oraclechown -R oracle:oinstall /u0111. 设置oracle用户的环境变量su - oracle
vi .bash_profile 末尾添加:
export ORACLE_BASE=/u01/appexport ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1export ORACLE_SID=crmdbexport PATH=$PATH:$ORACLE_HOME/binexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/libexport NLS_LANG=AMERICAN_AMERICA.ZHS16GBKexport ORACLE_UNQNAME=crmdbexport NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'如果是UT8,可以设置export NLS_LANG=AMERICAN_AMERICA.AL32UTF812.swap分区设置fallocate -l 250M /swapfilechmod 600 /swapfilemkswap /swapfileswapon /swapfileswapon -s在/etc/fstab中添加以下内容
/swapfile swap swap sw 0 0
13.获取软件安装配置文件INVENTORY_LOCATION不要存放在ORACLE_BASE之下
cat db_install.rsp |grep -v "#"|sed'/^ *$/d'oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0oracle.install.option=INSTALL_DB_SWONLYORACLE_HOSTNAME=cbov10-tidb57-206UNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/u01/app/oraInventorySELECTED_LANGUAGES=en,zh_CNORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1ORACLE_BASE=/u01/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.EEOptionsSelection=falseoracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0oracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=oinstallSECURITY_UPDATES_VIA_MYORACLESUPPORT=falseDECLINE_SECURITY_UPDATES=trueoracle.installer.autoupdates.option=SKIP_UPDATES./runInstaller -silent -showProgress -responseFile /u01/soft/database/response/dbinstall.rsp


推荐阅读