静默安装Oracle19c软件与数据库

本文介绍了在无图形环境下的Oracle 19c静默安装和数据库创建步骤,包括silent安装配置和可能遇到的警告及解决方案,以及创建container和non-container数据库的详细命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、静默安装Oracle 19c软件

1.1、适用场景

如果无windows环境用于图形安装oracle软件,需要使用静默方式安装数据库,脚本如下:

1.2、静默安装Oracle

$ su - oracle
$ cd $ORACLE_HOME
$ ./runInstaller -ignorePrereq -waitforcompletion -silent \
oracle.install.option=INSTALL_DB_SWONLY \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=/u01/app/oraInventory \
ORACLE_HOME=${ORACLE_HOME} \
ORACLE_BASE=${ORACLE_BASE} \
oracle.install.db.InstallEdition=EE \
oracle.install.db.OSDBA_GROUP=dba \
oracle.install.db.OSOPER_GROUP=oper \
oracle.install.db.OSBACKUPDBA_GROUP=backupdba \
oracle.install.db.OSDGDBA_GROUP=dgdba \
oracle.install.db.OSKMDBA_GROUP=kmdba \
oracle.install.db.OSRACDBA_GROUP=racdba \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
DECLINE_SECURITY_UPDATES=true \
oracle.install.db.rootconfig.executeRootScript=false

# ----------------------------------------------
# 安装日志
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.
[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2022-04-20_03-49-57PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: installActions2022-04-20_03-49-57PM.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.3.0/db_1/install/response/db_2022-04-20_03-49-57PM.rsp

You can find the log of this install session at:
 /tmp/InstallActions2022-04-20_03-49-57PM/installActions2022-04-20_03-49-57PM.log

As a root user, execute the following script(s):
        1. /u01/app/oraInventory/orainstRoot.sh
        2. /u01/app/oracle/product/19.3.0/db_1/root.sh

Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes: 
[server100]
Execute /u01/app/oracle/product/19.3.0/db_1/root.sh on the following nodes: 
[server100]


Successfully Setup Software with warning(s).
Moved the install session logs to:
 /u01/app/oraInventory/logs/InstallActions2022-04-20_03-49-57PM
 [oracle@server100 db_1]$ exit
logout

# 使用root用户执行脚本
[root@server100 db_1]# sh /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@server100 db_1]# sh /u01/app/oracle/product/19.3.0/db_1/root.sh
Check /u01/app/oracle/product/19.3.0/db_1/install/root_server100_2022-04-20_15-52-56-229585574.log for the output of root script

2、静默创建数据库

2.1、适用场景

如果无windows环境用于图形创建oracle数据库,需要使用静默方式创建数据库,脚本如下:

2.2、创建容器数据库

$ dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-responseFile NO_VALUE \
-createAsContainerDatabase true \
-numberOfPDBs 1 \
-pdbName ${PDB_NAME} \
-pdbAdminPassword BSOFT \
-gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} \
-characterSet ZHS16GBK \
-sysPassword BSOFT \
-systemPassword BSOFT \
-databaseType OLTP \
-totalMemory 8192 \
-storageType FS \
-datafileDestination '/data' \
-recoveryAreaDestination '/data/flash_recovery_area' \
-redoLogFileSize 50 \
-emConfiguration NONE \
-ignorePreReqs

2.3、创建非容器数据库

$ dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-responseFile NO_VALUE \
-gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} \
-characterSet ZHS16GBK \
-sysPassword BSOFT \
-systemPassword BSOFT \
-databaseType OLTP \
-totalMemory 8192 \
-storageType FS \
-datafileDestination '/data' \
-recoveryAreaDestination '/data/flash_recovery_area' \
-redoLogFileSize 50 \
-emConfiguration NONE \
-ignorePreReqs

# ----------------------------------------------
# 执行日志
[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 password
   ACTION: 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 password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
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/demo.
Database Information:
Global Database Name:demo
System Identifier(SID):demo
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/demo/demo.log" for further details.
### 静默安装 Oracle 19c 数据库于 Galaxy Kylin 操作系统的指南 #### 准备工作 为了确保静默安装过程顺利,在开始之前需确认系统满足最低硬件需求并完成必要的软件包准备。对于银河麒麟操作系统而言,建议先更新至最新版本以减少潜在兼容性问题[^1]。 #### 安装前配置 调整内核参数限制设置是成功部署的关键之一。编辑 `/etc/sysctl.conf` 文件加入特定条目来优化性能表现;同时通过修改 `/etc/security/limits.conf` 来放宽资源使用上限。这些改动有助于提高数据库运行效率以及稳定性。 #### 创建用户组及账户 创建专用的操作系统用户和组用于管理Oracle实例,这一步骤至关重要,因为它可以有效隔离权限范围从而增强安全性。命令如下所示: ```bash groupadd oinstall groupadd dba useradd -g oinstall -G dba oracle passwd oracle ``` #### 下载并解压安装文件 前往官方下载页面获取适用于Linux平台的Oracle Database 19c压缩包,并将其放置到指定目录下进行解压缩操作。注意要保证该路径有足够的空间存储整个产品及其依赖项[^2]。 #### 编写响应文件 静默模式下的核心在于构建正确的response file (应答文件),它包含了所有交互过程中所需的信息。此文件通常命名为 `silent_install.rsp` 或者类似的名称。下面是一个简单的模板例子: ```properties # Silent Installation Response File for Oracle Database 19c oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oracle/oraInventory SELECTED_LANGUAGES=en,zh_CN ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1 ORACLE_BASE=/u01/app/oracle EMCONFIGURATION=NONE DECLINE_SECURITY_UPDATES=true SECURITY_UPDATES_VIA_MYORACLESUPPORT=false ``` #### 执行静默安装 当一切就绪之后就可以调用runInstaller工具来进行实际安装流程了。记得切换成刚刚建立好的oracle用户身份执行相应指令: ```bash sudo su - oracle cd /path/to/database/ ./runInstaller -silent -responseFile /path/to/silent_install.rsp ``` #### 后续处理 安装完成后还需要做一些收尾的工作比如初始化监听器服务、创建新的数据库实例等。这部分可以通过DBCA(Database Configuration Assistant)图形界面或者命令行方式实现自动化脚本化处理[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值