当前位置: 首页 > news >正文

Oracle19c单机部署(本地)

目录

一、Oracle数据库安装检查清单

1.1.Oracle数据库安装的服务器硬件检查清单

1.2.Linux系统上Oracle数据库安装的操作系统检查清单

1.3.Oracle数据库安装的服务器配置检查清单

1.4.Oracle数据库安装的用户环境配置检查清单

1.5.Oracle数据库安装的存储检查清单

1.6.Oracle数据库安装程序规划检查清单

1.7.Oracle数据库部署检查清单

1.8.查看本地配置

1.8.1.配置oracle官方yum源

二、系统配置(root用户操作)

2.1. 创建Oracle用户与组

2.2. 创建安装目录

​编辑 2.3.修改目录权限

2.4. 配置内核参数(视情况进行修改)

2.5. 配置用户资源限制

三、Oracle用户环境变量配置

四、准备安装介质与响应文件

4.1. 上传并解压Oracle 19c安装包

4.2. 创建静默安装响应文件

4.2.1.复制并修改

4.2.2.修改以下关键参数(其他参数保持默认或根据需求调整)

五、静默安装Oracle软件(oracle用户下)

5.1.执行runInstaller静默安装

六、静默创建数据库实例(DBCA)

6.1. 直接命令行创建(推荐)

6.2. 通过响应文件创建(可选)

七、验证安装结果

7.1. 检查监听状态

7.2. 连接数据库验证


官方链接:

Oracle Linux官网安装包链接:

Oracle Linux ISOs | Oracle, Software. Hardware. Complete.

Oracle官方安装操作手册

https://docs.oracle.com/en/database/oracle/oracle-database/19

一、Oracle数据库安装检查清单

使用检查表审查系统要求,并规划和执行Oracle数据库安装。

甲骨文官方建议您使用检查表作为您的安装计划过程的一部分。使用检查表可以帮助您确认您的服务器硬件和配置是否符合此版本的最低要求,并可以帮助您确保成功进行安装。

1.1.Oracle数据库安装的服务器硬件检查清单

CheckTask
Runlevel3 or 5
Server Display CardsAt least 1024 x 768 display resolution, which Oracle Universal Installer requires.
Minimum network connectivityServer is connected to a network
Minimum RAM
  • At least 1 GB RAM for Oracle Database installations. 2 GB RAM recommended.

  • At least 8 GB RAM for Oracle Grid Infrastructure installations.

Linux for Arm (aarch64) processor

Oracle Database 19c Linux for Arm (aarch64) requires a CPU capable of Neoverse N1. Oracle recommends using a server with an Ampere Altra or Ampere Altra Max CPU.

Oracle Database 19c Linux for Arm (aarch64) 需要支持 Neoverse N1 的 CPU。Oracle 建议使用配备 Ampere Altra 或 Ampere Altra Max CPU 的服务器。

1.2.Linux系统上Oracle数据库安装的操作系统检查清单

使用此检查表来确认Oracle数据库的最低操作系统要求。重点关注操作系统版本,openssh的要求。

ItemTask

Operating system general requirements

OpenSSH installed manually, if you do not have it installed already as part of a default Linux installation.

A Linux kernel in the list of supported kernels and releases listed in this guide.

Linux x86-64 operating system requirements

