Oracle11g安装步骤(CentOS7)
安装环境:CentOS 7(64位) 、 oracle11G 的压缩包
第一步:创建相关目录,并将安装包放在指定路径下
[root@localhost data]# pwd
/data
[root@localhost data]# ll
total 0
drwxr-xr-x. 2 root root 6 Sep 27 00:42 oracle //安装目录
drwxrwxr-x. 2 root root 6 Sep 27 00:25 oradata //配置文件
drwxrwxr-x. 2 root root 88 Sep 26 23:53 soft //压缩包目录
第二步:创建相关用户组和密码(密码提示过于简单之类的话请不用管它)
[root@localhost soft]# groupadd oinstall [root@localhost soft]# groupadd dba [root@localhost soft]# useradd -g oinstall -g dba -m oracle //用户既属于oinstall又属于dba [root@localhost soft]# passwd oracle Changing password for user oracle. New password: BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic Retype new password: passwd: all authentication tokens updated successfully.
第三步:赋值
chmod -R 775 /data/chown -R oracle.oinstall /data/oracle/
chown -R oracle:oinstall /data/soft/
chown -R oracle:oinstall /data/oradata/ chmod -R 775 /data/oracle/
[root@localhost soft]# chown -R oracle:oinstall database/ //将解压后的database目录也赋给oracle
[root@localhost soft]# ll
total 2295592
drwxr-xr-x. 8 oracle oinstall 128 Aug 20 2009 database
-rwxrwxr-x. 1 oracle oinstall 1239269270 Apr 23 2013 linux.x64_11gR2_database_1of2.zip
-rwxrwxr-x. 1 oracle oinstall 1111416131 Apr 23 2013 linux.x64_11gR2_database_2of2.zip
第四步:修改标识
[root@localhost data]# vi /etc/redhat-release
[root@localhost data]# cat /etc/redhat-release redhat-7
第五步:安装相关软件包
yum -y install binutils* compat-libcap1* compat-libstdc++* gcc* gcc-c++* glibc* glibc-devel* ksh* libaio* libaio-devel* libgcc* libstdc++* libstdc++-devel* libXi* libXtst* make* sysstat* elfutils* unixODBC*
第六步:防火墙问题
systemctl status firewalld.service
systemctl disable firewalld.service
第七步:修改selinux
vi /etc/selinux/config
如下图所示,将selinux设置为disabled状态
第八步:修改 linux 内核
vi /etc/sysctl.conf
添加以下内容:
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
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 = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
配置生效:[root@localhost data]# sysctl -p
第九步: 修改用户的 SHELL 的限制
(1)vi /etc/security/limits.conf
添加以下内容:
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
(2)修改/etc/pam.d/login 文件,vi /etc/pam.d/login
添加:
session required /lib64/security/pam_limits.so
session required pam_limits.so
(3)编辑 /etc/profile ,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
第十步:修改配置文件
[root@localhost data]# su - oracle [oracle@localhost ~]$ export LANG=en_US //把语言环境改为英文
vi /home/oracle/.bash_profile
添加:
export PATH
export ORACLE_BASE=/data/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/usr/sbin:/usr/lib
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
生效:source /home/oracle/.bash_profile
设置主机 hosts 文件,vi /etc/hosts
添加自己主机ip信息,例如:
192.168.113.133 localhost localhost.localdomain localhost4 localhost4.localdomain4
第十一步:
[oracle@localhost database]$ ./runInstaller
后面图形化部分由于图片太大,不一一列举,多数为next。(可见其他博客说明)
安装好后输入dbca,继续图形化界面安装。
第十二步:数据库的启动、关闭
---------启动监听服务-------------
# su – oracle
$ lsnrctl
LSNRCTL> status
LSNRCTL> start
LSNRCTL> exit
[oracle@redhat64 ~]$ export oracle_sid=orcl //实例名用之前图形界面设置的
---------启动------------
[oracle@redhat64 ~]$ sqlplus / as sysdba
SQL> startup
-------关闭--------------
# su – oracle
$ sqlplus / as sysdba
SQL> shutdown immediate
其他博客:https://www.cnblogs.com/muhehe/p/7816808.html