共计 4223 个字符,预计需要花费 11 分钟才能阅读完成。
Oracle 安装
相关版本说明
不同版本的 Oracle 需要安装在特定的系统版本之上。
如 Oracle 11gR2 的 11.2.0.1.0 需要安装在 CentOS 5.X 以及 RHLE 5.X
硬件要求
Physical Memory >= 1G
Swap Space >= 2G (available)
Temporary Space >= 400MB
依赖库的安装
yum -y install binutils compat-libstdc++ compat-libstdc++-33 elfutils-libelf-devel gcc gcc-c++ glibc-devel glibc-headers ksh libaio-devel libstdc++-devel make sysstat unixODBC-devel binutils-* compat-libstdc++* elfutils-libelf* glibc* gcc-* libaio* libgcc* libstdc++* make* sysstat* unixODBC*
rpm -e ksh
yum install pdksh
相关参数设置
vi /etc/sysctl.conf
# Oracle Configuration
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphors: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.core.rmem_default=262144
net.core.wmem_default=262144
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
# Oracle Configuration End
echo "1048576" >/proc/sys/fs/aio-max-nr
Oracle 用户
首先创建 Oracle 用户,在该用户下进行安装
创建步骤(需要具有 root 权限):
$/usr/sbin/groupadd oinstall
$/usr/sbin/groupadd dba
$useradd –g oinstall -G dba -d /home/oracle -r oracle
$mkdir -p /home/oracle
$chown oracle:dba /home/oracle
$passwd oracle
使用 id 命令查看用户信息 $id oracle
输出:uid=504(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
其中具体 id 数据可以不一样
Oracle 安装
注:Oracle 检查条件中:hard limit for maximum open file descriptors is set to at least 65536 可以忽略
后续根据安装步骤进行即可
listener.ora 配置
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /bank/oracle/oracle10g/product/10.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL DBNAME = orcl)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
命令行安装
初始化配置
配置 db_install.rsp 文件
安装
./runInstaller -responseFile /home/oracle/database/response/db_install.rsp -silent -showProgress
Q&A
- 问题:[FATAL] [INS-32037] The operating system group specified for central inventory (oraInventory) ownership is invalid.
解决:
设置具有写 oraInventory 权限的组UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/home/oracle/oraInventory
- 问题:[FATAL] [INS-35071] Global database name cannot be left blank.
解决:ORACLE_HOSTNAME=oracle1 - [FATAL] [INS-35071] Global database name cannot be left blank.
解决如:oracle.install.db.config.starterdb.globalDBName=oracle.sunyard
* 问题:[FATAL] [INS-35175] No value given for the allocated memory of the database
解决:oracle.install.db.config.starterdb.memoryLimit=512
[FATAL] [INS-30501] Automatic Storage Management software is not configured on this system.
配置 Oracle 存储方式 - 问题:[FATAL] [INS-30004] The ADMIN password entered is invalid.
解决:密码不能带 @ -
[FATAL] [INS-35341] User is not a member of the following chosen OS groups
解决:oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
-
问题:sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
解决:设置如下配置文件# .bash_profile if [-f ~/.bashrc ]; then . ~/.bashrc fi # for oracle i PATH=$PATH:$HOME/bin #oracle add export ORACLE_BASE=/home/oracle/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export ORACLE_SID=orcl export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
- 问题:ORA-xxxxx: Message xxx not found; no message file for product=RDBMS, facility=ORA
解决:没有正确设置 ORACLE_HOME 路径,如 app/oracle,需要设置为 /home/oracle/app/oracle -
问题:sqlplus: error while loading shared libraries: /home/oracle/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied
/etc/sysconfig/selinux 中改为 SELINUX=disabled chcon -t texrel_shlib_t $ORACLE_HOME/lib/*.so
参考:
Oracle 文档中的 Oracle RAC 先决条件部分:
http://docs.oracle.com/cd/B28359_01/nav/portal_6.htm
Oracle 版本以及对应安装系统:
http://docs.oracle.com/cd/E11882_01/relnotes.112/e23558/toc.htm#CHDHCEFI
CentOS 和 RedHat 发行版与 Linux 内核版本的对应关系:http://www.linuxidc.com/Linux/2016-07/133000.htm
部分操作参考:
http://www.linuxidc.com/Linux/2016-07/133001.htm
http://www.linuxidc.com/Linux/2016-07/133003.htm
http://www.tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap6sec72.html
Oracle 11g 在 RedHat Linux 5.8_x64 平台的安装手册 http://www.linuxidc.com/Linux/2014-07/104745.htm
Linux-6-64 下安装 Oracle 12C 笔记 http://www.linuxidc.com/Linux/2013-07/86805.htm
在 CentOS 6.4 下安装 Oracle 11gR2(x64) http://www.linuxidc.com/Linux/2014-02/97374.htm
Oracle 11gR2 在 VMWare 虚拟机中安装步骤 http://www.linuxidc.com/Linux/2013-09/89579p2.htm
Debian 下 安装 Oracle 11g XE R2 http://www.linuxidc.com/Linux/2014-03/98881.htm
更多 Oracle 相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-07/133004.htm