您的位置:首页 > 数据库 > Oracle

Centos6.2安装oracle11R2

2012-07-26 13:54 267 查看
1. 方法

远程连接服务器
ftp上传两个安装文件
使用静默安装:直接执行runInstaller会启动窗口

2. 需要的安装包
yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat

3. 添加用户
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
passwd oracle

4. 修改内核参数:不一致会报错
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 = 1048586

生效:/sbin/sysctl -p

5. 修改用户资源限制
vi /etc/security/limits.conf

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

6. 建目录
mkdir -p /app/oracle11/oralce /app/oracle11/oraInventory /app/oracle11/oradata/
chown -R oracle:oinstall /app/oracle11/oracle /app/oracle11/oraInventory /app/oracle11/oradata/
chmod -R 775 /app/oracle11/oracle /app/oracle11/oraInventory /app/oracle11/oradata/

7. 设置用户bash环境
su - oracle
vi .bash_profile

export ORACLE_BASE=/app/oracle11/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=oracl
export ORACLE_OWNER=oracle
export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin

如果图形界面安装需要设置DISPLAY=:0.0
生效:source .bash_profile

8. 解压
unzip 两个文件

9. 创建oraInst.loc
vi /etc/oraInst.loc

inventory_loc=/app/oracle11/oraInventory
inst_group=oinstall

chown oracle:oinstall /etc/oraInst.loc
chmod 664 /etc/oraInst.loc

10. 修改静默文件
cp /app/database/response/db_install.rsp /app/database/response/oinstall.rsp
vi /home/database/response/oinstall.rsp

修改下面的配置
oracle.install.option=INSTALL_DB_AND_CONFIG
ORACLE_HOSTNAME=oracledb
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/app/oracle11/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/app/oracle11/11.2.0/
ORACLE_BASE=/app/oracle11/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=oinstall
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=oracle
oracle.install.db.config.starterdb.SID=oracl
oracle.install.db.config.starterdb.memoryLimit=512
oracle.install.db.config.starterdb.password.ALL=Oracle123 #这个必须有大写字母、小写字母、数字
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/app/oracle11/oradata/ora11g/ORA11G
DECLINE_SECURITY_UPDATES=true #这个必须有

11. oracle用户执行
/app/database/runInstaller -silent -responseFile /app/database/response/oinstall.rsp

12. root用户执行
/app/oracle11/oracle11.2.0/root.sh

注意:
1. 不用静默安装,必须使用图形界面
2. 中途出错可以查看/app/oracle11/oraInventory/logs,慢慢调试
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: