Centos7 silent installation Oracle11G

1, ready to install package:

Download the installation package official website: https: //www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html

2, the first temporary closure selinux:

[root@Centos ~]# setenforce 0

3, install dependent packages:

[root@Centos ~]# 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

4, check the dependent packages are installed:

[root@Centos ~]# 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
binutils-2.27-41.base.el7_7.1.x86_64
compat-libcap1-1.10-7.el7.x86_64
compat-libstdc++-33-3.2.3-72.el7.x86_64
compat-libstdc++-33-3.2.3-72.el7.i686
gcc-4.8.5-39.el7.x86_64
gcc-c++-4.8.5-39.el7.x86_64
glibc-2.17-292.el7.x86_64
glibc-2.17-292.el7.i686
glibc-devel-2.17-292.el7.x86_64
glibc-devel-2.17-292.el7.i686
Ksh - 20120801 - 139 .el7.x86_64
libaio-0.3.109-13.el7.x86_64
libaio-0.3.109-13.el7.i686
libaio-devel-0.3.109-13.el7.x86_64
libaio-devel-0.3.109-13.el7.i686
Libgcc - 4.8 . 5 - 39 .el7.x86_64
Libgcc - 4.8 . 5 - 39 .el7.i686
libstdc++-4.8.5-39.el7.x86_64
libstdc++-4.8.5-39.el7.i686
libstdc++-devel-4.8.5-39.el7.x86_64
libstdc++-devel-4.8.5-39.el7.i686
LibXi - 1.7 . 9 - 1 .el7.x86_64
LibXi - 1.7 . 9 - 1 .el7.i686
LibXtst - 1.2 . 3 - 1 .el7.x86_64
LibXtst - 1.2 . 3 - 1 .el7.i686
 Make - 3.82 - 24 .el7.x86_64
sysstat-10.1.5-18.el7.x86_64
unixODBC-2.3.1-14.el7.x86_64
unixODBC-2.3.1-14.el7.i686
unixODBC-devel-2.3.1-14.el7.x86_64
unixODBC-devel-2.3.1-14.el7.i686
[root@Centos ~]#

5, create oinstall and dba groups:

[root@Centos ~]# groupadd oinstall
[root@Centos ~]# groupadd dba

6, create the oracle user:

[root@Centos ~]# useradd -g oinstall -G dba oracle

7, set the oracle user password:

[root@Centos ~]# passwd oracle

8, to verify whether the correct creation:

[root@Centos ~]# id oracle
uid=1002(oracle) gid=1002(oinstall) 组=1002(oinstall),1003(dba)
[root@Centos ~]# 

9, modify kernel parameters:

[root @ Docker ~] # vim /etc/sysctl.conf    # red part is to add content

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
Low kernel.shmmax = 536870912 #: 536870912, maximum: less than the value of the physical memory is a byte, half of the recommended than physical memory
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

Not less than the value of the parameter above configuration, it is officially recommended minimum oracle, the production environment is recommended to adjust these parameters to optimize system performance.

10, modified to make it work:

[root@Centos ~]# sysctl -p

11, setting limits for the oracle user, to improve the performance of software running:

[root @ Centos ~] # vim / etc / Security / limits.conf     # red part is the content to be added

# Add to the end
oracle soft nproc 2047
oracle hard nproc 16384
Oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240

12, create the oracle related installation directory:

[root@Centos ~]# mkdir -p /u01/app/oracle
[root@Centos ~]# mkdir -p /u01/app/oraInventory

13, set the directory permissions:

[root@Centos ~]# chown -R oracle:oinstall /u01/app/
[root@Centos ~]# chmod -R 775 /u01/app/

14, configure the environment variables:

[Centos the Oracle @ ~] $ vim ~ / .bash_profile    # red part is to add content


export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=centos
export ROACLE_PID=ora11g
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export LANG="zh_CN.UTF-8"
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"
export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
export PATH=$PATH:$ORACLE_HOME/bin

15, to make it work:

[oracle@Centos ~]$ source ~/.bash_profile

16, extract the installation package:

