oracle 11g 单实例静默安装
AUTHOR:Oracle_Ran
环境规划:
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.
根据红色部分提示,发现路径写错。 报错二:
SEVERE: [FATAL] PRVF-0002 : Could not retrieve local nodename.
Refer associated stacktrace #oracle.install.commons.util.exception.DefaultErrorAdvisor:35
INFO: Advice is ABORT
SEVERE: Unconditional Exit
INFO: Adding ExitStatus FAILURE to the exit status set
WARNING: A log of this session is currently saved as: /tmp/OraInstall2019-07-23_04-02-55PM/installActions2019-07-23_04-02-55PM.log. Oracle recommends that if you want to keep this log, you should move it from t
he temporary location to a more permanent location.
INFO: Finding the most appropriate exit status for the current application
INFO: Exit Status is -1
INFO: Shutdown Oracle Database 11g Release 2 Installer
主机名解析错误,检查/etc/hosts,hostname 输出是否一致。
再次执行:
[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 安装过程中可以查看日志或者 ps -ef|grep oracle 查看安装进程是否存在
ORACLE_HOME 的磁盘空间也会一直增大 du -sh
登录验证安装成功:
如果安装时报错:
[FATAL] [INS-13013] Target environment do not meet some mandatory requirements.
CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /tmp/OraInstall2019-05-06_04-03-46PM/installActions2019-05-06_04-03-46PM.log
ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2019-05-06_04-03-46PM/installActions2019-05-06_04-03-46PM.log. Then either from the log file or from installation manual find t
he appropriate configuration to meet the prerequisites and fix it manually.
INFO: Advice is ABORT
可以执行: ./runInstaller -silent -executePrereqs 执行先决条件检查
如果还是报同样的错误,就忽略报错:
./runInstaller -silent -force -noconfig -ignorePrereq -responseFile /home/oracle/rsp/db_install.rsp
或者
./runInstaller -ignorePrereq -silent -force -responseFile /home/oracle/rsp/db_install.rsp
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" //编码
DATAFILEDESTINATION=$ORACLE_BASE/oradata //数据文件路径,默认为$ORACLE_BASE/oradata
开始静默创建数据库:
[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. 数据库创建完成。 安装过程查看安装日志:
[root@ctc_som_app07 ~]# tail -f /db/oraInventory/logs/installActions2018-05-10_03-42-17PM.log
信息: 正在安装
信息: 将文件提取到 '/db/oracle/product/11.2.0/db_1'。
信息: 将文件提取到 '/db/oracle/product/11.2.0/db_1'。
信息: 根据文件 'oracle.server_EE_exp_1.xml' 中的信息执行快速复制操作。
信息: 根据文件 'racfiles.jar' 中的信息执行快速复制操作。
信息: 根据文件 'oracle.server_EE_dirs.lst' 中的信息执行快速复制操作。
信息: 根据文件 'oracle.server_EE_filemap.jar' 中的信息执行快速复制操作。
信息: 根据文件 'oracle.server_EE_1.xml' 中的信息执行快速复制操作。
信息: 根据文件 'setperms1.sh' 中的信息执行快速复制操作。
信息: Number of threads for fast copy :1
信息: The expanded list location :/tmp/OraInstall2018-05-10_03-42-17PM/fastcopy/oracle.server_EE_exp_1.xml
信息: Executing permissions file from :/tmp/OraInstall2018-05-10_03-42-17PM/fastcopy/setperms1.sh
信息: chmod 0755 bin/chopt
信息: chmod 0744 install/utl/rootmacro.sbs
信息: chmod 0755 bin/zip bin/unzip bin/oerr bin/genorasdksh bin/gensyslib bin/linkshlib
信息: chmod 0755 bin/csscan
信息: chmod 0750 bin/ctxkbtc bin/ctxlc bin/ctxload ctx/bin/ctxhx
信息: chmod 0644 relnotes/readmes/README_jdbc.txt jdbc/Readme.txt
信息: chmod 0644 relnotes/readmes/README_ucp.txt ucp/Readme.txt
信息: chmod 0755 crs/sbs/localconfig.sbs crs/sbs/clsrwrap.sbs crs/install/rootofs.sh bin/gnsd crs/sbs/srvctl.sbs crs/install/s_crsconfig_defs srvm/admin/getcrshome
信息: chmod 0644 cv/cvutl/check_nodeadd.pl
信息: chmod 0755 cv/remenv/exectask cv/remenv/orarun.sh cv/remenv/exectask.sh cv/remenv/runfixup.sh
信息: chmod 0755 bin/racgwrap.sbs bin/cluvfyrac.sh bin/lsnodes bin/crsdiag.pl bin/rawutl bin/osdbagrp bin/srvconfig
信息: chmod 0755 cv/remenv/exectask srvm/admin/getcrshome bin/osdbagrp crs/install/rootcrs.pl crs/install/roothas.pl crs/install/crsconfig_params.sbs crs/install/crsconfig_lib.pm crs/install/oracss.pm crs/install/oraacfs.pm crs/install/crsdelete.pm crs/install/crspatch.pm crs/install/hasdconfig.pl crs/install/s_crsconfig_lib.pm cv/remenv/exectask.sh srvm/admin/ractrans cv/cvdata/admin.dtd cv/cvdata/admin.xml cv/cvdata/constraints.dtd cv/cvdata/constraints.xml cv/cvdata/cvu_prereq.xml cv/cvdata/ora_software_cfg.xml cv/cvdata/pluggable.xml cv/cvdata/pluggable.xsd cv/cvdata/prereq.xsd crs/install/install.excl crs/install/installRemove.excl crs/install/s_crsconfig_defs cv/admin/cvu_config
...
....
进入数据库查询数据库的状态。
后续的参数调整根据个人实际情况进行修改。
调整日志组大小:
alter database add logfile group 4 '/db/oracle/oradata/newbusdb/redo04.log' size 1024M;
alter database add logfile group 5 '/db/oracle/oradata/newbusdb/redo05.log' size 1024M;
alter database add logfile group 6 '/db/oracle/oradata/newbusdb/redo06.log' size 1024M;
删除默认安装的redo:
切换日志组,待日志变为INACTIVE 状态之后删除:
SQL> alter system switch logfile;
System altered.
SQL> select GROUP#,BYTES/1024/1024 M,MEMBERS,ARCHIVED,STATUS from v$log;
GROUP# M MEMBERS ARC STATUS
---------- ---------- ---------- --- ----------------
3 50 1 NO INACTIVE
4 1024 1 NO INACTIVE
5 1024 1 NO INACTIVE
6 1024 1 NO CURRENT
删除group3:
alter database drop logfile group 3;
OK!