Record the silent installation of Oracle11gR2 on Linux CentOS7.5.
1. Official minimum configuration
[Memory] 1G (official minimum requirement: 1G)
[Hard disk] 40GB (4.29GB and 1.7GB data files required for enterprise edition installation)
2. Preparation
[system environment] Linux CentOS7.5 64-bit
[Oracle version] Oracle 11gR2
【Oracle download address 】
Website download address
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
[Checking system version]
uname -m
Copy the code
cat /etc/redhat-release
Copy the code
[Change host name] (Optional)
sed -i "s/HOSTNAME=localhost.localdomain/HOSTNAME=oracledb/" /etc/sysconfig/network
Copy the code
hostname oracledb
Copy the code
[Add records corresponding to host names and IP addresses]
Install vim: yum -y install vim
Input:
vim /etc/hosts
Copy the code
Add: local IP address oracleDB at the end
[Close Selinux]
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
Copy the code
setenforce 0
Copy the code
Create users and groups (root: create Oracle installation group oinstall, dba: create database administrator group, and Oracle user)
groupadd -g 200 oinstall
Copy the code
groupadd -g 201 dba
Copy the code
Useradd -u 440 -g oinstall -g dba oracle #Copy the code
passwd oracle #(P)
Copy the code
Modify kernel parameters (add the following parameters to the /etc/sysctl.conf file for user root)
Input:
vim /etc/sysctl.conf
Copy the code
Add the following at the end
net.ipv4.ip_local_port_range= 9000 65500
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576
Copy the code
Input:
Sysctl -p # enables the configuration to take effectCopy the code
Modify the system resource limitations (root: modify the/etc/security/limits file, add the following parameters).
Input:
Vim/etc/security/limits. Add the following at the end of the conf #Copy the code
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
Copy the code
Modify user authentication options (for user root: add the following parameters to the /etc/pam.d/login file)
Input:
Vim /etc/pam.d/login #Copy the code
Session required pam_namespace.so # Add pam_limits.so session required pam_limits.soCopy the code
Modify user profile (for user root: add the following parameters to /etc/profile)
Vim /etc/profile #(not required if you set limits. Conf in step 6)Copy the code
if [ $USER ="oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fiCopy the code
[Create installation directory and set permissions]
mkdir -p /opt/app/oracle/
Copy the code
chmod 755 /opt/app/oracle/
Copy the code
chown oracle.oinstall -R /opt/app/oracle/
Copy the code
Setting Oracle Environment variables
(You are advised to use SSH to open two Windows and log in to the root user and oracle user respectively to avoid user switchover.)
Su - oracle # Switch userCopy the code
vim ~/.bash_profile
Copy the code
Input:
Export ORACLE_BASE=/opt/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin export ORACLE_SID=orcl export ORACLE_PID=ora11g export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/libCopy the code
Wq # Save and exitCopy the code
Source ~/.bash_profile # Takes effect immediatelyCopy the code
Env | grep ORA # to check the environment variable to be achievedCopy the code
3. Installation and configuration
3.0 Installing Dependency Packages
Oracle required dependencies include:
binutils2.2352.. 01.- 12.el7.x86_64
compat-libcap11.10- 3.el7.x86_64
compat-libstdc++- 333.23.- 71.el7.i686
compat-libstdc++- 333.23.- 71.el7.x86_64
gcc4.82.- 3.el7.x86_64
gcc-c++4.82.- 3.el7.x86_64
glibc2.17- 36.el7.i686
glibc2.17- 36.el7.x86_64
glibc-devel2.17- 36.el7.i686
glibc-devel2.17- 36.el7.x86_64
ksh
libaio0.3109.- 9.el7.i686
libaio0.3109.- 9.el7.x86_64
libaio-devel0.3109.- 9.el7.i686
libaio-devel0.3109.- 9.el7.x86_64
libgcc4.82.- 3.el7.i686
libgcc4.82.- 3.el7.x86_64
libstdc++4.82.- 3.el7.i686
libstdc++4.82.- 3.el7.x86_64
libstdc++-devel4.82.- 3.el7.i686
libstdc++-devel4.82.- 3.el7.x86_64
libXi1.72.1.el7.i686
libXi1.72.1.el7.x86_64
libXtst1.22.1.el7.i686
libXtst1.22.1.el7.x86_64
make3.82- 19.el7.x86_64
sysstat10.1. 51.el7.x86_64
unixODBC2.31.- 6.el7.x86_64 or later
unixODBC2.31.- 6.el7.i686 or later
unixODBC-devel2.31.- 6.el7.x86_64 or later
unixODBC-devel2.31.- 6.el7.i686 or later
Copy the code
# yum -y install # yum -y install
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
Copy the code
[Check whether all have been installed, and install separately those not installed]
rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel
Copy the code
3.1 install Oracle
(Put the downloaded Oracle compression package in the /opt directory and decompress it in the /opt directory.)
ls *.zip | xargs -n1 unzip -o
Copy the code
or
unzip linux.x64_11gR2_database_1of2.zip
Copy the code
unzip linux.x64_11gR2_database_2of2.zip
Copy the code
The database directory contains the Response directory, which contains three RSP files that will be used as templates for the response file during silent installation.
【 The functions of the three files are: 】
Dbca. RSP: creates the database reply netca. RSP: establishes the listener, the local service name and other network Settings replyCopy the code
Back up db_install. RSP and modify the content based on it
Modify the configuration file for silent installation
Vim db_install. RSP # Modify the following parametersCopy the code
Less/opt/database/response/db_install RSP | grep -v "#" | grep -v "^ $# to check the configurationCopy the code
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0 oracle.install.option=INSTALL_DB_SWONLY ORACLE_HOSTNAME=oracledb UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/opt/app/oracle/oraInventory SELECTED_LANGUAGES=en,zh_CN ORACLE_HOME = / opt/app/oracle/product / 11.2.0 / db_1 ORACLE_BASE = / opt/app/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. Rd BMS. Oci: 11.2.0.1.0, oracle.net work: 11.2.0.1.0, oracle.net work. The listener: 11.2.0.1.0, oracle. RDBMS: 11.2.0.1.0, oracle. Options: 1 1.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 from, orcle. RDBMS. Lbac: 11.2.0.1.0,. Oracle RDBMS. Rat: 11.2.0.1.0 oracle. The 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=ora11g oracle.install.db.config.starterdb.characterSet=AL32UTF8 oracle.install.db.config.starterdb.memoryOption=true oracle.install.db.config.starterdb.memoryLimit=1500 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_PWD=Copy the code
[Contents comparison and comparison]
3.1.1 Silent installation as user [Oracle
su - oracle
Copy the code
CD /opt/database/ # Go to the /opt/database directoryCopy the code
./runInstaller -silent -force -responseFile /opt/database/response/db_install.rsp
Copy the code
[WARING] can be ignored temporarily. At this time, the installation program is still in the background. If [FATAL] appears, the installation program has stopped.
The installation takes a while. If you want to check the installation progress, open another window and output session logs
Tail -f Specifies the absolute path of the log fileCopy the code
When Successfully Setup Software appears. Verify that the installation is successful, and then execute the script as user root as prompted
sh /opt/app/oracle/oraInventory/orainstRoot.sh
Copy the code
Sh/opt/app/oracle/product / 11.2.0 / db_1 / root. ShCopy the code
3.2 Configuring listeners
[Listening command]
Start the listener: LSNRCTL start Stop the listener: LSNRCTL stop Restart the listener: LSNRCTL reload View the listener: LSNRCTL statusCopy the code
(No input is required for actual operation)
3.2.1 Configuring the Listener (oracle user)
$ORACLE_HOME/bin/netca /silent /responseFile /opt/database/response/netca.rsp
Copy the code
3.2.2 Configuring the Listener (oracle user)
lsnrctl status
Copy the code
3.2.3 Building a DBCA Database silently (as user root)
su - root
Copy the code
vim /opt/database/response/dbca.rsp
Copy the code
Modify the following contents:
GDBNAME =" ORCL "// Line 78 encoding SID=" ORCL" // line 149 encoding SID CHARACTERSET="AL32UTF8" // Line 415 encoding NATIONALCHARACTERSET="UTF8" // line 425 codingCopy the code
Then execute (using the Oracle user)
su - oracle
Copy the code
$ORACLE_HOME/bin/dbca -silent -responseFile /opt/database/response/dbca.rsp
Copy the code
[After the execution, the screen will be cleared, and then directly enter the password twice to start automatic creation, without ignoring the screen flashing, directly enter.]
3.3 Starting the Database
# 输入
[oracle@oracledb ~]$ sqlplus / as sysdba
Copy the code
# output SQL * Plus: Release 11.2.0.1.0 Production on Mon Feb 16 14:26:57 2015 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to an idle instance.Copy the code
Enter SQL> startCopy the code
Sp2-1506: START, @or @@command has no argumentsCopy the code
Enter SQL> startupCopy the code
Total System Global Area 3290345472 bytes Fixed Size 2217832 bytes Variable Size 1795164312 bytes Database Buffers 1476395008 bytes Redo Buffers 16568320 bytes Database mounted. Database opened.Copy the code
(use show parameter; Or select table_name from dba_tables to check whether the table is normal.
Installation process I encountered a problem here, the solution – can be solved.
3.4 The Listener and Oracle database are automatically started upon startup
Input:
vim /etc/oratab
Copy the code
Among them:
*:/home/oracle/oracle92:N
Copy the code
Change the * in this line to the SID ORCL of my database, and change the N in the third paragraph to Y
It is amended as follows:
Former: / home/oracle/oracle92: Y Y # must is capitalizedCopy the code
Save and exit (wq)
Input:
vim /etc/rc.local
Copy the code
# Add the following at the end of the file
su - oracle -c 'dbstart'
su - oracle -c 'lsnrctl start'
Copy the code
Then perform
$ chmod +x /etc/rc.local
Copy the code
Oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle
Save and exit,OK! ~ ~ ~
Open port 1521 (required for remote Oracle connection)
Check whether the port is open:
firewall-cmd --query-port=1521/tcp
Copy the code
Permanently open port 1521:
firewall-cmd --permanent --zone=public --add-port=1521/tcp
Copy the code
Restart the firewall:
systemctl restart firewalld.service
Copy the code
Check the firewall status:
systemctl status firewalld.service
Copy the code
On | off | restart Firewall:
systemctl [start|stop|restart] firewalld.service
Copy the code