安装Oracle数据库大多喜欢图形安装,但是服务器的资源都是很珍贵的,很多时候我们不愿意在服务器上安装需要更多资源才能运行的图形界面,但又需要oracle数据库,此时就需要对数据库进行静默安装
数据库的静默安装需求和准备工作于图形安装相同,本篇主要讲解静默安装需要的三个配置文件:
db_install.rsp ###数据库安装配置文件
db_ca.rsp ###数据库实例创建配置文件
netca.rsp ###监听配置文件
安装依赖包:
#yum install binutils compat-libstdc++ elfutils-libelf elfutils-libelf-develelfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headerskernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-develmake sysstat unixODBC unixODBC-devel
# yum install libXp
需要安装libXp这个Library,这个一定要安装,否则安装Oracle时会出现java Exception
创建安装需要的用户:
#groupadd oinstall
#groupadd dba
#useradd �Cm �Cg oinstall �CG dba oracle
#passwd oracle
修改操作系统内核参数:
添加以下系统参数,并使之生效:
# vim /etc/sysctl.conf
kernel.shmall=2097152 //表示系统一次可以使用的共享内存总量(以页为单位)。缺省值就是2097152,通常不需要修改
kernel.shmmax =2147483648 //定义了共享内存段的最大尺寸(以字节为单位)。缺省为32M,对于oracle来说,该缺省值太低了,通常将其设置为2G
kernel.shmmni =4096 //用于设置系统范围内共享内存段的最大数量。该 参数的默认值是 4096 。通常不需要更改
kernel.sem = 250 32000 100128 //表示设置的信号量
net.ipv4.ip_local_port_range =1024 65000 //设定端口访问范围
net.core.rmem_default=4194304 //默认的接收窗口大小
net.core.rmem_max=4194304 //接收窗口的最大大小
net.core.wmem_default=262144 //默认的发送窗口大小
net.core.wmem_max=262144 //发送窗口的最大大小
#sysctl -p
修改系统安全文件:
#vim /etc/security/limits.conf //针对单个回话的认证模块配置文件
加入以下四行
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
修改登录认证文件:
#vi /etc/pam.d/login
session required/lib/security/pam_limits.so
session required pam_limits.so
修改系统环境变量:
# vim /etc/profile
if[ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
修改操作系统版本信息使得Oracle支持:
由于Oracle 10g发行的时候,CentOS 6没有发行,所以Oracle 10g并没有对CentOS 6确认支
持,需要修改文件让Oracle 10g支持CentOS 6,
我们需要手工修改Linux的发行注记,让Oracle 10g支持CentOS 6
# vi /etc/redhat-release
将其中的内容CentOS release6.3 (Final)修改为redhat 4
# CentOS release 6.4 (Final)
redhat 4
创建ORACLE数据目录:
# mkdir /opt/oracle
# mkdir /opt/oracle/102
# chown �CR oracle.dba/opt/oracle
修改主机文件:
# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
10.0.0.52 diserver.szgov diserver
切换到oracle用户并修改环境变量:
# su �C oracle
$ vi .bash_profile
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/102
ORACLE_SID=orcl
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
export ORACLE_BASEORACLE_HOME ORACLE_SID LD_LIBARAY_PATH PATH
$ source .bash_profile
当准备工作完全做好之后,开始配置db_install.rsp文件
$ vi /u01/database/response/db_install.rsp
####################################################################
## Copyright(c) Oracle Corporation1998,2008. Allrights reserved. ##
## Specify values for the variables listedbelow tocustomize your installation. ##
## Each variable is associated with acomment. Thecomment ##
## can help to populate the variables withtheappropriate values. ##
## IMPORTANT NOTE: This file contains plaintextpasswords and ##
## should be secured to have readpermission only byoracleuser ##
## or db administrator who ownsthisinstallation. ##
##对整个文件的说明,该文件包含参数说明,静默文件中密码信息的保密 ##
####################################################################
# Do not change the following systemgeneratedvalue. 标注响应文件版本,这个版本必须和要#安装的数据库版本相同,安装检验无法通过,不能更改
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
# Specify the installation option.
# It can be one of the following:
# 1. INSTALL_DB_SWONLY
# 2. INSTALL_DB_AND_CONFIG
# 3. UPGRADE_DB
#选择安装类型:1.只装数据库软件 2.安装数据库软件并建库 3.升级数据库
oracle.install.option=INSTALL_DB_SWONLY
# Specify the hostname of the system as setduring theinstall. It can be used
# to force the installation to use analternativehostname rather than using the
# first hostname found on the system.(e.g., for systemswith multiple hostnames
# and network interfaces)指定操作系统主机名,通过hostname命令获得
ORACLE_HOSTNAME=ora11gr2
# Specify the Unix group to be set for theinventorydirectory.
#指定oracle inventory目录的所有者,通常会是oinstall或者dba
UNIX_GROUP_NAME=oinstall
# Specify the location which holds theinventory files.
#指定产品清单oracle inventory目录的路径,如果是Win平台下可以省略
INVENTORY_LOCATION=/u01/oracle/oraInventory
# Specify the languages in which thecomponents will beinstalled.
# en :English ja :Japanese
# fr :French ko :Korean
# ar :Arabic es :Latin American Spanish
# bn :Bengali lv :Latvian
# pt_BR: BrazilianPortuguese lt : Lithuanian
# bg :Bulgarian ms :Malay
# fr_CA: CanadianFrench es_MX: MexicanSpanish
# 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:TraditionalChinese
# hu :Hungarian tr :Turkish
# is : Icelandic uk :Ukrainian
# in :Indonesian vi :Vietnamese
# it :Italian
# Example : SELECTED_LANGUAGES=en,fr,ja
#指定数据库语言,可以选择多个,用逗号隔开。选择en, zh_CN(英文和简体中文)
SELECTED_LANGUAGES=en,zh_CN
# Specify the complete path of the OracleHome.设置ORALCE_HOME的路径
ORACLE_HOME=/u01/oracle/product/11.2.0/db_1
# Specify the complete path of the OracleBase. 设置ORALCE_BASE的路径
ORACLE_BASE=/u01/oracle
# Specify the installation edition ofthecomponent.
# The value should contain only one ofthesechoices.
# EE :EnterpriseEdition
# SE : StandardEdition
# SEONE Standard Edition One
# PE : Personal Edition(WINDOWS ONLY)
#选择Oracle安装数据库软件的版本(企业版,标准版,标准版1),不同的版本功能不同
#详细的版本区别参考附录D
oracle.install.db.InstallEdition=EE
# This variable is used to enable ordisable custominstall.
# true : Components mentioned as part of'customComponents' property
#are considered for install.
# false : Value for 'customComponents' isnotconsidered.
#是否自定义Oracle的组件,如果选择false,则会使用默认的组件
#如果选择true否则需要自己在下面一条参数将要安装的组件一一列出。
#安装相应版权后会安装所有的组件,后期如果缺乏某个组件,再次安装会非常的麻烦。
oracle.install.db.isCustomInstall=true
# This variable is considered only if'IsCustomInstall'is set to true.
# Description: List of Enterprise EditionOptions youwould like to install.
# Thefollowing choices areavailable. You may specify any
# combinationof thesechoices. The components you chooseshould
# bespecified in the form"internal-component-name:version"
# Belowis a list of components youmay specify to install.
# oracle.rdbms.partitioning:11.2.0.1.0-Oracle Partitioning
# oracle.rdbms.dm:11.2.0.1.0-Oracle Data Mining
# oracle.rdbms.dv:11.2.0.1.0-Oracle Database Vault
# oracle.rdbms.lbac:11.2.0.1.0-Oracle Label Security
# oracle.rdbms.rat:11.2.0.1.0-Oracle Real Application Testing
# oracle.oraolap:11.2.0.1.0-Oracle OLAP
# oracle.install.db.isCustomInstall=true的话必须手工选择需要安装组件的话
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
###############################################################################
# PRIVILEGED OPERATING SYSTEMGROUPS
# Provide values for the OS groups to whichOSDBA andOSOPER privileges #
# needs to be granted. If the install isbeingperformed as a member ofthe #
# group "dba", then that will beused unlessspecified otherwisebelow. #
#指定拥有OSDBA、OSOPER权限的用户组,通常会是dba组
###############################################################################
# The DBA_GROUP is the OS group which is tobe grantedOSDBA privileges.
oracle.install.db.DBA_GROUP=dba
# The OPER_GROUP is the OS group which isto be grantedOSOPER privileges.
oracle.install.db.OPER_GROUP=oinstall
# Specify the cluster node names selectedduring theinstallation.
#如果是RAC的安装,在这里指定所有的节点
oracle.install.db.CLUSTER_NODES=
# Specify the type of database to create.
# It can be one of the following:
# -GENERAL_PURPOSE/TRANSACTION_PROCESSING
# -DATA_WAREHOUSE
#选择数据库的用途,一般用途/事物处理,数据仓库
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
# Specify the Starter Database GlobalDatabaseName. 指定GlobalName
oracle.install.db.config.starterdb.globalDBName=orcl
# Specify the Starter Database SID.指定SID
oracle.install.db.config.starterdb.SID=orcl
# Specify the Starter Database characterset.
# It can be one of the following:
# AL32UTF8, WE8ISO8859P15, WE8MSWIN1252,EE8ISO8859P2,
# EE8MSWIN1250, NE8ISO8859P10,NEE8ISO8859P4,BLT8MSWIN1257,
# BLT8ISO8859P13, CL8ISO8859P5,CL8MSWIN1251,AR8ISO8859P6,
# AR8MSWIN1256, EL8ISO8859P7,EL8MSWIN1253,IW8ISO8859P8,
# IW8MSWIN1255, JA16EUC, JA16EUCTILDE,JA16SJIS,JA16SJISTILDE,
# KO16MSWIN949, ZHS16GBK, TH8TISASCII,ZHT32EUC,ZHT16MSWIN950,
# ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254,VN8MSWIN1258
#选择字符集。不正确的字符集会给数据显示和存储带来麻烦无数。
#通常中文选择的有ZHS16GBK简体中文库,建议选择unicode的AL32UTF8国际字符集
oracle.install.db.config.starterdb.characterSet=AL32UTF8
# This variable should be set to true ifAutomaticMemory Management
# in Database is desired.
# If Automatic Memory Management is notdesired, andmemory allocation
# is to be done manually, then set it tofalse.
#11g的新特性自动内存管理,也就是SGA_TARGET和PAG_AGGREGATE_TARGET都#不用设置了,Oracle会自动调配两部分大小。
oracle.install.db.config.starterdb.memoryOption=true
# Specify the total memory allocation forthe database.Value(in MB) should be
# at least 256 MB, and should not exceedthe totalphysical memory available on the system.
#Example:oracle.install.db.config.starterdb.memoryLimit=512
#指定Oracle自动管理内存的大小,最小是256MB
oracle.install.db.config.starterdb.memoryLimit=
# This variable controls whether to loadExampleSchemas onto the starter
# database or not.是否载入模板示例
oracle.install.db.config.starterdb.installExampleSchemas=false
# This variable includes enabling auditsettings,configuring password profiles
# and revoking some grants to public. Thesesettingsare provided by default.
# These settings may also bedisabled. 是否启用安全设置
oracle.install.db.config.starterdb.enableSecuritySettings=true
###############################################################################
# Passwords can be supplied for thefollowing fourschemas in the #
# starterdatabase: #
# SYS #
# SYSTEM #
# SYSMAN (used by EnterpriseManager) #
# DBSNMP (used by EnterpriseManager) #
# Same password can be used for allaccounts (notrecommended) #
# or different passwords for each accountcan beprovided (recommended) #
#设置数据库用户密码
###############################################################################
# This variable holds the password that isto be usedfor all schemas in the
# starter database.
#设定所有数据库用户使用同一个密码,其它数据库用户就不用单独设置了。
oracle.install.db.config.starterdb.password.ALL=oracle
# Specify the SYS password for the starterdatabase.
oracle.install.db.config.starterdb.password.SYS=
# Specify the SYSTEM password for thestarter database.
oracle.install.db.config.starterdb.password.SYSTEM=
# Specify the SYSMAN password for thestarter database.
oracle.install.db.config.starterdb.password.SYSMAN=
# Specify the DBSNMP password for thestarter database.
oracle.install.db.config.starterdb.password.DBSNMP=
# Specify the management option to beselected for thestarter database.
# It can be one of the following:
# 1. GRID_CONTROL
# 2. DB_CONTROL
#数据库本地管理工具DB_CONTROL,远程集中管理工具GRID_CONTROL
oracle.install.db.config.starterdb.control=DB_CONTROL
# Specify the Management Service to use ifGrid Controlis selected to manage
# the database. GRID_CONTROL需要设定grid control的远程路径URL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
# This variable indicates whether toreceive emailnotification for critical
# alerts when using DB control.是否启用Email通知, 启用后会将告警等信息发送到指定邮箱
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
# Specify the email address to which thenotificationsare to be sent.设置通知EMAIL地址
oracle.install.db.config.starterdb.dbcontrol.emailAddress=
# Specify the SMTP server used for emailnotifications.设置EMAIL邮件服务器
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
###############################################################################
# SPECIFY BACKUP AND RECOVERYOPTIONS #
# Out-of-box backup and recovery optionsfor thedatabase can bementioned #
# using the entriesbelow. #
#安全及恢复设置(默认值即可)out-of-box(out-of-box experience)缩写为OOBE
#产品给用产品给用户良好第一印象和使用感受
###############################################################################
# This variable is to be set to false ifautomatedbackup is not required. Else
# this can be set to true.设置自动备份,和OUI里的自动备份一样。
oracle.install.db.config.starterdb.automatedBackup.enable=false
# Regardless of the type of storage that ischosen forbackup and recovery, if
# automated backups are enabled, a job willbescheduled to run daily at
# 2:00 AM to backup the database. This jobwill run asthe operating system
# user that is specified in this variable.自动备份会启动一个job,指定启动JOB的系统用户ID
oracle.install.db.config.starterdb.automatedBackup.osuid=
# Regardless of the type of storage that ischosen forbackup and recovery, if
# automated backups are enabled, a job willbescheduled to run daily at
# 2:00 AM to backup the database. This jobwill run asthe operating system user
# specified by the above entry. Thefollowing entrystores the password for the
# above operating system user.自动备份会开启一个job,需要指定OSUser的密码
oracle.install.db.config.starterdb.automatedBackup.ospwd=
# Specify the type of storage to use forthe database.
# It can be one of the following:
# - FILE_SYSTEM_STORAGE
# - ASM_STORAGE
#自动备份,要求指定使用的文件系统存放数据库文件还是ASM
oracle.install.db.config.starterdb.storageType=
# Specify the database file location whichis adirectory for datafiles, control
# files, redologs.
# Applicable only whenoracle.install.db.config.starterdb.storage=FILE_SYSTEM
#使用文件系统存放数据库文件才需要指定数据文件、控制文件、Redo log的存放目录
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
# Specify the backup and recovery location.
# Applicable onlywhenoracle.install.db.config.starterdb.storage=FILE_SYSTEM
#使用文件系统存放数据库文件才需要指定备份恢复目录
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
# Specify the existing ASM disk groups tobe used forstorage.
# Applicable onlywhenoracle.install.db.config.starterdb.storage=ASM
#使用ASM存放数据库文件才需要指定存放的磁盘组oracle.install.db.config.asm.diskGroup=
# Specify the password for ASMSNMP user ofthe ASMinstance.
# Applicable onlywhenoracle.install.db.config.starterdb.storage=ASM_SYSTEM
#使用ASM存放数据库文件才需要指定ASM实例密码
oracle.install.db.config.asm.ASMSNMPPassword=
# Specify the My Oracle Support AccountUsername.
# Example :MYORACLESUPPORT_USERNAME=metalink
#指定metalink账户用户名
MYORACLESUPPORT_USERNAME=
# Specify the My Oracle Support AccountUsernamepassword.
# Example :MYORACLESUPPORT_PASSWORD=password
# 指定metalink账户密码
MYORACLESUPPORT_PASSWORD=
# Specify whether to enable the user to setthepassword for
# My Oracle Support credentials. The valuecan beeither true or false.
# If left blank it will be assumed to befalse.
# Example :SECURITY_UPDATES_VIA_MYORACLESUPPORT=true
# 用户是否可以设置metalink密码
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
# Specify whether user wants to give anyproxy detailsfor connection.
# The value can be either true or false. Ifleft blankit will be assumed to be false.
# Example :DECLINE_SECURITY_UPDATES=false
# False表示不需要设置安全更新,注意,在11.2的静默安装中疑似有一个BUG
# Response File中必须指定为true,否则会提示错误,不管是否正确填写了邮件地址
DECLINE_SECURITY_UPDATES=true
# Specify the Proxy server name. Lengthshould begreater than zero.
#代理服务器名
# Example :PROXY_HOST=proxy.domain.com
PROXY_HOST=
# Specify the proxy port number. Should beNumeric andatleast 2 chars.
#代理服务器端口
# Example : PROXY_PORT=25
PROXY_PORT=
# Specify the proxy user name. LeavePROXY_USER andPROXY_PWD
# blank if your proxy server requiresnoauthentication.
#代理服务器用户名
# Example : PROXY_USER=username
PROXY_USER=
# Specify the proxy password. LeavePROXY_USER andPROXY_PWD
# blank if your proxy server requiresnoauthentication.
#代理服务器密码
# Example : PROXY_PWD=password
PROXY_PWD=
连接“二”