OUI的安装方式便捷、直观,但是有时候出于一些原因(PS:网络等原因),无法在服务器上使用OUI的方式,此时就只有用命令行来进行安装了。
1、配置内核参数(root用户)
vim /etc/sysctl.conf
kernel.shmmax = 784676864kernel.shmall = 153257kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 4194304net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576fs.aio-max-nr = 1048576fs.file-max = 6815744修改后使用sysctl -p使配置生效
2、配置资源限制(root用户)vim /etc/security/limits.conf
Oracle soft nPRoc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 102403、创建用户组和用户组(root用户)
groupadd oinstallgroupadd dbauseradd -m -g oinstall -G dba oracle设置oracle账户口令passwd oracle
4、创建目录以及授权(root用户)
mkdir -p /home/u01创建软连接绑定ln -s /home/u01 /u01创建对应目录结构
mkdir -p /u01/app/oracle指定用户组以及授权chown -R oracle:oinstall /u01/chmod -R 775 /u01/5、配置环境变量(oracle用户)su -oracle切换到oracle用户编辑.bash_profile配置环境变量
export ORACLE_BASE=/u01/appexport ORACLE_HOME=$ORACLE_BASE/oracleexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib:/usr/X11R6/libexport TNS_ADMIN=$ORACLE_HOME/network/adminexport ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/dataexport ORACLE_OWNER=oracleexport PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/usr/bin:/root/bin:$ORACLE_HOME/bin:$PATH编辑完后使用source .bash_profile命令使配置生效6、 配置响应文件
在解压后的oracle安装文件夹:database/response目录下有一个响应文件的配置模板,根据需要自行配置即可
下面是我的install.rsp配置文件,供参考:
#-------------------------------------------------------------------------------# Do not change the following system generated value. #-------------------------------------------------------------------------------oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.1.0#-------------------------------------------------------------------------------# Specify the installation option.# It can be one of the following:# - INSTALL_DB_SWONLY# - INSTALL_DB_AND_CONFIG# - UPGRADE_DB#-------------------------------------------------------------------------------oracle.install.option=INSTALL_DB_SWONLY#-------------------------------------------------------------------------------# Specify the hostname of the system as set during the install. It can be used# to force the installation to use an alternative hostname rather than using the# first hostname found on the system. (e.g., for systems with multiple hostnames # and network interfaces)#-------------------------------------------------------------------------------ORACLE_HOSTNAME=orc1#-------------------------------------------------------------------------------# Specify the Unix group to be set for the inventory directory. #-------------------------------------------------------------------------------UNIX_GROUP_NAME=dba#-------------------------------------------------------------------------------# Specify the location which holds the inventory files.# This is an optional parameter if installing on# Windows based Operating System.#-------------------------------------------------------------------------------INVENTORY_LOCATION=/u01/app/oraInventory#-------------------------------------------------------------------------------# Specify the languages in which the components will be installed. # # en : English ja : Japanese # fr : French ko : Korean # ar : Arabic es : Latin American Spanish # bn : Bengali lv : Latvian # pt_BR: Brazilian Portuguese lt : Lithuanian # bg : Bulgarian ms : Malay # fr_CA: Canadian French es_MX: Mexican Spanish # ca : Catalan no : Norwegian # hr : Croatian pl : Polish # cs : Czech pt : Portuguese # da : Danish ro : Romanian # nl : Dutch ru : Russian # ar_EG: Egyptian zh_CN: Simplified Chinese # en_GB: English (Great Britain) sk : Slovak # et : Estonian sl : Slovenian # fi : Finnish es_ES: Spanish # de : German sv : Swedish # el : Greek th : Thai # iw : Hebrew zh_TW: Traditional Chinese # hu : Hungarian tr : Turkish # is : Icelandic uk : Ukrainian # in : Indonesian vi : Vietnamese # it : Italian ## all_langs : All languages## Specify value as the following to select any of the languages.# Example : SELECTED_LANGUAGES=en,fr,ja## Specify value as the following to select all the languages.# Example : SELECTED_LANGUAGES=all_langs #-------------------------------------------------------------------------------SELECTED_LANGUAGES=en,zh_CN#-------------------------------------------------------------------------------# Specify the complete path of the Oracle Home. #-------------------------------------------------------------------------------ORACLE_HOME=/u01/app/oracle#-------------------------------------------------------------------------------# Specify the complete path of the Oracle Base. #-------------------------------------------------------------------------------ORACLE_BASE=/u01/app#-------------------------------------------------------------------------------# Specify the installation edition of the component. # # The value should contain only one of these choices. # - EE : Enterprise Edition #-------------------------------------------------------------------------------oracle.install.db.InstallEdition=EE################################################################################ ## PRIVILEGED OPERATING SYSTEM GROUPS ## ------------------------------------------ ## Provide values for the OS groups to which OSDBA and OSOPER privileges ## needs to be granted. If the install is being performed as a member of the ## group "dba", then that will be used unless specified otherwise below. ## ## The value to be specified for OSDBA and OSOPER group is only for UNIX based ## Operating System. ## #################################################################################------------------------------------------------------------------------------# The DBA_GROUP is the OS group which is to be granted OSDBA privileges.#-------------------------------------------------------------------------------oracle.install.db.DBA_GROUP=dba#------------------------------------------------------------------------------# The OPER_GROUP is the OS group which is to be granted OSOPER privileges.# The value to be specified for OSOPER group is optional.#------------------------------------------------------------------------------oracle.install.db.OPER_GROUP=dba#------------------------------------------------------------------------------# The BACKUPDBA_GROUP is the OS group which is to be granted OSBACKUPDBA privileges.#------------------------------------------------------------------------------oracle.install.db.BACKUPDBA_GROUP=dba#------------------------------------------------------------------------------# The DGDBA_GROUP is the OS group which is to be granted OSDGDBA privileges.#------------------------------------------------------------------------------oracle.install.db.DGDBA_GROUP=dba#------------------------------------------------------------------------------# The KMDBA_GROUP is the OS group which is to be granted OSKMDBA privileges.#------------------------------------------------------------------------------oracle.install.db.KMDBA_GROUP=dba#------------------------------------------------------------------------------# Specify whether user doesn't want to configure Security Updates.# The value for this variable should be true if you don't want to configure# Security Updates, false otherwise.## The value can be either true or false. If left blank it will be assumed# to be false.## Example : DECLINE_SECURITY_UPDATES=false#------------------------------------------------------------------------------DECLINE_SECURITY_UPDATES=true7、最后运行./runInstaller -silent -responsefile /home/oracle/db_install.rsp安装即可。[最后PS:(1)依赖包的检测本应该在一开始就检查的,但是我有一个坏毛病每次都是安装后看它提示缺什么包之后再去安装。
(2)各系统需要的package的传送门:http://docs.oracle.com/database/121/LTCQI/toc.htm#CHDJIDDD
(3)安装失败时候主要看看日志中先决条件测试那部分的日志,是否所有先决条件测试都success了]
新闻热点
疑难解答