首页 > 数据库 > Oracle > Linux下Oracle 11G静默安装
数据库:Oracle 11gR2 for Linux x86
操作系统:RHEL6.2
需要:Root用户
shell> grep MemTotal /proc/meminfo(至少1G) shell> grep SwapTotal /proc/meminfo shell> df -k /tmp (至少400M) shell> df -k (至少4G) shell> grep "model name" /proc/cpuinfo --查看处理器信息
shell> rpm -q binutils compat-libstdc++-33 elfutils elfutils-libelf-devel gcc gcc-c++ glibc \ glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-deve \ make sysstat unixODBC binutils-2.20.51.0.2-5.28.el6.i686 package compat-libstdc++-33 is not installed elfutils-0.152-1.el6.i686 package elfutils-libelf-devel is not installed gcc-4.4.6-3.el6.i686 gcc-c++-4.4.6-3.el6.i686 glibc-2.12-1.47.el6.i686 glibc-common-2.12-1.47.el6.i686 glibc-devel-2.12-1.47.el6.i686 glibc-headers-2.12-1.47.el6.i686 libaio-0.3.107-10.el6.i686 libaio-devel-0.3.107-10.el6.i686 libgcc-4.4.6-3.el6.i686 libstdc++-4.4.6-3.el6.i686 libstdc++-devel-4.4.6-3.el6.i686 make-3.81-19.el6.i686 sysstat-9.0.4-18.el6.i686 unixODBC-2.2.14-11.el6.i686 若未安装执行 shell> yum install binutils compat-libstdc++-33 elfutils elfutils-libelf-devel gcc \ gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc \ libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel
修改内核参数文件/etc/sysctl.conf
fs.aio-max-nr = 1048576 fs.file-max = 6815744 --文件句柄的最大数量 kernel.shmall = 268435456 --系统一次可以使用的共享内存总量(以页为单位) kernel.shmmax = 4294967295 --共享内存段的最大尺寸 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 修改完成后执行下列命令使修改内核参数生效生效: shell> /sbin/sysctl -p
修改参数文件/etc/security/limits.conf
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240
limits.conf的格式如下:
username|@groupname type resource limit
shell> groupadd oinstall shell> groupadd dba shell> useradd -g oinstall -G dba oracle shell> id oracle uid=500(oracle) gid=500(oinstall) 组=500(oinstall),501(dba) shell> passwd oracle 创建安装目录 shell> mkdir -p /db/oracle shell> chown -R oracle:oinstall /db/oracle shell> chmod -R 775 /db/oracle 设置oracle环境变量 shell> su -oracle shell> vi .bash_profile umask 022 ORACLE_BASE=/db/oracle; ORACLE_HOME=/db/oracle/product/11.2.0/db_1; ORACLE_SID=RAC1 PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH shell> source .bash_profile使设置生效
shell> su - root shell> vi /etc/oraInst.loc nventory_loc=/db/oracle/oraInventory inst_group=oinstall shell> chown oracle:oinstall /etc/oraInst.loc shell> chmod 664 /etc/oraInst.loc
shell> su -oracle shell> unzip linux.x64_11gR2_database_1of2.zip -d /tool shell> unzip linux.x64_11gR2_database_2of2.zip -d /tool shell> cp /tool/database/response/*.rsp . shell> chmod 700 *.rsp shell> vi db_install.rsp oracle.install.option=INSTALL_DB_SWONLY -- 安装类型 ORACLE_HOSTNAME=rac1 -- 主机名称 UNIX_GROUP_NAME=oinstall -- 安装组 INVENTORY_LOCATION=/db/oracle/oraInventory -- INVENTORY目录 SELECTED_LANGUAGES=en,zh_CN -- 选择语言 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=RAC1 -- globalDBName oracle.install.db.config.starterdb.SID=RAC1 -- SID oracle.install.db.config.starterdb.memoryLimit=512 -- 自动管理内存的最小内存(M) oracle.install.db.config.starterdb.password.ALL=oracle -- 设定所有数据库用户使用同一个密码 DECLINE_SECURITY_UPDATES=true -- 设置安全更新 必须设置为true,否会提示 email 地址没有设置不能安装 其他项目用默认值即可
shell> ./runInstaller -silent -force -responseFile /home/oracle/db_install.rsp
等待脚本执行完成,成功安装会出现下列信息:
可以在以下位置找到本次安装会话的日志:
/db/oracle/oraInventory/logs/installActions2014-11-16_06-50-04PM.log
以下配置脚本需要以 "root" 用户的身份执行。
#!/bin/sh
#要运行的 Root 脚本
/db/oracle/product/11.2.0/db_1/root.sh
要执行配置脚本, 请执行以下操作:
1. 打开一个终端窗口
2. 以 "root" 身份登录
3. 运行脚本
4. 返回此窗口并按 "Enter" 键继续
Successfully Setup Software.
以Root用户执行
shell> source /db/oracle/product/11.2.0/db_1/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /db/oracle/product/11.2.0/db_1
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
Svoid
2014-11-16
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29733787/viewspace-1399586/ ,如需转载,请注明出处,否则将追究法律责任。