The following Linux x86-64 kernels are supported:

  • Oracle Linux 9 with the Unbreakable Enterprise Kernel 7: 5.15.0-1.43.4.2.el9uek.x86_64 or later
    Oracle Linux 9 with the Red Hat Compatible Kernel: 5.14.0-70.22.1.0.2.el9_0.x86_64 or later

  • Oracle Linux 8.8 with the Unbreakable Enterprise Kernel 7: 5.15.0-202.135.2.el8uek.x86_64 or later
    Oracle Linux 8.1 with the Unbreakable Enterprise Kernel 6: 5.4.17-2011.0.7.el8uek.x86_64 or later
    Oracle Linux 8 with the Red Hat Compatible kernel: 4.18.0-80.el8.x86_64 or later

  • Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 4: 4.1.12-124.19.2.el7uek.x86_64 or later
    Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 5: 4.14.35-1818.1.6.el7uek.x86_64 or later
    Oracle Linux 7.7 with the Unbreakable Enterprise Kernel 6: 5.4.17-2011.4.4.el7uek.x86_64 or later
    Oracle Linux 7.5 with the Red Hat Compatible Kernel: 3.10.0-862.11.6.el7.x86_64 or later

  • Red Hat Enterprise Linux 9: 5.14.0-70.22.1.el9_0.x86_64 or later

  • Red Hat Enterprise Linux 8: 4.18.0-80.el8.x86_64 or later

  • Red Hat Enterprise Linux 7.5: 3.10.0-862.11.6.el7.x86_64 or later

    Note: Oracle Database 19c continues to be supported on Oracle Linux 7 and Red Hat Enterprise Linux 7, however, Oracle strongly recommends that you upgrade your operating system to Oracle Linux 8 or Red Hat Enterprise Linux 8 or later.

  • SUSE Linux Enterprise Server 15: 4.12.14-23-default or later

  • SUSE Linux Enterprise Server 12 SP3: 4.4.162-94.72-default or later

Review the system requirements section for a list of minimum package requirements.

IBM: Linux on System z operating system requirements

The following IBM: Linux on System z kernels are supported:

  • Red Hat Enterprise Linux 9.2: 5.14.0-284.30.1.el9_2.s390x or later

  • Red Hat Enterprise Linux 8.3: 4.18.0-240.el8.s390x or later

  • Red Hat Enterprise Linux 7.4: 3.10.0-693.el7.s390x or later

  • SUSE Linux Enterprise Server 15: 5.3.18-57-default s390x or later

  • SUSE Linux Enterprise Server 12: 4.4.73-5-default s390x or later

Review the system requirements section for a list of minimum package requirements.

Linux for Arm (aarch64) operating system requirements

Starting with Oracle Database 19c Release 19.19, the Linux for Arm (aarch64) operating system is supported with the following minimum supported version:

Oracle Linux 8.6 with Unbreakable Enterprise Kernel 7: 5.15.0-6.80.3.1.el8uek.aarch64 or later
Note: Oracle recommends that you update Oracle Linux 8 to the latest available release level.

Oracle Database Preinstallation RPM for Oracle Linux

If you use Oracle Linux, then Oracle recommends that you run the Oracle Database Preinstallation RPM for your Linux release to configure your operating system for Oracle Database and Oracle Grid Infrastructure installations.

Oracle RPM Checker utility for IBM: Linux on System z

Oracle recommends that you use the Oracle RPM Checker utility to verify that you have the required Red Hat Enterprise Linux or SUSE packages installed on your IBM: Linux on System z operating system before you start the Oracle Database or Oracle Grid Infrastructure installation.

Disable Transparent HugePages

Oracle recommends that you disable Transparent HugePages and use standard HugePages for enhanced performance.

1.3.Oracle数据库安装的服务器配置检查清单

使用此检查表来确认Orace数据库安装所需要的最低版务器配置要求

CheckTask

Disk space allocated to the /tmp directory

At least 1 GB of space in the /tmp directory.

Swap space allocation relative to RAM (Oracle Database)

Between 1 GB and 2 GB: 1.5 times the size of the RAM
Between 2 GB and 16 GB: Equal to the size of the RAM
More than 16 GB: 16 GB
Note: If you enable HugePages for your Linux servers, then you should deduct the memory allocated to HugePages from the available RAM before calculating swap space.

Swap space allocation relative to RAM (Oracle Restart)

Between 8 GB and 16 GB: Equal to the size of the RAM
More than 16 GB: 16 GB
Note: If you enable HugePages for your Linux servers, then you should deduct the memory allocated to HugePages from the available RAM before calculating swap space.

