Oracle Database 19c Installation On CentOS7.7 In Silent Mode

1.下载oracle官方预安装的检查包Oracle Installation Prerequisites rpm

https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

在CentOS 7.7版本中,需要compat-libstdc++-33包,可以从下述地址中下载:
https://centos.pkgs.org/7/centos-x86_64/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm.html

2.安装rpm

yum install  compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

3.修改主机名及其相关网络配置

/etc/hosts

/etc/sysconfig/network

4.修改语言环境

/etc/locale.conf
LANG="en_US.UTF-8"

5.建立用户和组

/usr/sbin/groupadd -g 1001 oinstall
/usr/sbin/groupadd -g 1201 dba
/usr/sbin/groupadd -g 1202 oper
/usr/sbin/groupadd -g 1300 asmadmin
/usr/sbin/groupadd -g 1301 asmdba
/usr/sbin/groupadd -g 1302 asmoper
/usr/sbin/useradd -u 1101 -g oinstall -G dba,oper,asmoper,asmdba -d /home/oracle -s /bin/bash -m oracle
/usr/sbin/useradd -u 1102 -g oinstall -G dba,oper,asmadmin,asmoper,asmdba -d /home/grid -s /bin/bash -m grid

6.设置环境变量

cat <<EOF >> /home/oracle/.bash_profile
export ORACLE_BASE=/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/19c/db
export ORACLE_SID=SYK
export PATH=\$ORACLE_HOME/bin:/usr/sbin:\$PATH
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:\$ORACLE_HOME/lib32:/lib:/usr/lib
EOF

7.设置用户limits

cat <<EOF >> /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
EOF


cat <<EOF >> /etc/pam.d/login
session    required     pam_limits.so
EOF

8.建立结构目录

mkdir -p /oraInventory /oracle/gridbase /oracle/product/19c/db /oracle/product/19c/grid
chown -R grid:oinstall /oracle /oraInventory
chmod -R 775 /oracle /oraInventory /oracle/gridbase
chown oracle:oinstall /oracle/product/19c/db

chown -R oracle:oinstall /oracle /oraInventory

9.关闭SELinux

检查 getenforce  目标Disabled 或 Permissive

vi /etc/sysconfig/selinux

SELINUX=disabled


sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
或
sed -i 's/SELINUX=permissive/SELINUX=disabled/g' /etc/sysconfig/selinux

10.拷贝安装包至$ORACLE_HOME并解压

mv LINUX.X64_193000_db_home.zip $ORACLE_HOME/
cd $ORACLE_HOME
unzip -qo LINUX.X64_193000_db_home.zip

11.运行安装前检查

[oracle@syk01 db]$ ./runInstaller -executePrereqs -silent
Launching Oracle Database Setup Wizard...

Prerequisite checks executed successfully.

12.执行安装

export ORACLE_HOSTNAME=`hostname`
export ORA_INVENTORY=/oraInventory

./runInstaller -waitforcompletion -silent                                      \
	-responseFile ${ORACLE_HOME}/install/response/db_install.rsp               \
	oracle.install.option=INSTALL_DB_SWONLY                                    \
	ORACLE_HOSTNAME=${ORACLE_HOSTNAME}                                         \
	UNIX_GROUP_NAME=oinstall                                                   \
	INVENTORY_LOCATION=${ORA_INVENTORY}                                        \
	SELECTED_LANGUAGES=en,en_GB                                                \
	ORACLE_HOME=${ORACLE_HOME}                                                 \
	ORACLE_BASE=${ORACLE_BASE}                                                 \
	oracle.install.db.InstallEdition=EE                                        \
	oracle.install.db.OSDBA_GROUP=dba                                          \
	oracle.install.db.OSBACKUPDBA_GROUP=dba                                    \
	oracle.install.db.OSDGDBA_GROUP=dba                                        \
	oracle.install.db.OSKMDBA_GROUP=dba                                        \
	oracle.install.db.OSRACDBA_GROUP=dba                                       \
	SECURITY_UPDATES_VIA_MYORACLESUPPORT=false                                 \
	DECLINE_SECURITY_UPDATES=true


Launching Oracle Database Setup Wizard...

The response file for this session can be found at:
 /oracle/product/19c/db/install/response/db_2020-01-05_03-23-06AM.rsp

You can find the log of this install session at:
 /tmp/InstallActions2020-01-05_03-23-06AM/installActions2020-01-05_03-23-06AM.log


As a root user, execute the following script(s):
	1. /oraInventory/orainstRoot.sh
	2. /oracle/product/19c/db/root.sh

Execute /oraInventory/orainstRoot.sh on the following nodes:
[syk01]
Execute /oracle/product/19c/db/root.sh on the following nodes:
[syk01]


Successfully Setup Software.
Moved the install session logs to:
 /oraInventory/logs/InstallActions2020-01-05_03-23-06AM
[oracle@syk01 db]$
[oracle@syk01 db]$
[oracle@syk01 db]$ exit
logout
[root@syk01 ~]# /oraInventory/orainstRoot.sh
Changing permissions of /oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /oraInventory to oinstall.
The execution of the script is complete.
[root@syk01 ~]# /oracle/product/19c/db/root.sh
Check /oracle/product/19c/db/install/root_syk01_2020-01-05_03-26-13-348541948.log for the output of root script
[root@syk01 ~]#

13.创建监听

[oracle@syk01 netca]$ netca -silent -responsefile $ORACLE_HOME/assistants/netca/netca.rsp -lisport 1531

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /oracle/product/19c/db/assistants/netca/netca.rsp
    Parameter "lisport" = 1531
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Listener is using the port provided in the command line:1531
Oracle Net Listener Startup:
    Running Listener Control:
      /oracle/product/19c/db/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

14.创建数据库

dbca -silent -createDatabase                                                   \
     -templateName General_Purpose.dbc                                         \
     -gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} -responseFile NO_VALUE         \
     -characterSet AL32UTF8                                                    \
     -sysPassword Oracle_123                                                   \
     -systemPassword Oracle_123                                                \
     -createAsContainerDatabase false                                          \
     -databaseType MULTIPURPOSE                                                \
     -automaticMemoryManagement false                                          \
     -totalMemory 1000                                                         \
     -storageType FS                                                           \
     -datafileDestination "/oradata/syk/"                                      \
     -redoLogFileSize 50                                                       \
     -emConfiguration NONE                                                     \
     -ignorePreReqs


[oracle@syk01 ~]$ dbca -silent -createDatabase                                                   \
>      -templateName General_Purpose.dbc                                         \
>      -gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} -responseFile NO_VALUE         \
>      -characterSet AL32UTF8                                                    \
>      -sysPassword Oracle_123                                                   \
>      -systemPassword Oracle_123                                                \
>      -createAsContainerDatabase false                                          \
>      -databaseType MULTIPURPOSE                                                \
>      -automaticMemoryManagement false                                          \
>      -totalMemory 1000                                                         \
>      -storageType FS                                                           \
>      -datafileDestination "/oradata/syk/"                                      \
>      -redoLogFileSize 50                                                       \
>      -emConfiguration NONE                                                     \
>      -ignorePreReqs
Prepare for db operation
10% complete
Copying database files
40% complete
Creating and starting Oracle instance
42% complete
46% complete
50% complete
54% complete
60% complete
Completing Database Creation
66% complete
69% complete
70% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /oracle/cfgtoollogs/dbca/SYK.
Database Information:
Global Database Name:SYK
System Identifier(SID):SYK
Look at the log file "/oracle/cfgtoollogs/dbca/SYK/SYK.log" for further details.



[oracle@syk01 ~]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 05-JAN-2020 04:02:08

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=syk01)(PORT=1531)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                05-JAN-2020 03:42:54
Uptime                    0 days 0 hr. 19 min. 13 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/19c/db/network/admin/listener.ora
Listener Log File         /oracle/diag/tnslsnr/syk01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=syk01)(PORT=1531)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1531)))
Services Summary...
Service "SYK" has 1 instance(s).
  Instance "SYK", status READY, has 1 handler(s) for this service...
Service "SYKXDB" has 1 instance(s).
  Instance "SYK", status READY, has 1 handler(s) for this service...
The command completed successfully
posted @ 2020-01-05 18:02  syksky  阅读(1532)  评论(0编辑  收藏  举报