Linux 7 静默安装oracle 19c 单机

2024-08-27 09:28

本文主要是介绍Linux 7 静默安装oracle 19c 单机,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

0 说明

1 安装环境准备

环境规划

配置名参数值
主机名19c
IP192.168.131.6
ORACLE_SIDlu9up
ORACLE_BASE/u01/app/oracle
ORACLE_HOME/u01/app/oracle/product/19.0.0/db_1
存储方式file system

1.1 查看操作系统版本

RHEL7.9

[root@lu9up01 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)

1.2 内存大小

至少1G,建议2G以上

[root@lu9up01 ~]# free -gtotal        used        free      shared  buff/cache   available
Mem:              7           0           0           0           7           7
Swap:             7           0           7

1.3 共享内存段

共享内存段/dev/shm目录是一个特殊的目录,用于实现共享内存,默认是系统内存的50%。/dev/shm大小应该大于SGA+PGA的总内存大小,如果/dev/shm装载大小对于Oracle系统全局区域(SGA)和程序全局区域(PGA)来说太小,则会导致ORA-00845错误。

[root@lu9up01 ~]# df -h /dev/shm/
Filesystem      Size  Used Avail Use% Mounted o
tmpfs           3.8G     0  3.8G   0% /dev/shm

1.4 /tmp目录

/tmp目录要求超过1G

[root@lu9up01 ~]# df -h /tmp
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        41G  7.2G   34G  18% /

1.5 交换分区Swap空间

  • 当物理内存在4GB到16GB时,要求Swap等于内存值
  • 当物理内存超过16GB时,要求Swap等于16GB
