Several cases where silent installation is necessary

  • The server does not install graphics components to reduce resource usage
  • Cannot access the equipment room, only remote SSH
  • Want to dazzle (Z) yao (B), silent installation appears to have technical content

Disk Partition Requirements

If there is no special requirement, it can be better managed according to the following partition during installation

/u01 ext3 800G /u01 ext3 800G /u01 ext3 800G The size must be larger than the estimated total data amount /opt ext3 5G/TMP ext3 2G/ext3 Free spaceCopy the code

Installation Procedure Outline

Please look carefully to see if the command is preceded by a hash sign (root) and a dollar (Oracle).

  1. Before checking
  2. Create groups and users
  3. Modifying kernel parameters
  4. Modifying user restrictions
  5. Disable SELinux and the firewall
  6. Creating an installation directory
  7. Setting environment Variables
  8. Run runInstaller to install Oracle
  9. Perform dbCA to establish the database
  10. Configuration tnsnames. Ora
  11. Execute LSNRCTL to start listening, PLSQL connection

Pre-installation check

Two installation packages linux.x64_11GR2_database_1of2. zip Linux.x64_11GR2_database_2of2. zip The Oracle version is 11.2.0.1.0 Linux, Red Hat Enterprise Linux Server Release 6.6 (Santiago)

Physical memory check: at least 4 GB.

# grep MemTotal /proc/meminfo
Copy the code

Virtual memory check: Physical memory 4-8GB, virtual memory twice the physical memory. Physical memory 8-32GB, virtual memory 1.5 times physical memory; If the physical memory is greater than 32 GB, the virtual memory equals the physical memory.

Command to view virtual memory:

# grep SwapTotal /proc/meminfo
Copy the code

Dependency check

rpm -q \ binutils \ compat-libstdc++-33 \ elfutils-libelf \ elfutils-libelf-devel \ elfutils-libelf-devel-static \ expat  \ gcc \ gcc-c++ \ glibc \ glibc-common \ glibc-devel \ glibc-headers \ libaio \ libaio-devel \ libgcc \ libstdc++ \ libstdc++-devel \ make \ ksh \ sysstat \ numactl-devel \ kernel-headers \ libgomp \ unixODBC \ unixODBC-devel | grep "not installed"|awk '{print $2; } 'Copy the code

Enter the following packages to indicate that the system does not have them

compat-libstdc++-33
elfutils-libelf-devel
elfutils-libelf-devel-static
gcc
gcc-c++
libaio-devel
libstdc++-devel
ksh
numactl-devel
unixODBC
unixODBC-devel
Copy the code

Yum install install yum install

Create groups and users

[root@ORATEST]# groupadd oinstall [root@ORATEST]# groupadd dba [root@ORATEST]# useradd -g oinstall -G dba oracle [root@ORATEST]# passwd oracle Changing password for user oracle. New password: BAD PASSWORD: it is based on a dictionary word BAD PASSWORD: is too simple Retype new password: Passwd: All authentication tokens updated successfullyCopy the code

Modifying kernel parameters

# vi /etc/sysctl.conf

kernel.sem = 250 32000 100 128
fs.file-max = 6815744
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 = 1048586
fs.aio-max-nr = 1048576
Copy the code

Put Settings into effect

#sysctl -p
Copy the code

Check whether the Settings are successful

[root@ORATEST ~]# sysctl kernel.sem fs.file-max net.ipv4.ip_local_port_range net.core.rmem_default net.core.rmem_max net.core.wmem_default net.core.wmem_max fs.aio-max-nr
kernel.sem = 250        32000   100     128
fs.file-max = 6815744
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 = 1048586
fs.aio-max-nr = 1048576
Copy the code

User limit Settings

# vi /etc/security/limits.conf oracle soft nofile 1024 oracle hard nofile 65536 oracle soft nproc 2047 oracle hard nproc  16384 vi /etc/pam.d/login session required /lib64/security/pam_limits.so session required pam_limits.so # vi /etc/profile 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

Disable SELinux and the firewall

# vi /etc/sysconfig/selinux # SELinux =enforcing SELinux =disabled Disable SELinux immediately: Setenforce 0 or setenforce permissive Disable firewall: Linux6 or the following: Check the firewall status: service iptables status Disable the firewall after restart: Chkconfig iptables off Instantly disabling firewall command Disable: service iptables stopCopy the code

