安装环境:CentOS 7(64位) 、 oracle11G 的压缩包
第一步:创建相关目录,并将安装包放在指定路径下
[[email protected] data]# pwd/data[[email protected] data]# lltotal 0drwxr-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 //压缩包目录
第二步:创建相关用户组和密码(密码提示过于简单之类的话请不用管它)
[[email protected] soft]# groupadd oinstall [[email protected] soft]# groupadd dba [[email protected] soft]# useradd -g oinstall -g dba -m oracle //用户既属于oinstall又属于dba [[email protected] 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/ [[email protected] soft]# chown -R oracle:oinstall database/ //将解压后的database目录也赋给oracle[[email protected] soft]# lltotal 2295592drwxr-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
第四步:修改标识
[[email protected] data]# vi /etc/redhat-release[[email protected] 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.servicesystemctl disable firewalld.service
第七步:修改selinux
vi /etc/selinux/config如下图所示,将selinux设置为disabled状态
第八步:修改 linux 内核
vi /etc/sysctl.conf添加以下内容:net.ipv4.icmp_echo_ignore_broadcasts = 1net.ipv4.conf.all.rp_filter = 1fs.file-max = 6815744fs.aio-max-nr = 1048576kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144 net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576配置生效:[[email protected] 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.sosession required pam_limits.so (3)编辑 /etc/profile ,vi /etc/profile添加:if [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536else ulimit -u 16384 -n 65536 fifi
第十步:修改配置文件
[[email protected] data]# su - oracle [[email protected] ~]$ export LANG=en_US //把语言环境改为英文vi /home/oracle/.bash_profile添加:export PATHexport ORACLE_BASE=/data/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2export ORACLE_SID=orclexport PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/usr/sbin:/usr/libexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATHexport 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
第十一步:
[[email protected] database]$ ./runInstaller
后面图形化部分由于图片太大,不一一列举,多数为next。(可见其他博客说明)
安装好后输入dbca,继续图形化界面安装。
第十二步:数据库的启动、关闭
---------启动监听服务-------------
# su – oracle
$ lsnrctl
LSNRCTL> status
LSNRCTL> start
LSNRCTL> exit
[[email protected] ~]$ export oracle_sid=orcl //实例名用之前图形界面设置的
---------启动------------
[[email protected] ~]$ sqlplus / as sysdba
SQL> startup
-------关闭--------------
# su – oracle
$ sqlplus / as sysdba
SQL> shutdown immediate
其他博客:https://www.cnblogs.com/muhehe/p/7816808.html
原文地址:https://www.cnblogs.com/caoyt/p/9714803.html
时间: 2024-10-19 14:10:28