[root@lu9up01 ~]# free -gtotal        used        free      shared  buff/cache   available
Mem:              7           0           0           0           7           7
Swap:             7           0           7[root@lu9up01 ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0     11:0    1  4.5G  0 rom
sda      8:0    0   50G  0 disk
├─sda2   8:2    0    8G  0 part [SWAP]
├─sda3   8:3    0   41G  0 part /
└─sda1   8:1    0    1G  0 part /boot

1.6 禁用透明大页

[root@lu9up01 ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
[root@lu9up01 ~]# echo never > /sys/kernel/mm/transparent_hugepage/defrag[root@lu9up01 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
[root@lu9up01 ~]# cat /sys/kernel/mm/transparent_hugepage/defrag
always defer defer+madvise madvise [never]

都是[never]就可以

1.7 主机名和映射

[root@lu9up01 ~]# hostname
lu9up01[root@lu9up01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.131.9 lu9up

1.8 关闭防火墙

[root@lu9up01 ~]# systemctl stop firewalld.service
[root@lu9up01 ~]# systemctl disable firewalld.service[root@lu9up01 ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)
[root@lu9up01 ~]#
[root@lu9up01 ~]#
[root@lu9up01 ~]# getenforce
Disabled

1.9 禁用selinux

[root@lu9up01 ~]# getenforce
Enforcing[root@lu9up01 ~]# vi /etc/selinux/configSELINUX=enforcing 改为 SELINUX=disabled[root@lu9up01 ~]# setenforce 0
[root@lu9up01 ~]# getenforce
Permissive

1.10 创建用户和组

/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper/usr/sbin/useradd -u 54321 -g oinstall -G dba,oper oracle

修改密码

[root@lu9up01 ~]# passwd oracle

1.11 创建Oracle的安装目录

mkdir -p /u01/app/oracle
mkdir -p /u01/app/oraInventory
mkdir -p /u01/app/oracle/product/19.0.0/db_1
chown -R oracle:oinstall /u01/app/oracle
chown -R oracle:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app

1.12 添加环境变量

[root@lu9up01 ~]# su - oracle
Last login: Fri Aug 23 00:13:29 CST 2024 on pts/0[oracle@lu9up01 ~]$ vi .bash_profile
#添加:
PS1=$LOGNAME@`hostname`:'$PWD''$ '
set -o vi
umask 022
stty erase ^H
export TMP=/tmp
export TMPDIR=/tmp
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.0.0/db_1
export ORACLE_SID=lu9up
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib
export PATH=${ORACLE_HOME}/bin:${ORACLE_HOME}/OPatch:${PATH}
alias gobase='cd $ORACLE_BASE'
alias gohome='cd $ORACLE_HOME'
alias bdump='cd /oraclelog/diag/rdbms/lu9up/$ORACLE_SID/trace'

生效:

[oracle@lu9up01 ~]$ source .bash_profile

1.10 修改limits.conf

[root@lu9up01 ~]# vim /etc/security/limits.conf
#添加
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 3145728
oracle soft memlock 3145728

1.11 修改内核参数

[root@lu9up01 ~]# vi /etc/sysctl.conf
#添加
vm.max_map_count = 262144
kernel.shmmax = 473110626304 
kernel.shmall = 115505524 
kernel.shmmni = 4096
kernel.sem = 10000 10240000 10000 1024 
fs.file-max = 8388608 
fs.aio-max-nr = 4194304
vm.min_free_kbytes = 524288
vm.swappiness = 1
vm.nr_hugepages = 104962 
vm.hugetlb_shm_group = 1000   
kernel.panic_on_oops=1
kernel.randomize_va_space=0
kernel.numa_balancing=0 
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 4194304
net.core.wmem_max = 4194304

1.12 修改/etc/pam.d/login

[root@lu9up01 ~]# vi /etc/pam.d/login
#添加
session    required     pam_limits.so

1.13 安装依赖包

安装

yum install -y binutils bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libXrender libXrender-devel libX11 libXau libXi libXtst libgcc libstdc++ libstdc++-devel libxcb make smartmontools sysstat

检查

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libXrender libXrender-devel libX11 libXau libXi libXtst libgcc libstdc++ libstdc++-devel libxcb make smartmontools sysstat

Centos 7一般会缺compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm包,下载链接为:compat-libstdc++

2 静默安装Oracle数据库软件

2.1 安装包准备

上传安装包到$ORACLE_HOME下并解压:

cd $ORACLE_HOME
unzip LINUX.X64_193000_db_home.zip

重新设置所属用户组:

chown -R oracle:oinstall /u01/app/oracle

2.2 编辑响应文件

备份:

su - oracle
cd $ORACLE_HOME/install/response
cp db_install.rsp /tmp

修改配置:

vi db_install.rsp

修改文件中以下内容(这些是比较关键的,其余的配置按需更改):

oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.password.ALL=oracle
oracle.install.db.config.starterdb.globalDBName=lu9up
oracle.install.db.config.starterdb.SID=lu9up
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE

2.3 静默安装数据库软件

$ cd $ORACLE_HOME
$ ./runInstaller -silent -ignorePrereq -responseFile $ORACLE_HOME/install/response/db_install.rsp

安装日志:

Launching Oracle Database Setup Wizard...The response file for this session can be found at:/u01/app/oracle/product/19.0.0/db_1/install/response/db_2024-08-23_02-37-13PM.rspYou can find the log of this install session at:/tmp/InstallActions2024-08-23_02-37-13PM/installActions2024-08-23_02-37-13PM.logAs a root user, execute the following script(s):1. /u01/app/oraInventory/orainstRoot.sh2. /u01/app/oracle/product/19.0.0/db_1/root.shExecute /u01/app/oraInventory/orainstRoot.sh on the following nodes:
[lu9up01]
Execute /u01/app/oracle/product/19.0.0/db_1/root.sh on the following nodes:
[lu9up01]Successfully Setup Software.
Moved the install session logs to:/u01/app/oraInventory/logs/InstallActions2024-08-23_02-37-13PM

3 安装监听

不需要修改响应文件,默认安装就好。

$ netca -silent -responsefile $ORACLE_HOME/assistants/netca/netca.rsp

安装完成后查看监听状态:

oracle@lu9up01:/home/oracle$ lsnrctl statusLSNRCTL for Linux: Version 19.0.0.0.0 - Production on 23-AUG-2024 14:43:28Copyright (c) 1991, 2019, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=lu9up)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                23-AUG-2024 14:43:19
Uptime                    0 days 0 hr. 0 min. 8 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/lu9up01/listener/alert/log.xml
Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lu9up01)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

4 dbca静默安装数据库

4.1 备份响应文件

$ cd $ORACLE_HOME/assistants/dbca
$ cp dbca.rsp /tmp

4.2 编辑响应文件

$ vim dbca.rsp主要修改以下参数:```bash
gdbName=lu9up
sid=lu9up
sysPassword=Oracle
systemPassword=Oracle
oracleHomeUserPassword=Oracle
templateName=General_Purpose.dbc

需要注意的是,如果

如果不配置templateName=General_Purpose.dbc参数就可能报错:

[FATAL] [DBT-10503] Template file is not specified.  

参考官方文档 Doc ID 2489372.1

4.3 dbca静默安装

进入$ORACLE_HOME/assistants/dbca目录,执行安装程序。

$ cd $ORACLE_HOME/assistants/dbca
$ dbca -silent -createDatabase -responseFile dbca.rsp需要输入参数-------------------------
Enter SYS user password:Enter SYSTEM user password:
------------------------------------
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as passwordACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as passwordACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
10% complete
Copying database files
File "/etc/oratab" is not accessible.
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/lu9up.
Database Information:
Global Database Name:lu9up
System Identifier(SID):lu9up
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/lu9up/lu9up.log" for further details.

安装完成,安装过程日志在/u01/app/oracle/cfgtoollogs/dbca/lu9up/lu9up.log。

这篇关于Linux 7 静默安装oracle 19c 单机的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1111275

相关文章

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的

MySQL MCP 服务器安装配置最佳实践

《MySQLMCP服务器安装配置最佳实践》本文介绍MySQLMCP服务器的安装配置方法,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下... 目录mysql MCP 服务器安装配置指南简介功能特点安装方法数据库配置使用MCP Inspector进行调试开发指

在Windows上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

Python UV安装、升级、卸载详细步骤记录

《PythonUV安装、升级、卸载详细步骤记录》:本文主要介绍PythonUV安装、升级、卸载的详细步骤,uv是Astral推出的下一代Python包与项目管理器,主打单一可执行文件、极致性能... 目录安装检查升级设置自动补全卸载UV 命令总结 官方文档详见:https://docs.astral.sh/

Linux脚本(shell)的使用方式

《Linux脚本(shell)的使用方式》:本文主要介绍Linux脚本(shell)的使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录概述语法详解数学运算表达式Shell变量变量分类环境变量Shell内部变量自定义变量:定义、赋值自定义变量:引用、修改、删

Nexus安装和启动的实现教程

《Nexus安装和启动的实现教程》:本文主要介绍Nexus安装和启动的实现教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、Nexus下载二、Nexus安装和启动三、关闭Nexus总结一、Nexus下载官方下载链接:DownloadWindows系统根

Java SWT库详解与安装指南(最新推荐)

《JavaSWT库详解与安装指南(最新推荐)》:本文主要介绍JavaSWT库详解与安装指南,在本章中,我们介绍了如何下载、安装SWTJAR包,并详述了在Eclipse以及命令行环境中配置Java... 目录1. Java SWT类库概述2. SWT与AWT和Swing的区别2.1 历史背景与设计理念2.1.

Linux链表操作方式

《Linux链表操作方式》:本文主要介绍Linux链表操作方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、链表基础概念与内核链表优势二、内核链表结构与宏解析三、内核链表的优点四、用户态链表示例五、双向循环链表在内核中的实现优势六、典型应用场景七、调试技巧与

详解Linux中常见环境变量的特点与设置

《详解Linux中常见环境变量的特点与设置》环境变量是操作系统和用户设置的一些动态键值对,为运行的程序提供配置信息,理解环境变量对于系统管理、软件开发都很重要,下面小编就为大家详细介绍一下吧... 目录前言一、环境变量的概念二、常见的环境变量三、环境变量特点及其相关指令3.1 环境变量的全局性3.2、环境变

Linux系统中的firewall-offline-cmd详解(收藏版)

《Linux系统中的firewall-offline-cmd详解(收藏版)》firewall-offline-cmd是firewalld的一个命令行工具,专门设计用于在没有运行firewalld服务的... 目录主要用途基本语法选项1. 状态管理2. 区域管理3. 服务管理4. 端口管理5. ICMP 阻断