操作系统环境配置可参考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、静默安装数据库