Oracle Inventory (oraInventory) and OINSTALL Group Requirements

  • For upgrades, the installer detects an existing oraInventory directory from the /etc/oraInst.loc file, and uses the existing oraInventory.

  • For new installs, if you have not configured an oraInventory directory, then you can specify the oraInventory directory during the software installation and Oracle Universal Installer will set up the software directories for you. The Oracle inventory is one directory level up from the Oracle base for the Oracle software installation and designates the installation owner's primary group as the Oracle inventory group. Ensure that the oraInventory path that you specify is in compliance with the Oracle Optimal Flexible Architecture recommendations.

The Oracle Inventory directory is the central inventory of Oracle software installed on your system. Users who have the Oracle Inventory group as their primary group are granted the OINSTALL privilege to write to the central inventory.

The OINSTALL group must be the primary group of all Oracle software installation owners on the server. It should be writable by any Oracle installation owner.

Groups and usersOracle recommends that you create groups and user accounts required for your security plans before starting installation. Installation owners have resource limits settings and other requirements. Group and user names must use only ASCII characters.
Mount point paths for the software binariesOracle recommends that you create an Optimal Flexible Architecture configuration as described in the appendix "Optimal Flexible Architecture" in Oracle Database Installation Guide for your platform.
Ensure that the Oracle home (the Oracle home path you select for Oracle Database) uses only ASCII characters

The ASCII character restriction includes installation owner user names, which are used as a default for some home paths, as well as other directory names you may select for paths.

Unset Oracle software environment variables

If you have an existing Oracle software installation, and you are using the same user to install this installation, then unset the following environment variables: $ORACLE_HOME,$ORA_NLS10, and $TNS_ADMIN.

If you have set $ORA_CRS_HOME as an environment variable, then unset it before starting an installation or upgrade. Do not use $ORA_CRS_HOME as a user environment variable, except as directed by Oracle Support.

Set locale (if needed)

Specify the language and the territory, or locale, in which you want to use Oracle components. A locale is a linguistic and cultural environment in which a system or program is running. NLS (National Language Support) parameters determine the locale-specific behavior on both servers and clients. The locale setting of a component determines the language of the user interface of the component, and the globalization behavior, such as date and number formatting.

Check Shared Memory File System Mount

By default, your operating system includes an entry in /etc/fstab to mount /dev/shm. However, if your Cluster Verification Utility (CVU) or installer checks fail, ensure that the /dev/shm mount area is of type tmpfs and is mounted with the following options:

  • rw and exec permissions set on it

  • Without noexec or nosuid set on it

Note

These options may not be listed as they are usually set as the default permissions by your operating system.

Symlinks

Oracle home or Oracle base cannot be symlinks, nor can any of their parent directories, all the way to up to the root directory.

1.4.Oracle数据库安装的用户环境配置检查清单

使用此检查表来规划Oracle数据库管理的操作系统用户、组和环境。

CheckTask
Review Oracle Inventory (oraInventory) and OINSTALL Group Requirements

The physical group you designate as the Oracle Inventory directory is the central inventory of Oracle software installed on your system. It should be the primary group for all Oracle software installation owners. Users who have the Oracle Inventory group as their primary group are granted the OINSTALL privilege to read and write to the central inventory.

  • If you have an existing installation, then OUI detects the existing oraInventory directory from the/etc/oraInst.loc file, and uses this location.

  • If you are installing Oracle software for the first time, then you can specify the Oracle inventory directory and the Oracle base directory during the Oracle software installation, and Oracle Universal Installer will set up the software directories for you. Ensure that the directory paths that you specify are in compliance with the Oracle Optimal Flexible Architecture recommendations.

Ensure that the group designated as the OINSTALL group is available as the primary group for all planned Oracle software installation owners.

Create operating system groups and users for standard or role-allocated system privileges

The Preinstallation RPM automatically creates the oracle user and the oraInventory (oinstall) and OSDBA (dba) groups for you.

Create additional operating system groups and users depending on your security requirements as described in this installation guide.

Set resource limits settings and other requirements for Oracle software installation owners.

Group and user names must use only ASCII characters.

Unset Oracle Software Environment Variables

