CentOS-6.5 安装Oracle11g详细步骤
发布日期:2021-04-30 21:01:11
浏览次数:132
分类:精选文章
本文共 2670 字,大约阅读时间需要 8 分钟。
1、环境准备
安装Oracle数据库前,需要确保服务器环境具备足够的资源和配置。以下是必须配置的内容:| 服务 | 版本 |
|---|---|
| Linux | CentOS release 6.5 (Final) |
| Oracle | linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip |
2、用户及安装环境设置
在安装前,需要配置用户权限和环境限制:2.1 切换用户
使用root用户执行以下命令切换身份:su root 2.2 创建组、用户、将用户加入组里
创建必要的组和用户:groupadd oinstall && groupadd dba && useradd -g oinstall -g dba -m oracle 2.3 设置密码
为oracle用户设置密码:passwd oracle 2.4 修改用户shell限制
编辑/etc/security/limits.conf文件,添加以下限制:vi /etc/security/limits.conf ## 添加如下内容 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 2.5 修改PAM配置
确保login文件中加载了pam_limits.so模块:vi /etc/pam.d/login ## 添加如下内容 session required /lib/security/pam_limits.so session required /lib/security/pam_limits.so 2.6 修改sysctl配置
为了提高系统性能,需修改sysctl.conf文件:vi /etc/sysctl.conf ## 添加如下内容 fs.file-max = 6815744 fs.aio-max-nr = 1048576 kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 2.7 修改/etc/profile
为oracle用户添加ulimit限制:vi /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 3、创建数据库软件目录和数据文件存放目录
创建必要的目录:mkdir -p /home/oracle/app/{oraclem,oracle/product} 4、修改目录属主
将目录权限设置为oracle用户所属的oinstall组:chown -R oracle:oinstall /home/oracle/app 5、配置oracle用户的环境变量
为oracle用户配置环境变量: # 切换到root用户 su - root # 切换到oracle用户 su - oracle # 编辑.bash_profile文件 vi ~/.bash_profile ## 添加如下内容 export ORACLE_BASE=/home/oracle/app export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1 export ORACLE_SID=orcl export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib 6、关闭防火墙
临时关闭防火墙:service iptables stop 永久关闭: chkconfig iptables off 关闭SELinux: vi /etc/selinux/config ## 修改为 SELINUX=disabled 重启系统: reboot 7、Oracle安装
以下是Oracle数据库的安装步骤:7.1 切换用户
su - oracle 7.2 创建临时目录
mkdir /home/oracle/tmp 7.3 上传安装包
将安装包上传至tmp目录:cd /home/oracle/tmp unzip linux.x64_11gR2_database_1of2.zip unzip linux.x64_11gR2_database_2of2.zip 7.4 开始安装
cd /home/oracle/tmp/database ./runInstaller 7.5 常见错误处理
如果遇到以下错误:Checking swap space: 109 MB available, 150 MB required. Failed Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed 解决方法:
安装Xmanager并配置显示服务器地址: 安装Xmanager(根据实际情况安装)
配置显示地址
vi ~/.bash_profile
添加如下内容
export DISPLAY=192.168.0.191:0.0
8、参考链接
[Oracle数据库安装指南](https://www.oracle.com/technologies/database/learnmore/index.html)发表评论
最新留言
留言是一种美德,欢迎回访!
[***.207.175.100]2026年06月21日 05时01分20秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!