Oracle 19c for Centos7.x 全命令行快速静默安装

目录

1、准备工作

1.1、配置本地YUM源

1.2、安装依赖包

1.3、创建用户组 

1.4、创建软件安装目录和数据库目录

1.5、准备其它条件 

1.7、关闭防火墙与selinux

1.8、解压数据库文件 

2、安装数据库 

2.1、准备db_install.rsp文件

2.2、安装数据库 

3、建库

3.1、准备dbca.rsp文件

3.2、进行dbca建库

4、静默进行创建监听


1、准备工作

1.1、配置本地YUM源

mount -t auto /dev/cdrom  /mnt

rm -rf /etc/yum.repos.d/

mkdir -p /etc/yum.repos.d/



cat >> /etc/yum.repos.d/CentOS-Media.repo<

1.2、安装依赖包

 yum -y install gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static elfutils-libelf-devel ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-devel libXext* unzip

1.3、创建用户组 

groupadd -g 1001 oinstall
groupadd -g 1002 dba
groupadd -g 1003 oper
groupadd -g 1004 asmdba
groupadd -g 1005 backupdba
groupadd -g 1006 dgdba
groupadd -g 1007 kmdba
groupadd -g 1008 racdba

useradd -u 1001 -m -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba oracle
id oracle
a=1
echo oracle:$a|chpasswd

hostnamectl set-hostname oracle19c

su - 

1.4、创建软件安装目录和数据库目录

mkdir -p /u01/app/oracle
chown -R oracle:oinstall  /u01
chmod -R 775 /u01

1.5、准备其它条件 

cat >> /etc/hosts <
cat >> /etc/sysctl.conf <> /etc/security/limits.conf <> /etc/pam.d/login <> /etc/profile <> /etc/csh.login <
cat >>/home/oracle/.bash_profile<

1.7、关闭防火墙与selinux

systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
sed -i 's/=enforcing/=disabled/g' /etc/selinux/config
setenforce 0
getenforce

1.8、解压数据库文件 

[root@oracle19c db]# pwd
/u01/app/oracle/product/19.0.0.0/db
[root@oracle19c db]# unzip db.zip 
[root@oracle19c 19.0.0.0]# chown -R oracle:oinstall db/

2、安装数据库 

2.1、准备db_install.rsp文件


mkdir -p /oracle/install/
chown -R  oracle:oinstall /oracle/install/
su - oracle

cat >>/tmp/db_install.rsp <

2.2、安装数据库 

[oracle@oracle19c db]$ ./runInstaller -silent -ignorePrereq -responseFile /tmp/db_install.rsp
Launching Oracle Database Setup Wizard...

[WARNING] [INS-32047] The location (/u01/app/oraInventory) specified for the central inventory is not empty.
   ACTION: It is recommended to provide an empty location for the inventory.

 Enter password for 'root' user: 
[WARNING] [INS-13013] Target environment does not meet some mandatory requirements.
   CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /tmp/InstallActions2020-03-31_10-45-58PM/installActions2020-03-31_10-45-58PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /tmp/InstallActions2020-03-31_10-45-58PM/installActions2020-03-31_10-45-58PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /u01/app/oracle/product/19.0.0.0/db/install/response/db_2020-03-31_10-45-58PM.rsp

You can find the log of this install session at:
 /tmp/InstallActions2020-03-31_10-45-58PM/installActions2020-03-31_10-45-58PM.log
Successfully Setup Software with warning(s).
Moved the install session logs to:
 /u01/app/oraInventory/logs/InstallActions2020-03-31_10-45-58PM

3、建库

3.1、准备dbca.rsp文件

 

touch /tmp/dbca.rsp
cat >>/tmp/dbca.rsp<

3.2、进行dbca建库

dbca -J-Doracle.assistants.dbca.validate.ConfigurationParams=false -silent  -createDatabase -templateName General_Purpose.dbc -responseFile /tmp/dbca.rsp

[oracle@oracle19c oradata]$  dbca -J-Doracle.assistants.dbca.validate.ConfigurationParams=false -silent  -createDatabase -templateName General_Purpose.dbc -responseFile /tmp/dbca.rsp
Enter SYS user password: 

Enter SYSTEM user password: 

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:
 /u01/app/oracle/cfgtoollogs/dbca/orcl.
Database Information:
Global Database Name:orcl
System Identifier(SID):orcl
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl0.log" for further details

4、静默进行创建监听

自定义配置监听

 

Oracle用户执行

cat >>/tmp/netca.rsp <

 默认配置监听

netca -silent -responsefile /u01/app/oracle/product/19.0.0.0/db/assistants/netca/netca.rsp


[oracle@oracle19c netca]$ netca -silent -responsefile /u01/app/oracle/product/19.0.0.0/db/assistants/netca/netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /u01/app/oracle/product/19.0.0.0/db/assistants/netca/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Running Listener Control: 
      /u01/app/oracle/product/19.0.0.0/db/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
[oracle@oracle19c netca]$ lsnrctl

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 08-APR-2020 07:46:28

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

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> stat
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle19c)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                08-APR-2020 07:46:26
Uptime                    0 days 0 hr. 0 min. 3 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.0.0.0/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oracle19c/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle19c)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
LSNRCTL> exit

 

你可能感兴趣的:(oracle,数据库,oracle,静默安装,19c)