If you have had an existing installation on your system, and you are using the same user account for this installation, then unset the ORACLE_HOME, ORACLE_BASE, ORACLE_SID, TNS_ADMIN environment variables and any other environment variable set for the Oracle installation user that is connected with Oracle software homes.

Configure the Oracle Software Owner Environment

Configure the environment of the oracle or grid user by performing the following tasks:

  • Set the default file mode creation mask (umask) to 022 in the shell startup file.

  • Set the DISPLAY environment variable.

1.5.Oracle数据库安装的存储检查清单

使用此检查表来审查存储最低要求并协助配置规划。

CheckTask
Minimum local disk storage space for Oracle software

For Linux x86-64 and Linux for Arm (aarch64):
At least 6.5 GB for an Oracle Grid Infrastructure for a standalone server installation.
At least 7.2 GB for Oracle Database Enterprise Edition.
At least 7.2 GB for Oracle Database Standard Edition 2.

For IBM: Linux on System z:
At least 5.5 GB for an Oracle Grid Infrastructure for a standalone server installation.
At least 5.9 GB for Oracle Database Enterprise Edition.
At least 5.9 GB for Oracle Database Standard Edition 2.

Note

Oracle recommends that you allocate approximately 100 GB to allow additional space for applying any future patches on top of the existing Oracle home. For specific patch-related disk space requirements, please refer to your patch documentation.

Select Database File Storage Option

Ensure that you have one of the following storage options available:

  • File system mounted on the server. Oracle recommends that the file system you select is separate from the file system used by the operating system or the Oracle software. Options include the following:

    • A file system on a logical volume manager (LVM) volume or a RAID device

    • A network file system (NFS) mounted on a certified network-attached storage (NAS) device

  • Oracle Automatic Storage Management (Oracle ASM).

    Oracle ASM is installed as part of an Oracle Grid Infrastructure installation. If you plan to use Oracle ASM for storage, then you should install Oracle Grid Infrastructure before you install and create the database.

Determine your recovery planIf you want to enable recovery during installation, then be prepared to select one of the following options:
  • File system: Configure a fast recovery area on a file system during installation

  • Oracle Automatic Storage Management: Configure a fast recovery area disk group using Oracle ASMCA.

Review the storage configuration sections of this document for more information about configuring recovery.

1.6.Oracle数据库安装程序规划检查清单

使用此检查清单帮助您在开始Oracle通用安装程序之前做好准备。

CheckTask

Read the Release Notes

Review release notes for your platform, which are available for your release at the following URL:

http://docs.oracle.com/en/database/database.html

Review Oracle Support Certification Matrix

New platforms and operating system software versions may be certified after this guide is published, review the certification matrix on the My Oracle Support website for the most up-to-date list of certified hardware platforms and operating system versions:

https://support.oracle.com/

You must register online before using My Oracle Support. After logging in, from the menu options, select the Certifications tab. On the Certifications page, use the Certification Search options to search by Product, Release, and Platform. You can also search using the Certification Quick Link options such as Product Delivery, and Lifetime Support.

Review the Licensing Information

You are permitted to use only those components in the Oracle Database media pack for which you have purchased licenses. For more information about licenses, refer to the following URL:

Oracle Database Licensing Information

Run OUI with CVU and use fixup scripts

Oracle Universal Installer is fully integrated with Cluster Verification Utility (CVU), automating many CVU prerequisite checks. Oracle Universal Installer runs all prerequisite checks and creates fixup scripts when you run the installer. You can run OUI up to the Summary screen without starting the installation.

You can also run CVU commands manually to check system readiness. For more information, see:

Oracle Clusterware Administration and Deployment Guide
Update and run Oracle ORAchk for runtime and upgrade checks, or runtime health checks

Oracle recommends that you update to the latest version of Oracle ORAchk by installing the latest version of Autonomous Health Framework (AHF).

The Oracle ORAchk utility provides system checks that can help to prevent issues before and after installation. These checks include kernel requirements, operating system resource allocations, and other system requirements.