Creating an installation directory

[root@ORATEST ~]# mkdir -p /u01/app/ [root@ORATEST ~]# chown -R oracle:oinstall /u01/app/ [root@ORATEST ~]# chmod -R 775  /u01/app/Copy the code

Configuring environment Variables

[root@ORATEST ~]# su - oracle [oracle@ORATEST ~]$ vi /home/oracle/.bash_profile vi /home/oracle/.bash_profile ORACLE_BASE=/u01/app/oracle; Export ORACLE_BASE export ORACLE_HOME = / u01 / app/oracle/product / 11.2.0 / db_1 ORACLE_SID = oral; export ORACLE_SID export ORACLE_OWNER=oracle export PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/local/bin:/usr/sbin:/usr/bin export TNS_ADMIN=$ORACLE_HOME/network/admin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/oracm/lib:/lib:/usr/lib:/usr/local/lib export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE/lib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export LIBPATH=${CLASSPATH}:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib export SPFILE_PATH=$ORACLE_HOME/dbs export ORA_NLS10=$ORACLE_HOME/nls/data umask 022Copy the code

Open a new session, log in as Oracle account, and check whether the environment is working

[oracle@ORATEST ~]$ env | more
[oracle@ORATEST ~]$ umask
Copy the code

Create orainst. loc as user root and run

# vi /etc/oraInst.loc


inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall

[root@ORATEST ~]# chown oracle:oinstall /etc/oraInst.loc
[root@ORATEST ~]# chmod 664 /etc/oraInst.loc
Copy the code

Run runInstaller to install Oracle

Modifying the host file

[root@ORATEST ~]# vi /etc/hosts ... 127.0.0.1 ORATEST # finally adds this lineCopy the code

Upload both installation packages to /u01/app and make sure that the packages belong to the Oracle user

[root@ORATEST app]# chown -R oracle:oinstall *.zip
[root@ORATEST app]# ll
total 2295600
-rw-r--r--. 1 oracle oinstall 1239269270 Jan 22 14:29 linux.x64_11gR2_database_1of2.zip
-rw-r--r--. 1 oracle oinstall 1111416131 Jan 22 14:29 linux.x64_11gR2_database_2of2.zip
Copy the code

If you already belong to the Oracle user, skip the preceding step. Under the Oracle account, decompress the files in sequence

[oracle@ORATEST app]$unzip linux.x64_11gR2_database_1of2.zip  
[oracle@ORATEST app]$unzip linux.x64_11gR2_database_2of2.zip  
Copy the code

Unzipped files are stored in the database directory

[oracle@ORATEST app]$ ll total 2295604 drwxr-xr-x. 8 oracle oinstall 4096 Aug 21 2009 database -rw-r--r--. 1 oracle oinstall 1239269270 Jan 22 14:29 linux.x64_11gR2_database_1of2.zip -rw-r--r--. 1 oracle oinstall 1111416131 Jan 22 14:29  linux.x64_11gR2_database_2of2.zipCopy the code

Copy the installation configuration template file to the current directory (/u01/app)

[oracle@ORATEST app]$ cp database/response/db_install.rsp  .
Copy the code

Create three directories. Oracle is the installation directory, oradata is the data file directory, and Oradatabackup is the data file backup directory

[oracle@ORATEST app]$ mkdir oracle   
[oracle@ORATEST app]$ mkdir oradata
[oracle@ORATEST app]$ mkdir oradatabackup
Copy the code

Db_install. RSP

