环境规划:
- OS Version : Red Hat Enterprise Linux Server release 6.7 (Santiago)
- Oracle Version: 11.2.0.4
操作系统环境配置可参考 Oracle 单实例安装文档
1, 上传 Oracle 安装介质, 进入解压目录, 复制响应文件模板
- cd /home/oracle/
- mkdir rsp
- cp /db/soft/database/response/*/home/oracle/rsp/
- su - root
- chmod 700 /home/oracle/rsp/*.rsp
- chown -R oracle:oinstall /home/oracle/rsp/
2, 修改响应文件相关参数
vi /home/oracle/rsp/db_install.rsp
- oracle.install.option=INSTALL_DB_SWONLY // 安装类型
- ORACLE_HOSTNAME=hostname // 主机名称
- UNIX_GROUP_NAME=oinstall // 安装组
- INVENTORY_LOCATION=/db/oraInventory //INVENTORY 目录
- SELECTED_LANGUAGES=en,zh_CN,AL32UTF8 // 选择语言
- ORACLE_HOME=/db/oracle/product/11.2.0/db_1 //oracle_home
- ORACLE_BASE=/db/oracle //oracle_base
- oracle.install.db.InstallEdition=EE //oracle 版本
- oracle.install.db.isCustomInstall=true // 自定义安装
- oracle.install.db.DBA_GROUP=dba //dba 用户组
- oracle.install.db.OPER_GROUP=oinstall //oper 用户组
- oracle.install.db.config.starterdb.type=GENERAL_PURPOSE // 数据库类型
- oracle.install.db.config.starterdb.globalDBName=oadb //globalDBName
- oracle.install.db.config.starterdb.SID=orcl //SID
- oracle.install.db.config.starterdb.characterSet=AL32UTF8 // 字符集
- oracle.install.db.config.starterdb.memoryLimit=512 // 自动管理内存的最小内存 (M)
- oracle.install.db.config.starterdb.password.ALL=oracle // 设定所有数据库用户使用同一个密码
- DECLINE_SECURITY_UPDATES=true // 设置安全更新
3, 静默 安装数据库软件
[oracle@template database]$ ./runInstaller -silent -force -responseFile /home/oracle/res/db_install.rsp
[注意]
安装过程中如果出现 Fail, 说明安装中断.
出现 Waring 可以不用理会, 此时安装仍在进行, 可随时注意查看安装日志即可.
Starting Oracle Universal Installer...
- Checking Temp space: must be greater than 120 MB. Actual 8033 MB Passed
- Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-04-05_06-27-07PM. Please wait ...
[oracle@template database]$ [F] [INS-10101] The given response file /home/oracle/res/db_install.rsp is not found.
- CAUSE: The given response file is either not accessible or do not exist.
- ACTION: Give a correct response file location. (Note: relative path is not supported)
- A log of this session is currently saved as: /tmp/OraInstall2018-04-05_06-27-07PM/installActions2018-04-05_06-27-07PM.log.
Oracle recoms that if you want to keep this log, you should move it from the temporary location to a more permanent location.
根据红色部分提示, 发现路径写错.
再次执行:
[oracle@template database]$
[oracle@template database]$ ./runInstaller -silent -force -responseFile /home/oracle/rsp/db_install.rsp
Starting Oracle Universal Installer...
- Checking Temp space: must be greater than 120 MB. Actual 8033 MB Passed
- Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed
- Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-04-05_06-31-06PM. Please wait ...[oracle@template database]$ [Wt meet some optional requirements.
- CAUSE: Some of the optional prerequisites are not met. See logs for details. /tmp/OraInstall2018-04-05_06-31-06PM/installActions2018
- ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2018-04-05_06-31-06PM/installActions2018-04-05_e or
- from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
- You can find the log of this install session at:
/db/oraInventory/logs/installActions2018-04-05_06-31-06PM.log
正常输出
这里提示安装成功, 运行脚本:
[oracle@template database]$ The installation of Oracle Database 11g was successful.
Please check '/db/oraInventory/logs/silentInstall2018-04-05_06-31-06PM.log' for more details.
As a root user, execute the following script(s):
1. /db/oracle/product/11.2.0/db_1/root.sh
Successfully Setup Software.
到 root 用户执行该脚本:
/db/oracle/product/11.2.0/db_1/root.sh
查看安装日志: (安装已经完成)
tail -f /db/oraInventory/logs/installActions2018-04-05_06-31-06PM.log
- ...
- ...
- INFO: Completed validating state <finish>
- INFO: Terminating all background operations
- INFO: Terminated all background operations
- INFO: Successfully executed the flow in SILENT mode
- INFO: Adding ExitStatus SUCCESS_WITH_WARNINGS to the exit status set
- INFO: Finding the most appropriate exit status for the current application
- INFO: Exit Status is 6
- INFO: List of warnings encountered in this Application:
- INFO: PREREQS_FAILED_WITH_WARNING
- INFO: Shutdown Oracle Database 11g Release 2 Installer
登录验证安装成功:
4, 静默配置监听
[oracle@template database] $ORACLE_HOME/bin/netca /silent /responseFile /home/oracle/rsp/netca.rsp
可直接修改 /netca.rsp 文件内的配置来创建监听
5, 静默安装数据库
安装数据库可以通过修改响应文件和直接使用命令 两种方式来安装
修改仅安装数据库的响应文件
vim /home/oracle/rsp/dbca.rsp
- [CREATEDATABASE] // 仅修改此部分即可, 可按照实际需求调整
- GDBNAME="oadb.template" // 全局数据库的名字 = SID + 主机域名
- SID="oadb" //SID
- CHARACTERSET="AL32UTF8" // 编码
- NATIONALCHARACTERSET="UTF8" // 编码
开始静默创建数据库:
[oracle@template database] $ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/rsp/
dbca.rsp
执行之后会要求输入 sys/system 密码 (可以在响应文件中直接修改)
- Copying database files
- 1% complete
- 3% complete
- 11% complete
- 18% complete
- 26% complete
- 37% complete
- Creating and starting Oracle instance
- 40% complete
- 45% complete
- 50% complete
- 55% complete
- 56% complete
- 57% complete
- 60% complete
- 62% complete
- Completing Database Creation
- 66% complete
- 70% complete
- 73% complete
- 85% complete
- 96% complete
- 100% complete
Look at the log file "/db/oracle/cfgtoollogs/dbca/oadb/oadb.log" for further details.
数据库创建完成.
进入数据库查询数据库的状态.
后续的参数调整根据个人实际情况进行修改.
来源: http://www.linuxidc.com/Linux/2018-04/151749.htm