Use the Oracle ORAchk Upgrade Readiness Assessment to obtain an automated upgrade-specific system health check for upgrades to 19c. For example:

  • Before you perform a fresh database installation:

    ./orachk -profile preinstall
  • To upgrade your existing database to a higher version or release:

    ./orachk -pregupgrade -targetversion 19.0.0.0.0

The Oracle ORAchk Upgrade Readiness Assessment automates many of the manual pre- and post-upgrade checks described in Oracle upgrade documentation. Check My Oracle Support Note 2550798.1 for more information about Oracle ORAchk support.

https://support.oracle.com/epmos/faces/DocContentDisplay?id=2550798.1&parent=DOCUMENTATION&sourceId=USERGUIDE

Verify if Oracle Grid Infrastructure is installed

If you want to use Oracle ASM or Oracle Restart, then install Oracle Grid Infrastructure for a standalone server before you install and create the database. Otherwise, to use Oracle ASM, you must complete an Oracle Grid Infrastructure installation, and then manually register the database with Oracle Restart.

For Oracle Real Application Clusters (Oracle RAC) installations, ensure that you have installed and configured Oracle Grid Infrastructure for a cluster.

Check running Oracle processes, and shut down if necessary

  • On a standalone database not using Oracle ASM: You do not need to shut down the database while you install Oracle Grid Infrastructure.

  • On a standalone database using Oracle ASM: The Oracle ASM instances are restarted during installation.

  • On an Oracle RAC Database node: This installation requires an upgrade of Oracle Clusterware, as Oracle Clusterware is required to run Oracle RAC. As part of the upgrade, you must shut down the database one node at a time as the rolling upgrade proceeds from node to node.

Ensure cron jobs do not run during installationIf the installer is running when daily cron jobs start, then you may encounter unexplained installation problems if your cron job is performing cleanup, and temporary files are deleted before the installation is finished. Oracle recommends that you complete installation before daily cron jobs are run, or disable daily
cron
jobs that perform cleanup until after the installation is completed.
Obtain your My Oracle Support account information.

During installation, you may require a My Oracle Support user name and password to configure updates, download software updates, and other installation tasks. You can register for My Oracle Support at the following URL:

https://support.oracle.com/

Decide Oracle Database management tool

By default, Oracle Database is managed by Oracle Enterprise Manager Database Express.

If you have an existing Oracle Management Agent, and decide to use Oracle Enterprise Manager Cloud Control to centrally manage your database, then obtain the following information to enter during the database installation:

  • OMS host

  • OMS port

  • EM admin username

  • EM admin password

  • Specify password of ASMSNMP user

For more information, see:

  • Oracle Database 2 Day DBA

  • Oracle Enterprise Manager Cloud Control Administrator’s Guide

Review memory allocation and Automatic Memory Management feature

You can enable automatic memory management either during, or after Oracle Database installation. If you enable automatic memory management after installation, then you must shut down and restart the database.

If the total physical memory of your database instance is greater than 4 GB, then you cannot select the Oracle Automatic Memory Management option during database installation and creation. Instead, use automatic shared memory management. Automatic shared memory management automatically distributes the available memory among the various components as required, allowing the system to maximize the use of all available SGA memory.

For more information, see:

Oracle Database Administrator's Guide

Determine superuser (root) privilege delegation option for installation

During a database or grid infrastructure installation, you are asked to run configuration scripts as the root user.

You can either run these scripts manually as root when prompted, or you can provide configuration information and passwords using a root privilege delegation option.

To run root scripts automatically, select Automatically run configuration scripts during installation.

  • Use root user credentials

    Provide the superuser password for cluster member node servers.

  • Use Sudo

    Sudo is a UNIX and Linux utility that allows members of the sudoers list privileges to run individual commands as root. Provide the username and password of an operating system user that is a member of sudoers, and is authorized to run Sudo on each cluster member node.

    To enable Sudo, have a system administrator with the appropriate privileges configure a user that is a member of the sudoers list, and provide the username and password when prompted during installation.