[oracle@ORATEST app]$ diff db_install.rsp database/response/db_install.rsp 29c29 < oracle.install.option=INSTALL_DB_AND_CONFIG --- > oracle.install.option= 37c37 < ORACLE_HOSTNAME=localhost --- > ORACLE_HOSTNAME= 42c42 < UNIX_GROUP_NAME=oinstall --- > UNIX_GROUP_NAME= 47c47 < INVENTORY_LOCATION=/u01/app --- > INVENTORY_LOCATION= 78c78 < SELECTED_LANGUAGES=en,zh_CN --- > SELECTED_LANGUAGES= 83c83 < ORACLE_HOME = / u01 / app/oracle/product / 11.2.0 / db_1 - > ORACLE_HOME = 88 c88 < ORACLE_BASE = / u01 / app/oracle - > ORACLE_BASE= 99c99 < oracle.install.db.InstallEdition=EE --- > oracle.install.db.InstallEdition= 142c142 < oracle.install.db.DBA_GROUP=dba --- > oracle.install.db.DBA_GROUP= 147c147 < oracle.install.db.OPER_GROUP=dba --- > oracle.install.db.OPER_GROUP= 160c160 < oracle.install.db.config.starterdb.type=GENERAL_PURPOSE --- > oracle.install.db.config.starterdb.type= 165c165 < oracle.install.db.config.starterdb.globalDBName=orcl --- > oracle.install.db.config.starterdb.globalDBName= 170c170 < oracle.install.db.config.starterdb.SID=orcl --- > oracle.install.db.config.starterdb.SID= 184c184 < oracle.install.db.config.starterdb.characterSet=ZHS16GBK --- > oracle.install.db.config.starterdb.characterSet=AL32UTF8 200c200 < oracle.install.db.config.starterdb.memoryLimit=1024 --- > oracle.install.db.config.starterdb.memoryLimit= 233c233 < oracle.install.db.config.starterdb.password.ALL=oracle . -- - > oracle install. Db. Config. Starterdb. Password. ALL = 278279 c278 < oracle.install.db.config.starterdb.dbcontrol.emailAddress=test@qq.com < --- > oracle.install.db.config.starterdb.dbcontrol.emailAddress= 325c324 < oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE --- > oracle.install.db.config.starterdb.storageType=  333c332 < oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u01/app/oradata --- > oracle.install.db.config.starterdb.fileSystemStorage.dataLocation= 340c339 < oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/u01/app/oradatabackup --- > oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation= 386c385 < DECLINE_SECURITY_UPDATES=true --- > DECLINE_SECURITY_UPDATES=Copy the code

These configuration items can also be written in the installation command parameters. This article chose to edit db_install.rsp to achieve this effect. The pre-installation files and environment are as follows

[oracle@ORATEST app]$ ll total 2295640 drwxr-xr-x. 8 oracle oinstall 4096 Aug 21 2009 database -rw-r--r--. 1 oracle oinstall 22770 Jan 22 15:15 db_install.rsp -rw-r--r--. 1 oracle oinstall 1239269270 Jan 22 14:29 linux.x64_11gR2_database_1of2.zip -rw-r--r--. 1 oracle oinstall 1111416131 Jan 22 14:29 linux.x64_11gR2_database_2of2.zip drwxr-xr-x. 2 oracle oinstall 4096 Jan 22 14:56 oracle drwxr-xr-x. 2 oracle oinstall 4096 Jan 22 15:12 oradata drwxr-xr-x. 2 oracle oinstall 4096 Jan 22 15:12 oradatabackup [oracle@ORATEST app]$ env | grep ORA ORACLE_OWNER = oracle ORA_NLS10 = / u01 / app/oracle/product / 11.2.0 / db_1 / NLS/data is = oral ORACLE_BASE = / u01 / app/oracle ORACLE_HOME = / u01 / app/oracle/product / 11.2.0 / db_1Copy the code

Executing installation Commands

[oracle@ORATEST database]$ ./runInstaller -silent -force -noconfig -ignorePrereq -responseFile /u01/app/db_install.rsp Starting Oracle Universal Installer... Checking Temp space: must be greater than 120 MB. Actual 1628 MB Passed Checking swap space: must be greater than 150 MB. Actual 65535 MB Passed Preparing ... CAUSE: ... ACTION: .... [WARNING] [INS-30011] ... The following configuration scripts need to be executed as the "root" user. #! / bin/sh # Root scripts to run/u01 / app/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 Configuration assistants have not been run. This can happen for following reasons - either root.sh is to be run  before config or Oracle Universal Installer was invoked with the -noConfig option. "/ u01 / app/oracle/product / 11.2.0 / db_1 / cfgtoollogs/configToolAllCommands" script contains all commands to be executed by the configuration assistants. This file may be used to run the configuration assistants outside of OUI. Note that you may have to update this script with passwords (if any) before executing the same. Successfully Setup Software.Copy the code

