修改主机名
[root@oracledb ~]# sed -i "s/HOSTNAME=localhost.localdomain/HOSTNAME=oracledb/" /etc/sysconfig/network
[root@oracledb ~]# hostname oracledb
添加主机名与IP对应记录
[root@oracledb ~]# vi /etc/hosts
192.168.1.160 oracledb
[root@oracledb ~]# ping oracledb
关闭Selinux
[root@oracledb ~]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
[root@oracledb ~]# setenforce 0
关闭防火墙
[root@oracledb ~]# chkconfig iptables off
[root@oracledb ~]# service iptables stop
安装依赖包
[root@oracledb ~]# yum -y install gcc gcc-c++ make binutilscompat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-commonglibc-devel libaio libaio-devel libgcclibstdc++ libstdc++-devel unixODBC unixODBC-devel
创建用户和组
[root@oracledb ~]# groupadd oinstall
[root@oracledb ~]# groupadd dba
[root@oracledb ~]# useradd -g oinstall -G dba oracle
[root@oracledb ~]# passwd oracle
修改内核参数
[root@oracledb ~]# vi /etc/sysctl.conf # 文件中末尾添加
net.ipv4.ip_local_port_range= 9000 65500
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576
[root@oracledb ~]# sysctl -p
[root@oracledb ~]# sysctl -a
[root@oracledb ~]# vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
[root@oracledb ~]# vi /etc/pam.d/login
session required pam_namespace.so #下面添加一条pam_limits.so
session required pam_limits.so
建目录改权限
[root@oracledb ~]# mkdir -p /u01
[root@oracledb ~]# chown -R oracle:oinstall /u01
[root@oracledb ~]# chmod -R 775 /u01
使所有用户都能访问图形桌面
[root@oracledb ~]# xhost +
设置oracle环境变量
[root@oracledb ~]# su - oracle #切换到oracle用户
[oracle@oracledb ~]$ vim ~/.bash_profile
export ORACLE_BASE=/u01/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/oracle/product/11.2.0/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$PATH:$HOME/bin:/u01/oracle/product/11.2.0/dbhome_1/bin
oracle@oracledb ~]$ source .bash_profile #立即生效
安装Oralce
1 解压orcale 到 root/Documents/123 目录
[oralce@oracledb 123]$ ./database/runInstaller
修改/etc/oratab 将N改为Y,允许dbstart 启动数据库
[root@oracledb /]# vim /etc/oratab
修改/etc/rc.local 自启动Oracle
[root@oracledb /]# vim /etc/rc.local
su - oracle -c 'lsnrctl start'su - oracle -c 'dbstart'su - oracle -c 'emctl start dbconsole'
原文链接:https://www.f2er.com/oracle/211525.html