Oracle Database Client and Oracle Database interoperability

For information about interoperability between Oracle Database Client and Oracle Database releases, see My Oracle Support Note 207303.1:

https://support.oracle.com/rs?type=doc&id=207303.1

1.7.Oracle数据库部署检查清单

使用此检查表来决定单实例Oracle数据库的部署方法。

ItemTask

To deploy single-instance Oracle Database software

Use one of the following deployment methods:

  • Install Oracle Database software using Oracle Universal Installer (OUI).

  • Provision Oracle Database software using Oracle Fleet Patching and Provisioning.

  • Clone Oracle Database.

To deploy single-instance Oracle Database software and create databases

Use one of the following deployment methods:

  • Install Oracle Database software using Oracle Universal Installer (OUI).

  • Provision Oracle Database software using Oracle Fleet Patching and Provisioning.

  • Clone Oracle Database.

To create single-instance Oracle Database in an already-installed Oracle home

  • Use Oracle Database Configuration Assistant (Oracle DBCA).

  • Use Oracle Fleet Patching and Provisioning

1.8.查看本地配置

使用此程序收集有关您的服务器配置的信息。

grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo
df -h /tmp
free
uname -m
df -h /dev/shm

为 Oracle 软件安装做准备。

1.8.1.配置oracle官方yum源

wget https://yum.oracle.com/public-yum-ol7.repo -O /etc/yum.repos.d/public-yum-ol7.repo

安装oracle linux的预安装包,此操作会预先安装所需依赖和安装程序。

如果没有预安装程序,则依次对下边的安装包进行安装:

yum install -y bc binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat motif motif-devel smartmontools net-tools

确认内核参数:

二、系统配置(root用户操作)

2.1. 创建Oracle用户与组

Oracle安装需专用用户和组(避免使用root直接操作):

# 创建组
groupadd -g 54321 oinstall   # 安装组
groupadd -g 54322 dba         # 数据库管理员组
groupadd -g 54323 oper        # 操作员组(可选)


# 创建oracle用户并加入组(这里非常容易出问题,后边如果遇到用户组归属不多,可通过usermod来进行修改
useradd -u 54321 -g oinstall -G dba,oper oracle


 
# 设置oracle用户密码(可选)
passwd oracle  # 输入密码(如Oracle123)

一般如果执行预安装程序的话,用户及用户组之间的所属关系都会提前建立好。

2.2. 创建安装目录

指定Oracle软件和数据存储路径(需oracle用户有读写权限):

inventory:翻译为库存;(商店的)存货,这里指安装信息

mkdir -p /u01/app/oracle/product/19c/dbhome_1  # ORACLE_HOME
mkdir -p /u01/app/oracle/oradata                          # 数据文件目录
mkdir -p /u01/app/oracle/inventory                        #  inventory目录(安装信息)
mkdir -p /u01/app/oracle/fast_recovery_area        # 闪回区(可选)


 
2.3.修改目录权限

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

2.4. 配置内核参数(视情况进行修改)

配置文件目录:/etc/sysctl.conf

Oracle依赖内核参数优化,编辑/etc/sysctl.conf添加:

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152           # 物理内存/页大小(例:4GB内存=4*1024*1024/4=1048576,默认页大小可通过getconf PAGE_SIZE查看)
kernel.shmmax = 4294967296  # 最大共享内存段(建议为物理内存的50%,单位字节,4GB=4*1024^3=4294967296)
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

配置生效:sysctl -p

2.5. 配置用户资源限制

配置文件目录:/etc/security/limits.conf

编辑/etc/security/limits.conf,添加oracle用户限制:

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 1048576  # 软限制(KB,根据内存调整)
oracle hard memlock 2097152  # 硬限制(KB)
生效配置:重启系统或执行ulimit -a(需重新登录oracle用户)。

三、Oracle用户环境变量配置

切换到oracle用户,编辑.bash_profile(/home/oracle/.bash_profile):