If Successfully Setup Software is displayed, the installation is successful. Tip to the root account to perform/u01 / app/oracle/product / 11.2.0 / db_1 / root. Sh scripts.

/ root @ ORATEST ~ # / u01 / app/oracle/product / 11.2.0 / db_1 / root. Sh Check / u01 / app/oracle/product / 11.2.0 / db_1 / install/root_ORATEST_2021-01-25 _08-19-46. The log for the output of root scriptCopy the code

The Oracle software is installed.

Set up a database

Copy the database configuration file dbca. RSP to the app directory

[oracle @ ORATEST app] $cp/u01 / app/oracle/product / 11.2.0 / db_1 / assistants/dbca/dbca. RSP.Copy the code

Edit dbca.rsp and finish each project as follows

[oracle @ ORATEST app] $cat dbca. RSP | grep -v ^ # | grep -v ^ $[GENERAL] RESPONSEFILE_VERSION = "11.2.0 OPERATION_TYPE =" "createDatabase" [CREATEDATABASE] GDBNAME = "ORCL" SID = "orcl" TEMPLATENAME = "General_Purpose.dbc" SYSPASSWORD = "oracle" SYSTEMPASSWORD = "oracle" DATAFILEDESTINATION =/u01/app/oradata CHARACTERSET = "ZHS16GBK" TOTALMEMORY = "8000" [createTemplateFromDB] SOURCEDB = "myhost:1521:orcl" SYSDBAUSERNAME = "system" TEMPLATENAME = "My Copy TEMPLATE" [createCloneTemplate] SOURCEDB = "orcl" TEMPLATENAME = "My Clone TEMPLATE" [DELETEDATABASE] SOURCEDB = "orcl" [generateScripts] TEMPLATENAME = "New Database" GDBNAME = "orcl11.us.oracle.com" [CONFIGUREDATABASE] [ADDINSTANCE] DB_UNIQUE_NAME = "orcl11g.us.oracle.com" NODELIST= SYSDBAUSERNAME = "sys" [DELETEINSTANCE] DB_UNIQUE_NAME = "orcl11g.us.oracle.com" INSTANCENAME = "orcl11g" SYSDBAUSERNAME = "sys"Copy the code

Similarly, the contents of this file can also be entered as parameters when executing the dbca command. This article chooses to edit dbca.rsp. Run the command in app directory to establish the database

[oracle@ORATEST app]$ dbca -silent -responseFile ./dbca.rsp 
Copying database files
1% complete
3% 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/app/oracle/cfgtoollogs/dbca/ORCL/ORCL.log" for further details.
Copy the code

The database is now started and accessible. The following command tests for success

[oracle@ORATEST ~]$ sqlplus / as sysdba
...
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 8351150080 bytes
Fixed Size                  2214936 bytes
Variable Size            5100274664 bytes
Database Buffers         3221225472 bytes
Redo Buffers               27435008 bytes
Database mounted.
Database opened.
SQL> 
Copy the code

If shutdown and startup are successfully executed, the database is started properly. /u01/app/oradata/ORCL is the database ORCL file

[oracle@ORATEST oradata]$ cd ORCL/ [oracle@ORATEST ORCL]$ ll total 1433964 -rw-r----- 1 oracle oinstall 9748480 Jan 25 15:42 control01.ctl -rw-r----- 1 oracle oinstall 52429312 Jan 25 15:23 redo01.log -rw-r----- 1 oracle oinstall 52429312 Jan 25 15:41 redo02.log -rw-r----- 1 oracle oinstall 52429312 Jan 25 15:23 redo03.log -rw-r----- 1 oracle oinstall 513810432 Jan 25 15:38 sysaux01.dbf -rw-r----- 1 oracle oinstall 702554112 Jan 25 15:36 system01.dbf -rw-r----- 1 oracle  oinstall 30416896 Jan 25 11:41 temp01.dbf -rw-r----- 1 oracle oinstall 78651392 Jan 25 15:36 undotbs01.dbf -rw-r----- 1  oracle oinstall 5251072 Jan 25 15:23 users01.dbfCopy the code

Configuration tnsnames. Ora

Create an ORA file under network/admin

[oracle @ ORATEST ~] $vi/u01 / app/oracle/product / 11.2.0 / db_1 / network/admin/tnsnames. Ora webdb = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.6.2)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orCL)Copy the code

Tnsnames. ora on the remote client writes the same configuration. If you are remotely on a PC, the ORA file is placed in the directory corresponding to the TNS_ADMIN environment variable.

Execute LSNRCTL to start listening, PLSQL connection

The listening configuration file does not need to be written. The default configuration is used. Check whether webDB can be parsed

[oracle@ORATEST ~]$ tnsping webdb ... Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.6.2)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL)) TNS-12541: TNS:no listenerCopy the code

The address and port number can be resolved. Otherwise, Failed to resolve name is displayed. No listerer indicates that the listener is not started. Start the listener

[oracle@ORATEST ~]$ lsnrctl start ... Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ORATEST)(PORT=1521))) Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))  STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 31-Jan-2021 13:55:20 Uptime 0 days 0 hr. 0 min. 0 SEC Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Log File /u01/app/oracle/diag/tnslsnr/ORATEST/listener/alert/log.xml Listening  Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ORATEST)(PORT=1521))) The listener supports no services The command completed successfullyCopy the code

The startup succeeded. PLSQL connection, user system, password Oracle, database drop – down select WebDB, you can successfully log in.

If all goes well, we’re done here. Please read down if you encounter some errors.

Some error resolution

Error: LRM - 00109: Could not open the parameter file '/ u01 / app/oracle/product / 11.2.0 / db_1 / DBS/initoral ora' address: [oracle @ ORATEST DBS] $cp/u01 / app/oracle/product / 11.2.0 / db_1 / SRVM/admin/init. Ora. / initoral oraCopy the code
Error: ORA - 00371: not enough shared pool memory, [oracle@ORATEST DBS]$vi initoral.ora # replace "clustDB" with your database name Db_name = orcl shared_pool_size = 307023052Copy the code
Error: ORA - 00401: The value for parameter compatible is not supported by this release [oracle@ORATEST DBS]$vi initoral.ora #compatible=9.2.0.0.0 compatible=11.2.0.0.0Copy the code
Ora-27504: IPC error creating OSD context ORA-27300: OS system dependent operation:unsupp_mtu failed with status: 0 ORA-27301: OS failure message: Error 0 ORA-27302: failure occurred at: skgxpvaddr10 ORA-27303: additional information: Requested interface 127.0.0.1 MTU not supported. Check output from ifconfig command  cd $ORACLE_HOME/rdbms/lib/ [oracle@ORATEST lib]$ make -f ins_rdbms.mk rac_off ioracleCopy the code
Error: OrA-00439: feature not enabled: CD $ORACLE_HOME/ RDBMS /lib/ [oracle@ORATEST lib]$make -f ins_rdbms. Mk rac_on ioracleCopy the code
Ora-32004: obsolete or deprecated parameter(s) specified for RDBMS instance ORa-00205: Error in identifying control file, check alert log for more info  [root@ORATEST ~]# find / -name init.ora* /u01/app/oracle/admin/ORCL/pfile/init.ora.025202192615 [oracle@ORATEST dbs]$ sqlplus / as sysdba ... SQL> startup pfile='/u01/app/oracle/admin/ORCL/pfile/init.ora.025202192615' ORACLE instance started. ; Total System Global Area 8351150080 bytes Fixed Size 2214936 bytes Variable Size 4697621480 bytes Database Buffers 3623878656 bytes Redo Buffers 27435008 bytes Database mounted. Database opened. SQL> create spfile from pfile='/u01/app/oracle/admin/ORCL/pfile/init.ora.025202192615'; File created.Copy the code

The whole library into

If the newly installed library wants to import data from the old library, do so on the old library server as the Oracle user

exp system/oracle@orcl file=./exp.dmp full=y
Copy the code

After the new library is created, you don’t need to do anything

[oracle@ORATEST app]$imp system/oracle full=y file=./exp. DMP #Copy the code

You can successfully import all data and users from the old library. The character set of the new and old database can be the same, but the character set of other links can be different.

conclusion

Finally fixed the legendary Oracle installation success rate is only 50%, or silent installation, cool. If the u01 partition fails, format the U01 partition and start again.