[root@Centos opt]# unzip linux.x64_11gR2_database_1of2.zip
[root@Centos opt]# unzip linux.x64_11gR2_database_2of2.zip

17, copy the response file template:

[oracle@Centos ~]$ mkdir etc
[oracle@Centos ~]$ cp /opt/database/response/* /home/oracle/etc/
[oracle@Centos ~]$ ls etc/
dbca.rsp  db_install.rsp  netca.rsp
[oracle@Centos ~]$

18, set the response file permissions:

[oracle@Centos ~]$ su -
[root@Centos ~]# chmod 700 /home/oracle/etc/*.rsp

19, silent installation oracle:

su - oracle

Modify the response file /home/oracle/etc/db_install.rsp

the Oracle. install .option = INSTALL_DB_SWONLY      # installation type 
ORACLE_HOSTNAME = Centos                       # Host Name (hostname query) 
UNIX_GROUP_NAME = oinstall                     # group installation 
INVENTORY_LOCATION = / u01 / App / oraInventory     # the INVENTORY directory (do not fill is the default value) 
SELECTED_LANGUAGES = EN, zh_CN, zh_TW            # select the language 
ORACLE_HOME = / u01 / App / the Oracle / Product / 11.2 . 0 / db_1     # ORACLE_HOME 
ORACLE_BASE = / u01 / App / the Oracle                         # ORACLE_BASE 
the Oracle. install .db.InstallEdition = EE        # the Oracle version of 
the Oracle. install the .db. isCustomInstall =to false     # custom installation, NO, using default components 
Oracle. the install .db.DBA_GROUP = DBA              # DBA user group
Oracle. the install .db.OPER_GROUP the oinstall =        # Oper user group 
Oracle. the install .db.config.starterdb.type = GENERAL_PURPOSE    # database type 
Oracle. the install .db.config.starterdb.globalDBName = ORCL       # globalDBName 
Oracle. the install .db. CentOS = config.starterdb.SID              # the SID 
Oracle. the install .db.config.starterdb.memoryLimit = 81920       # automatic memory management memory (M) 
Oracle. the install .db.config.starterdb.password.ALL = Oracle     # set all database users use the same password 
SECURITY_UPDATES_VIA_MYORACLESUPPORT = false 
DECLINE_SECURITY_UPDATES = to true

20, began to silent installation:

[oracle@Centos ~]$ ./runInstaller -silent -responseFile /home/oracle/etc/db_install.rsp

View the installation log:

tail -f /u01/app/oraInventory/logs/installActions2019-12-01_06-56-29PM.log

It appears similar to the following prompt indicates that the installation is complete:

The following configuration script needs to " root " the implementation of the user's identity.
#!/bin/sh 
Root to run the script #

/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/db_1/root.sh
To execute the configuration script, do the following:
     1 . Open a terminal window
      2 . To " root " Log
      3 . Run the script
      4 . Return to this window and press " the Enter " key to continue

Successfully Setup Software.

Use the root user to execute the script:

[oracle@Centos ~]$ su -
[root@Centos ~]# /u01/app/oraInventory/orainstRoot.sh
[root@Centos ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh

21, configure the listener:

[oracle@Centos ~]$ netca /silent /responsefile /home/oracle/etc/netca.rsp

22, start the listener, to verify whether the configuration:

[oracle@Centos etc]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 01-12月-2019 02:39:48

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Start / u01 / App / the Oracle / Product / 11.2 . 0 / db_1 / bin / tnslsnr: Please wait ...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
The system parameter file / u01 / App / the Oracle / Product / 11.2 . 0 / db_1 / Network / ADMIN / the listener.ora
Write / u01 / App / Oracle / diag / tnslsnr / Centos / listener / Alert / log.xml log information
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Centos)(PORT=1521)))

Is connected to (the DESCRIPTION = (ADDRESS = (the PROTOCOL = the IPC) (KEY = EXTPROC1521)))
LISTENER 的 STATUS
------------------------
Alias ​​LISTENER
Version TNSLSNR for Linux: Version 11.2 . 0.1 . 0 - Production's
Start date                   01 - Dec - 2019  02 : 40 : 09 
Uptime               0 Tian 0 Xiaoshi 0 minutes 21 Miao
Trace level off
Security ON: Local OS Authentication
SNMP                      OFF
Listener parameter file           / u01 / App / the Oracle / Product / 11.2 . 0 / db_1 / Network / ADMIN / the listener.ora
Listener log file           / u01 / App / the Oracle / diag / tnslsnr / Centos / listener / Alert / log.xml
Listening endpoint summary ...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Centos)(PORT=1521)))
The listener does not support service
The command completed successfully
[oracle@Centos etc]$

23, silent dbca building a database:

Edit answer file

[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "centos"
SID = "centos"
TEMPLATENAME = "General_Purpose.dbc"
CHARACTERSET = "AL32UTF8"

24, create an instance:

[oracle@Centos etc]$ dbca -silent -responseFile dbca.rsp
Enter SYS user password: Password here # 19 corresponding to the configuration of step
 
User password input SYSTEM: # Here is also mapped in step 19 the configuration
 
Copy the database file
. 1 % has been completed
 . 3 % has been completed
 . 11 % Completed
 18 is % Completed
 26 is % Completed
 37 [ % Completed
Creating and start the Oracle instance
40 % completed
 45 % completed
 50 % completed
 55 % completed
 56 is % completed
 60 % completed
 62 is % Completed
Database creation in progress
66 % completed
 70 % completed
 73 is % completed
 85 % completed
 96 % completed
 100 % completed
For more information, see the log file " /u01/app/oracle/cfgtoollogs/dbca/centos/centos.log " .
[oracle@Centos etc]$ 

Check output log:

[oracle@Centos etc]$ cat /u01/app/oracle/cfgtoollogs/dbca/centos/centos.log
Copy the database file
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 3%
DBCA_PROGRESS : 11%
DBCA_PROGRESS : 18%
DBCA_PROGRESS : 26%
DBCA_PROGRESS : 37%
Creating and start the Oracle instance
DBCA_PROGRESS : 40%
DBCA_PROGRESS : 45%
DBCA_PROGRESS : 50%
DBCA_PROGRESS : 55%
DBCA_PROGRESS : 56%
DBCA_PROGRESS : 60%
DBCA_PROGRESS : 62%
Database creation in progress
DBCA_PROGRESS : 66%
DBCA_PROGRESS : 70%
DBCA_PROGRESS : 73%
DBCA_PROGRESS : 85%
DBCA_PROGRESS : 96%
DBCA_PROGRESS : 100%
The database is created. For more information, please view the log file in the following locations:
 /u01/app/oracle/cfgtoollogs/dbca/centos。
Database information:
Global database name: centos
System Identifier (SID): CentOS 
[the Oracle @ Centos etc] $

 This completes the creation of the database instance.

 

Attachment:

(1) Delete example:

[oracle@Centos ~]$ dbca -silent -deleteDatabase -sourcedb centos

(2) monitoring procedures related commands:

lsnrctl status # view the listener status
lsnrctl start # start the listener
Stop the listener lsnrctl stop #

(3) Examples related commands:

sqlplus / AS sysdba # no login password, Oracle uses operating system authentication, as part of the operating system DBA group of users log in to the database server, Oracle believes this authorized users can log into the database as SYSDBA
start the instance startup #
shutdown immediate # uninstall the instance

(4) Related user and tablespace:

# Create a test table space, the size of 1G (1024m)
CREATE TABLESPACE test DATAFILE '/home/oracle/data/test.ora' SIZE 1024m;

# Create a test user password is test, test correlation table space
CREATE USER test IDENTIFIED BY "test" DEFAULT TABLESPACE test QUOTA 1024m ON USERS;

# User granted permission to test
GRANT CONNECT,DBA,RESOURCE TO test;

 

 

Reference Links: https://www.cnblogs.com/zydev/p/5827207.html

 

Guess you like

Origin www.cnblogs.com/d0usr/p/11965040.html