su oracle
vi .bash_profile/~/.bash_profile
添加以下内容(根据实际路径调整):

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1
export ORACLE_SID=orcl  # 数据库实例名(自定义,如orcl、prod)
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/.local/bin:$HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8  # 字符集(或ZHS16GBK)

环境变量生效:source .bash_profile/source ~/.bash_profile

四、准备安装介质与响应文件

4.1. 上传并解压Oracle 19c安装包

从Oracle官网下载Linux x86-64的Oracle 19c安装包(如LINUX.X64_193000_db_home.zip),上传至虚拟机/opt目录后进行解压

# 切换到oracle用户
su - oracle
 
# 解压安装包(确保ORACLE_HOME为空目录)

如:unzip /opt/LINUx.X64 193000 db home.zip -d /u01/app/oracle/product/19c/dbhome 1

4.2. 创建静默安装响应文件

Oracle静默安装需通过响应文件指定参数,模板位于$ORACLE_HOME/install/response/db_install.rsp

4.2.1.复制并修改

cp $ORACLE_HOME/install/response/db_install.rsp /tmp/db_install.rsp
vi /tmp/db_install.rsp

4.2.2.修改以下关键参数(其他参数保持默认或根据需求调整)

oracle.install.option=INSTALL_DB_SWONLY              # 仅安装数据库软件(后续手动建库)
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/inventory  # 与之前创建的inventory目录一致
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1  # 必须与环境变量一致
oracle.install.db.InstallEdition=EE                                         # 企业版(EE)或标准版(SE2)
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=dba          # 备份管理员组(使用dba)
oracle.install.db.OSDGDBA_GROUP=dba                   # 数据卫士组(使用dba)
oracle.install.db.OSKMDBA_GROUP=dba                   # 加密管理员组(使用dba)
oracle.install.db.OSRACDBA_GROUP=dba                 # 恢复目录组(使用dba)
DECLINE_SECURITY_UPDATES=true                        # 拒绝安全更新(无Oracle账号时)

五、静默安装Oracle软件(oracle用户下)

5.1.执行runInstaller静默安装

指定响应文件:

cd $ORACLE_HOME
./runInstaller -silent -responseFile /tmp/db_install.rsp -ignorePrereq
-silent:静默模式(无图形界面);
-responseFile:指定响应文件路径;
-ignorePrereq:忽略部分先决条件检查(如系统配置不完全符合时)。

安装过程监控

安装日志默认位于/u01/app/oracle/inventory/logs/installActions<时间戳>.log,可通过日志查看进度:

tail -f /u01/app/oracle/inventory/logs/installActions*.log

执行root脚本(安装完成后,root用户操作)

安装成功后,日志会提示执行以下脚本(路径以实际日志为准):

# 切换到root用户
su - root
 
# 执行inventory脚本
/u01/app/oracle/inventory/orainstRoot.sh
 
# 执行ORACLE_HOME下的root脚本
/u01/app/oracle/product/19c/dbhome_1/root.sh

六、静默创建数据库实例(DBCA)

实例:instance

安装软件后,通过dbca(数据库配置助手)静默创建数据库实例:

6.1. 直接命令行创建(推荐)

执行以下命令(根据需求调整参数):

# 切换到oracle用户

su - oracledbca -silent \-createDatabase \-templateName General_Purpose.dbc \  # 通用模板(位于$ORACLE_HOME/assistants/dbca/templates)-gdbname orcl \                     # 全局数据库名-sid orcl \                         # 实例名(与ORACLE_SID一致)-responseFile NO_VALUE \-characterSet AL32UTF8 \            # 字符集-memoryMgmtType AUTO_SGA \          # 自动内存管理-totalMemory 1024 \                 # 总内存(MB,根据系统内存调整,如1024=1GB)-storageType FS \                   # 文件系统存储-datafileDestination /u01/app/oracle/oradata \  # 数据文件路径-redoLogFileSize 50 \               # 重做日志大小(MB)-emConfiguration NONE \             # 不配置EM Express-dbUserPasswords sys_password \     # 统一密码(如Oracle123)-createAsContainerDatabase false \  # 不创建容器数据库(CDB)-databaseType MULTIPURPOSE \        # 多用途数据库-automaticMemoryManagement false    # 禁用自动内存管理(若使用AUTO_SGA则设为false)

