ORACLE 11GR2安装过程

首先使用ORACLE官方的,配置环境,自动生成ORACLE安装环境
http://yum.oracle.com/oracle-linux-7.html

2、接着要导入相关的KEY,以免不能安装RPM包
wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

3、下载
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
解压这二个包即可

4、配置环境

dd if=/dev/zero of=/mnt/swap bs=1M count=4096
mkswap /mnt/swap
swapon /mnt/swap
需要修改文件 /etc/fstab 中的 SWAP 行,添加
/mnt/swap swap swap defaults 0 0

设置主机名:
hostname ORACLE-M
echo "ORACLE-M" > /etc/hostname


以下为手动安装ORACLE所需所需的系统环境,上面为自动生成的系统环境,省事

yum install binutils.x86_64 \
compat-libcap1.x86_64 \
compat-libstdc++-33.i686 \
compat-libstdc++-33.x86_64 \
gcc.x86_64 \
gcc-c++.x86_64 \
glibc.i686 \
glibc.x86_64 \
glibc-devel.i686 \
glibc-devel.x86_64 \
libaio.x86_64 \
libaio.i686 \
libaio-devel.i686 \
libaio-devel.x86_64 \
libgcc.i686 \
libgcc.x86_64 \
libgcc.i686 \
libgcc.x86_64 \
libstdc++-devel.i686 \
libstdc++-devel.x86_64 \
libXi.i686 \
libXi.x86_64 \
libXtst.i686  \
libXtst.x86_64 \
make.x86_64 \
ksh sysstat \
unixODBC.x86_64 unixODBC-devel.x86_64 \
unixODBC.i686 unixODBC-devel.i686

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle

vi /etc/sysctl.conf 
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
生效命令:sysctl -p

更改配置:
/etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft stack 20480
* hard stack 20480

./runInstaller -silent -responseFile /home/oracle/db_install.rsp


等执行完了,还需要执行二个脚本:
/data/oracle/Inventory/orainstRoot.sh
/data/oracle/product/11.2.0/dbhome_1/root.sh


设置环境变量:
export ORACLE_BASE=/data/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib


更改监听:
vi /data/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
vi /data/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
更改为你的主机名,或主机IP

db_install.rsp静默安装文件

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_AND_CONFIG
ORACLE_HOSTNAME=ORACLE-R
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/data/oracle/Inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/opt/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.customComponents=
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=orcl
oracle.install.db.config.starterdb.SID=orcl
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryLimit=7500
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.installExampleSchemas=true
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=GKWN3Ep2dyS1uPbtU
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.dbcontrol.emailAddress=
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/data/oracle/oradata
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=