In order to provide the maximum performance of the system in Linux production environment, graphical desktops are generally not installed. So when we install a more complex database like Oracle, we are at a loss. Otherwise, Oracle has already considered the installation situation in this environment for us, which is the quiet installation in the legend.
Environmental preparation
- Linux Centos 7.4 64 bit, here I use Aliyun ECS host (1 core, 1G memory, 40G hard disk configuration)
- Oracle 11g R2 64 bit installation medium (version 11.2.0.1) download address: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
- linux.x64_11gR2_database_1of2.zip
- linux.x64_11gR2_database_2of2.zip
system requirements
- Memory: 1G (official minimum requirement 1G)
- Hard Disk: 40G (4.29G and 1.7G data files required for enterprise version installation)
#Memory grep MemTotal /proc/meminfo #Swap space ##Aliyun ecs does not provide swap partitions by default, so you need to add them by yourself. #Create a swap exchange file and a 2G file using the dd command dd if=/dev/zero of=/swap bs=1024 count=2048000 #Make it into swap format file mkswap /swap #Change swap file permissions chmod 600 /swap #Mount this file partition with the swap on command swapon /swap #View swap space grep SwapTotal /proc/meminfo #To prevent swap partition from changing to 0 after restart, set up boot-up automatic mounting vim /etc/fstab #Append at the end /swap swap swap default 0 0 #disk space df -ah
Pre-installation preparation
- Modify host name
#View host name information hostnamectl status #View only static, transient, or flexible hostnames, using the "- static", "transient" or "- pretty" options, respectively. hostnamectl --static hostnamectl --transient hostnamectl --pretty #Modify all three host names at the same time: static, transient and flexible host names oradb hostnamectl set-hostname oradb
- Add host name correspondence record in hosts
vim /etc/hosts 127.0.0.1 oradb
- Close Selinux
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config setenforce 0
Installing Oracle Dependency Packages and Environment Configuration
Here you install the dependent packages by installing the Oracle YUM source
cd /etc/yum.repos.d
wget http://public-yum.oracle.com/public-yum-ol7.repo
#Import RPM-GPG-KEY-oracle wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle #Install oracle-rdbms-server-11gR2-preinstall to quickly configure Oracle installation environment yum install oracle-rdbms-server-11gR2-preinstall -y #What the oracle-rdbms-server-11gR2-preinstall package does (1)Automatic installation oracle Required RPM package (2)Automatic creation oracle User and group group (3)Automatic configuration/etc/sysctl.conf Kernel parameters (4)Automatic configuration/etc/security/limits.conf parameter (5)Close NUMA=OFF (Turn off inconsistent memory access) #View background log content after installation more /var/log/oracle-rdbms-server-11gR2-preinstall/results/orakernel.log Adding group oinstall with gid 54321 Adding group dba Adding user oracle with user id 54321, initial login group oinstall, supplementary group dba and home directory /home/oracle Changing ownership of /home/oracle to oracle:oinstall Please set password for oracle user uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba) Creating oracle user passed Saving a copy of the initial sysctl.conf Verifying kernel parameters as per Oracle recommendations... Adding fs.file-max = 6815744 Adding kernel.sem = 250 32000 100 128 Adding kernel.shmmni = 4096 Adding kernel.shmall = 1073741824 Adding kernel.shmmax = 4398046511104 Adding kernel.panic_on_oops = 1 Adding net.core.rmem_default = 262144 Adding net.core.rmem_max = 4194304 Adding net.core.wmem_default = 262144 Adding net.core.wmem_max = 1048576 Changing net.ipv4.conf.all.rp_filter to match preinstall config net.ipv4.conf.all.rp_filter = 2 Changing net.ipv4.conf.default.rp_filter to match preinstall config net.ipv4.conf.default.rp_filter = 2 Adding fs.aio-max-nr = 1048576 Adding net.ipv4.ip_local_port_range = 9000 65500 Setting kernel parameters as per oracle recommendations... Altered file /etc/sysctl.conf Saved a copy of the current file in /etc/sysctl.d/99-oracle-rdbms-server-11gR2-preinstall-sysctl.conf Check /etc/sysctl.d for backups Verifying & setting of kernel parameters passed Setting user limits using /etc/security/limits.conf Verifying oracle user OS limits as per Oracle recommendations... Adding oracle soft nofile 1024 Adding oracle hard nofile 65536 Adding oracle soft nproc 16384 Adding oracle hard nproc 16384 Adding oracle soft stack 10240 Adding oracle hard stack 32768 Adding oracle hard memlock 134217728 Adding oracle soft memlock 134217728 Setting oracle user OS limits as per Oracle recommendations... Altered file /etc/security/limits.conf Original file backed up at /var/log/oracle-rdbms-server-11gR2-preinstall/backup/Jan-08-2018-11-18-56 Verifying & setting of user limits passed Saving a copy of /etc/default/grub file in /etc/default/grub-initial.orabackup Saving a copy of /etc/default/grub in /var/log/oracle-rdbms-server-11gR2-preinstall/backup/Jan-08-2018-11-18-56... Verifying kernel boot parameters as per Oracle recommendations... old boot params: "crashkernel=auto rhgb quiet net.ifnames=0 serial=tty0 console=ttyS0,115200n8" new boot params: "crashkernel=auto rhgb quiet net.ifnames=0 serial=tty0 console=ttyS0,115200n8 numa=off" old boot params: "crashkernel=auto rhgb quiet net.ifnames=0 serial=tty0 console=ttyS0,115200n8 numa=off" new boot params: "crashkernel=auto rhgb quiet net.ifnames=0 serial=tty0 console=ttyS0,115200n8 numa=off transparent_hugepage=never" Setting kernel boot parameters as per Oracle recommendations... G_DIR=/boot/grub2 Default kernel is -> /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64 Default saved_entry is -> CentOS Linux (3.10.0-693.2.2.el7.x86_64) 7 (Core) Default saved_entry_line is -> linux16 /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64 root=UUID=eb448abb-3012-4d8d-bcde-94434d586a31 ro crashkernel=auto rhgb quiet net.if names=0 serial=tty0 console=ttyS0,115200n8 Saving a copy of grubenv... in /var/log/oracle-rdbms-server-11gR2-preinstall/backup/Jan-08-2018-11-18-56 Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-693.2.2.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-f0f31005fb5a436d88e3c6cbf54e25aa Found initrd image: /boot/initramfs-0-rescue-f0f31005fb5a436d88e3c6cbf54e25aa.img done Unable to obtain the replica of saved entry line in new grub.cfg. Defaulting to first line matching the kernel The saved kernel /boot/vmlinuz-3.10.0-693.2.2.el7.x86_64 is now at position - 0 Boot parameters will be effected on next reboot Altered file /etc/default/grub Copy of the changed file is in - /etc/default/grub-oracle-rdbms-server-11gR2-preinstall.orabackup Copy of the original file is in - /var/log/oracle-rdbms-server-11gR2-preinstall/backup/Jan-08-2018-11-18-56 Verifying & setting of boot parameters passed Trying to add NOZEROCONF parameter... Taking a backup of existing file to /etc/sysconfig/network.orabackup Successfully added parameter NOZEROCONF to /etc/sysconfig/network Setting /etc/sysconfig/network parameters passed Disabling Transparent Hugepages. Refer Oracle Note:1557478.1 Disabling defrag. Refer Oracle Note:1557478.1 Taking a backup of old config files under /var/log/oracle-rdbms-server-11gR2-preinstall/backup/Jan-08-2018-11-18-56 #From the above log, you can see what oracle-rdbms-server-11gR2-preinstall has done for us. #Finally, you can see the location of the backup file. Do you suddenly feel that the world is very beautiful? What parameters, the kernel and so on are all configured?
Start installation
#1. Create a directory for installation mkdir -p /u01/oracle/product/11.2.0/db_1 #Change the owner of the oracle directory chown oracle:oinstall -R /u01 #Change permissions for oracle directories chmod 755 -R /u01/oracle #2. Setting Oracle environment variables su - oracle vim .bash_profile #Add the following export TMP=/tmp #Temporary File Directory Used in the Installation of oracle Software export TMPDIR=$TMP #Temporary File Directory Used in the Installation of oracle Software export ORACLE_BASE=/u01/oracle #Oracle's BASE directory, where all files about Oracle are stored export ORACLE_HOME=/u01/oracle/product/11.2.0/db_1 #Installation of Oracle Software Storage Directory export ORACLE_SID=orcl #Name of database instance to be created export ORACLE_TERM=xterm #When installing, specify the terminal's definition resource file xterm for window mode and rt100 for terminal debugging mode. export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$PATH #Search Path for SHELL Executable Files export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib #Search Path for Library Files export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib #class file in java executes the search bin path export EDITOR=vim #Text editing tools embedded in oracle operating environment export NLS_LANG=AMERICAN_AMERICA.UTF8 #The character set recognized by the oracle user as a client export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS' #The time explicit format recognized by the client of oracle user #Enabling environmental variables to take effect source .bash_profile #3. Decompress Oracle database unzip linux.x64_11gR2_database_1of2.zip unzip linux.x64_11gR2_database_2of2.zip [oracle@oradb u01]$ ls -lrt total 2295608 drwxr-xr-x 8 oracle oinstall 4096 Aug 21 2009 database -rw-r--r-- 1 oracle oinstall 1239269270 Aug 21 2009 linux.x64_11gR2_database_1of2.zip -rw-r--r-- 1 oracle oinstall 1111416131 Aug 21 2009 linux.x64_11gR2_database_2of2.zip drwxr-xr-x 3 oracle oinstall 4096 Jan 8 13:35 oracle #Oracle silently installs the response files needed [oracle@oradb response]$ pwd /u01/database/response [oracle@oradb response]$ ll total 76 -rw-rw-r-- 1 oracle oinstall 44969 Feb 14 2009 dbca.rsp #Create database replies -rw-rw-r-- 1 oracle oinstall 22557 Aug 15 2009 db_install.rsp #Installation response -rwxrwxr-x 1 oracle oinstall 5740 Feb 26 2009 netca.rsp #Responses to network settings such as monitoring, local service name, etc. #4. Configuration of response files [oracle@oradb response]$ cat db_install.rsp | grep -v "#"|grep -v "^$" oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0 oracle.install.option=INSTALL_DB_SWONLY ORACLE_HOSTNAME=oradb UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/oracle/oraInventory SELECTED_LANGUAGES=en,zh_CN ORACLE_HOME=/u01/oracle/product/11.2.0/db_1 ORACLE_BASE=/u01/oracle oracle.install.db.InstallEdition=EE oracle.install.db.isCustomInstall=false oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0 oracle.install.db.DBA_GROUP=dba oracle.install.db.OPER_GROUP=oinstall oracle.install.db.CLUSTER_NODES= oracle.install.db.config.starterdb.type=GENERAL_PURPOSE oracle.install.db.config.starterdb.globalDBName=ora11g oracle.install.db.config.starterdb.SID=ORCL oracle.install.db.config.starterdb.characterSet=AL32UTF8 oracle.install.db.config.starterdb.memoryOption=true oracle.install.db.config.starterdb.memoryLimit=512 oracle.install.db.config.starterdb.installExampleSchemas=false oracle.install.db.config.starterdb.enableSecuritySettings=true oracle.install.db.config.starterdb.password.ALL=oracle oracle.install.db.config.starterdb.password.SYS= oracle.install.db.config.starterdb.password.SYSTEM= oracle.install.db.config.starterdb.password.SYSMAN= oracle.install.db.config.starterdb.password.DBSNMP= oracle.install.db.config.starterdb.control=DB_CONTROL oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL= oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false oracle.install.db.config.starterdb.dbcontrol.emailAddress= oracle.install.db.config.starterdb.dbcontrol.SMTPServer= oracle.install.db.config.starterdb.automatedBackup.enable=false oracle.install.db.config.starterdb.automatedBackup.osuid= oracle.install.db.config.starterdb.automatedBackup.ospwd= oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE oracle.install.db.config.starterdb.fileSystemStorage.dataLocation= oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation= oracle.install.db.config.asm.diskGroup= oracle.install.db.config.asm.ASMSNMPPassword= MYORACLESUPPORT_USERNAME= MYORACLESUPPORT_PASSWORD= SECURITY_UPDATES_VIA_MYORACLESUPPORT= DECLINE_SECURITY_UPDATES=true PROXY_HOST= PROXY_PORT= PROXY_USER= PROXY_PWD= #5. Installation of database software [oracle@oradb database]$ /u01/database/runInstaller -silent -force -ignorePrereq -responseFile /u01/database/response/db_install.rsp Starting Oracle Universal Installer... Checking Temp space: must be greater than 120 MB. Actual 22087 MB Passed Checking swap space: must be greater than 150 MB. Actual 1999 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-01-08_02-28-33PM. Please wait ...[oracle@oradb database]$ [WARNING] [INS-32055] The Central Inventory is located in the Oracle base. CAUSE: The Central Inventory is located in the Oracle base. ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory. [WARNING] [INS-32055] The Central Inventory is located in the Oracle base. CAUSE: The Central Inventory is located in the Oracle base. ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory. You can find the log of this install session at: /u01/oracle/oraInventory/logs/installActions2018-01-08_02-28-33PM.log #Wait for 5 minutes or so to appear [oracle@oradb database]$ The following configuration scripts need to be executed as the "root" user. #!/bin/sh #Root scripts to run /u01/oracle/oraInventory/orainstRoot.sh /u01/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. #Execute the above two scripts under the root user [root@oradb ~]# /u01/oracle/oraInventory/orainstRoot.sh Changing permissions of /u01/oracle/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/oracle/oraInventory to oinstall. The execution of the script is complete. [root@oradb ~]# /u01/oracle/product/11.2.0/db_1/root.sh Check /u01/oracle/product/11.2.0/db_1/install/root_oradb_2018-01-08_14-36-51.log for the output of root script #At this point, Oracle software is installed, and then the listener is installed. #6. Installation Monitoring [oracle@oradb database]$ $ORACLE_HOME/bin/netca /silent /responseFile /u01/database/response/netca.rsp Parsing command line arguments: Parameter "silent" = true Parameter "responsefile" = /u01/database/response/netca.rsp Done parsing command line arguments. Oracle Net Services Configuration: Profile configuration complete. Oracle Net Listener Startup: Running Listener Control: /u01/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER Listener Control complete. Listener started successfully. Listener configuration complete. Oracle Net Services configuration successful. The exit code is 0 #Start monitoring program [oracle@oradb database]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 08-JAN-2018 14:40:56 Copyright (c) 1991, 2009, Oracle. All rights reserved. TNS-01106: Listener using listener name LISTENER has already been started #View the monitor status successfully [oracle@oradb database]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 08-JAN-2018 14:41:03 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 08-JAN-2018 14:39:22 Uptime 0 days 0 hr. 1 min. 41 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora Listener Log File /u01/oracle/diag/tnslsnr/oradb/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradb)(PORT=1521))) The listener supports no services The command completed successfully #7. Silent dbca Establishment of Database [oracle@oradb response]$ vim /u01/database/response/dbca.rsp GDBNAME = "orcl.oradb" #78 rows, global database name sid+hostname SID = "orcl" #149 elements CHARACTERSET = "AL32UTF8" #415 lines, encoding NATIONALCHARACTERSET= "UTF8" #425 elements #Start installation [oracle@oradb response]$ $ORACLE_HOME/bin/dbca -silent -responseFile /u01/database/response/dbca.rsp Enter SYS user password: Enter SYSTEM user password: Copying database files 1% complete 3% complete 11% complete 18% complete 26% complete 37% complete Creating and starting Oracle instance 40% complete 45% complete 50% complete 55% complete 56% complete 60% complete 62% complete Completing Database Creation 66% complete 70% complete 73% complete 85% complete 96% complete 100% complete Look at the log file "/u01/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details. #Start the database after installation (usually automatically) [oracle@oradb ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Mon Jan 8 14:57:49 2018 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 413372416 bytes Fixed Size 2213896 bytes Variable Size 268437496 bytes Database Buffers 138412032 bytes Redo Buffers 4308992 bytes Database mounted. Database opened. SQL> SQL> select INSTANCE_NAME,VERSION from v$instance; INSTANCE_NAME VERSION -------------- ---------------------------------------- orcl 11.2.0.1.0 #Monitoring situation [oracle@oradb ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 08-JAN-2018 15:01:42 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 08-JAN-2018 14:39:22 Uptime 0 days 0 hr. 22 min. 21 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora Listener Log File /u01/oracle/diag/tnslsnr/oradb/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradb)(PORT=1521))) Services Summary... Service "orcl.oradb" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... Service "orclXDB.oradb" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... The command completed successfully #Monitor normal
This is the whole process of Oracle 11gR2's silent installation in Centos7. The problems you encounter in the process of installation are welcome to leave a message.~~~