若提示输入密码,直接输入(如Oracle123);

如需为不同用户设置密码(sys、system等),用-sysPassword、-systemPassword分别指定。

6.2. 通过响应文件创建(可选)

若参数较多,可使用DBCA响应文件模板($ORACLE_HOME/assistants/dbca/dbca.rsp),修改后执行:

dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName orcl -sysPassword Sys#2025 -systemPassword System#2025 -memoryMgmtType AUTO -totalMemory 2048

七、验证安装结果

7.1. 检查监听状态

lsnrctl status  # 若未启动,执行lsnrctl start

输出应包含LISTENER状态为READY,端口1521。

7.2. 连接数据库验证

通过sqlplus连接数据库实例:

sqlplus / as sysdba  # 以sysdba身份登录

执行以下命令检查实例状态:

SQL> select status from v$instance;  # 输出应为OPEN
SQL> select name from v$database;    # 输出数据库名(如ORCL)
SQL> exit

示例:

关键总结
核心步骤
系统准备:检查OS版本、依赖包、硬件资源,创建oracle用户/组和安装目录。
配置关键:内核参数(sysctl.conf)、用户限制(limits.conf)、Oracle环境变量(.bash_profile)。
安装软件:解压安装包,修改响应文件,执行runInstaller -silent静默安装,运行root脚本。
创建数据库:使用dbca -silent命令行创建实例,指定字符集、内存、存储路径等参数。
验证:检查监听状态(lsnrctl)、数据库连接(sqlplus)、实例状态(v$instance)。
常见问题解决
依赖包缺失:通过yum whatprovides <包名>查找缺失包并安装;
响应文件参数错误:核对ORACLE_HOME、ORACLE_BASE路径,确保与实际目录一致;
权限不足:检查/u01目录所有者是否为oracle:oinstall,权限是否为775;
内存不足:调整/etc/security/limits.conf中的memlock参数或增加系统内存。

http://www.dtcms.com/a/596994.html

相关文章:

  • 【vscode】vscode上plantuml安装和使用
  • Prompt 提示词工程
  • html5做网站总结邢台 网站建设
  • 黑马JAVAWeb -Vue工程化 - Element Plus
  • [Android] AR绘画素描1.0版(AR Draw - Sketch Anime Cartoon 1.0)
  • 微信网站用什么语言开发金融软件网站建设公司
  • 一个静态网站怎么做南宁网站建设怎么样
  • CGAL(计算几何算法库)
  • 数据中台:打破企业数据孤岛,实现全域资产化的关键一步
  • 如何保持自己的技术前沿性?
  • 『 QT 』显示类控件 二
  • 【Rust】m2 mac 编译linux 、aarch、win 程序
  • 【FAQ】HarmonyOS SDK 闭源开放能力 — Network Kit
  • 使用arduino用 esp32 连接阿里云遇到的坑
  • 哈尔滨市延寿建设局网站巢湖网站开发
  • 制作百度移动网站模板网页服务器一年多少钱
  • 从概念到偏好:文生图模型的四层进化之路(训练过程)
  • Gated DeltaNet 网络学习记录
  • <数据集>yolo航拍斑马线识别数据集<目标检测>
  • GitHub笔记
  • SpringBoot+Vue3无人机AI巡检系统
  • 中山网站百度优化社交网站建设教程
  • 彩票网站怎么做推广淮安高端网站制作
  • 基于MATLAB实现的Elman神经网络用于电力负载预测
  • uni-app iOS日志管理实战,从调试控制台到系统日志的全链路采集与分析指南
  • Python 正则表达式全解析:基础到高效提取实战
  • Kubernetes部署Dashboard服务
  • Psychtoolbox (PTB)安装指南
  • 学习threejs,打造虹彩编织球体
  • 面向对象(上)-MVC设计模式的理解