Oracle 11g CentOS7 Silent Installation Tutorial (no graphical interface, Remote installation)

Source: Internet
Author: User
Tags chmod dba file permissions










First, the installation environment based on trade secrets will not show. The basic configuration of the environment is understood



Introduction to CENTOS7 operating system here






Minimized installation, 2G memory, 20G disk space, 1-core CPU, CONFIGURED network ip:192.168.xxx.xxx




Second, the operating system before the preparation of work



1. Log in to the operating system using the root user






2.yum Install the Unzip software to unzip the uploaded Oracle installation files.






[Email protected] ~]# yum install unzip–y






3. Unzip the Oracle Setup program






[Email protected] ~]# cd/tmp






[Email protected] tmp]# unzip Linux.x64_11gR2_database_1of2.zip && unzip Linux.x64_11gr2_database_ 2of2.zip






After the decompression is completed, a database folder is produced in the/TMP directory, which is the Oracle 11g installation file.












4.Yum install vim software for editing configuration files (personal habits, do not install VIM, use VI can also).






[Email protected] tmp]# yum install vim-y






5. Add host name in/etc/hosts file






[Email protected] tmp]# vim/etc/hosts






Add 192.168.206.135 CentOS












6. Turn off SELinux






[Email protected] tmp]# vim/etc/selinux/config






Set selinux=disabled












[Email protected] tmp]# setenforce 0












7. Turn off the firewall






[[email protected] tmp]# service iptables Stop






[Email protected] ~]# systemctl stop Firewalld






[Email protected] ~]# systemctl disable FIREWALLD






8. Installing the Oracle 11g dependency Package






[Email protected] tmp]# yum install yum install gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel E Lfutils-libelf-devel-static ksh libaio libaio-devel numactl-devel sysstat unixODBC unixodbc-devel pcre-devel–y












9. Add installation users and user groups












[Email protected] tmp]# groupadd oinstall






[[email protected] tmp]# Groupadd dba






[Email protected] tmp]# useradd-g oinstall-g dba Oracle






[Email protected] tmp]# passwd Oracle






[[email protected] tmp]# ID Oracle






UID=1001 (Oracle) gid=1001 (oinstall) group =1001 (Oinstall), 1002 (DBA)












10. Modify kernel parameter configuration file






[Email protected] ~]# vim/etc/sysctl.conf












Add the following content












FS.AIO-MAX-NR = 1048576






Fs.file-max = 6815744






Kernel.shmall = 2097152






Kernel.shmmax = 1073741824






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












[Email protected] ~]# sysctl–p












where Kernel.shmmax = 1073741824 is the half of the native physical memory (2G), in bytes.












11. Modify the user's limit file






[Email protected] ~]# vim/etc/security/limits.conf












Add the following content












Oracle Soft Nproc 2047






Oracle Hard Nproc 16384






Oracle Soft Nofile 1024






Oracle Hard Nofile 65536






Oracle Soft Stack 10240












To modify the/etc/pam.d/login file:






[Email protected] ~]# vim/etc/pam.d/login












Add the following content:












Session required/lib64/security/pam_limits.so






Session Required Pam_limits.so












To modify the/etc/profile file:






[Email protected] ~]# Vim/etc/profile












Add the following content:












if [$USER = "Oracle"]; Then






if [$SHELL = "/bin/ksh"]; Then






Ulimit-p 16384






Ulimit-n 65536






Else






Ulimit-u 16384-n 65536






Fi






Fi












12. Create the installation directory and set file permissions












[Email protected] ~]# mkdir-p/u01/app/oracle/product/11.2.0






[Email protected] ~]# mkdir/u01/app/oracle/oradata






[Email protected] ~]# mkdir/u01/app/oracle/inventory






[Email protected] ~]# Mkdir/u01/app/oracle/fast_recovery_area






[Email protected] ~]# chown-r oracle:oinstall/u01/app/oracle






[Email protected] ~]# chmod-r 775/u01/app/oracle












13. Setting Oracle User Environment variables












[Email protected] ~]# su-oracle






[[email protected] ~]$ vim. Bash_profile






Add the following content:












Oracle_base=/u01/app/oracle






Oracle_home= $ORACLE _base/product/11.2.0






Oracle_sid=orcl






Path= $PATH: $ORACLE _home/bin






Export Oracle_base oracle_home oracle_sid PATH












14. Edit the Silent install response file






[Email protected] ~]$ cp-r/tmp/database/response/.






[Email protected] ~]$ CD response/






[Email protected]os response]$ vim db_install.rsp












The options you need to set are as follows:












Oracle.install.option=install_db_swonly






Oracle_hostname=centos






Unix_group_name=oinstall






Inventory_location=/u01/app/oracle/inventory






Selected_languages=en,zh_cn






oracle_home=/u01/app/oracle/product/11.2.0






Oracle_base=/u01/app/oracle






Oracle.install.db.installedition=ee






Oracle.install.db.dba_group=dba






Oracle.install.db.oper_group=dba






Decline_security_updates=true










Third, silently install Oracle 11g according to the response file



[Email protected] response]$ cd/tmp/database/






[Email protected] database]$ ./runinstaller-silent–responsefile






/home/oracle/response/db_install.rsp–ignoreprereq











Begins a silent installation of Oracle in the background. During the installation process, if [WARNING] is not heeded, the installer is still in the background, and if [FATAL] is present, the Setup program has stopped.






The log for this installation session can be found at the following location:






/u01/app/oracle/inventory/logs/installactions2015-06-08_04-00-25pm.log






You can toggle the terminal execution Top command to see that the background process is always installed, and the/u01 directory is growing,






When the following prompt appears, the installation succeeds:












Execute the script as required.






Open terminal, log in as root, execute script:






[Email protected] ~]# sh/u01/app/oracle/inventory/orainstroot.sh






[Email protected] ~]# sh/u01/app/oracle/product/11.2.0/root.sh










Iv. Configuring monitoring in silent mode



Re-use Oracle User Login






[Email protected] ~]$ ./NETCA/SILENT/RESPONSEFILE/HOME/ORACLE/DATABASE/RESPONSE/NETCA.RSP












After running successfully, generate Listener.ora and Sqlnet.ora in/u01/app/oracle/product/11.2.0/network/admin/






With the netstat command, you can see that port 1521 is listening.






Yum installs Netstat software, and the package is in Net-tools.






[Email protected] ~]# yum install net-tools






[Email protected] ~]# Netstat-tnulp | grep 1521










Create a new library in a silent way, and create a corresponding example



[Email protected] ~]$ vim/home/oracle/response/dbca.rsp






Set the following parameters:






Gdbname = "ORCL"






SID = "ORCL"






Syspassword = "Oracle"






Systempassword = "Oracle"






Sysmanpassword = "Oracle"






Dbsnmppassword = "Oracle"






Datafiledestination =/u01/app/oracle/oradata






Recoveryareadestination=/u01/app/oracle/fast_recovery_area






CHARACTERSET = "ZHS16GBK"






TotalMemory = "1638"












where totalmemory = "1638" is 1638MB, physical memory 2g*80%.












To configure silently:






[Email protected] ~]$ dbca-silent-responsefile/home/oracle/database/response/dbca.rsp












Check the instance process after the database is built:






[Email protected] ~]$ ps-ef | grep ora_ | grep-v grep











To view the listening status:






[Email protected] ~]$ lsnrctl status











Login to view instance status:






[Email protected] ~]$ sqlplus/as sysdba






Sql> select status from V$instance;










Vi. Oracle Boot-up settings



Http://jingyan.baidu.com/article/00a07f38ba654182d028dcfc.html












1. Modify/u01/app/oracle/product/11.2.0/bin/dbstart






[Email protected] ~]$ Vim/u01/app/oracle/product/11.2.0/bin/dbstart






Modify oracle_home_listner=$1 to oracle_home_listner= $ORACLE _home






2. Modify/u01/app/oracle/product/11.2.0/bin/dbshut






[Email protected] ~]$ Vim/u01/app/oracle/product/11.2.0/bin/dbshut






Modify oracle_home_listner=$1 to oracle_home_listner= $ORACLE _home






3. Modify the/etc/oratab file






[Email protected] ~]$ vim/etc/oratab






Change the last N of Orcl:/u01/app/oracle/product/11.2.0:n to Y to become orcl:/u01/app/oracle/product/11.2.0:y






4. Enter command Dbshut and Dbstart test






[Email protected] ~]$ Dbshut











The Oracle listener stops and the process disappears.












[Email protected] ~]$ Dbstart























The Oracle listener starts and the process starts.












5. Switch to the root account to create a self-starter script






[Email protected] ~]$ Su-






[Email protected] ~]# vim/etc/rc.d/init.d/oracle






Add the following (some values, such as Oracle_home and Oracle_user, can be modified according to the actual situation):






#!/bin/bash












# oracle:start/stop Oracle Database 11g R2






# chkconfig:345 90 10






# description:the Oracle database is an object-relational database Management System.






#






. /etc/rc.d/init.d/functions






Lockfile=/var/lock/subsys/oracle






oracle_home=/u01/app/oracle/product/11.2.0/db_1/






Oracle_user=oracle






Case "$" in






' Start ')






echo $ already running.






Exit 1






Fi






Echo-n $ "Starting Oracle Database:"






su-$ORACLE _user-c "$ORACLE _home/bin/lsnrctl start"






su-$ORACLE _user-c "$ORACLE _home/bin/dbstart $ORACLE _home"






su-$ORACLE _user-c "$ORACLE _home/bin/emctl start Dbconsole"






Touch $LOCKFILE






;;






' Stop ')






if [!-f $LOCKFILE]; Then






echo $ already stopping.






Exit 1






Fi






Echo-n $ "Stopping Oracle Database:"






su-$ORACLE _user-c "$ORACLE _home/bin/lsnrctl Stop"






su-$ORACLE _user-c "$ORACLE _home/bin/dbshut"






su-$ORACLE _user-c "$ORACLE _home/bin/emctl stop Dbconsole"






Rm-f $LOCKFILE






;;






' Restart ')






$ stop






$ start






;;






' Status ')






If [-f $LOCKFILE]; Then






echo $ started.






Else






echo $ stopped.






Fi






;;






*)






echo "Usage: $ [Start|stop|status]"






Exit 1






Esac






Exit 0












6. Modify/etc/init.d/oracle Service file permissions






[Email protected] init.d]# chmod 755/etc/init.d/oracle






7. Set to boot






[[email protected] ~]# chkconfig Oracle on












8. Perform service Oracle Start/stop/restart testing












9.Reboot Restart view Oracle monitoring and instance processes can be started automatically.






Oracle 11g CentOS7 Silent Installation Tutorial (no graphical interface, Remote installation)




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.