重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
Oracle 12c下载地址: https://www.oracle.com/database/technologies/oracle-database-software-downloads.html
让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:域名注册、网站空间、营销软件、网站建设、旅顺口网站维护、网站推广。
1.检查先决条件
[root@k8s03 ~]# cat /proc/version
Linux version 3.10.0-693.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Tue Aug 22 21:09:27 UTC 2017
[root@k8s03 ~]# uname -r
3.10.0-693.el7.x86_64
[root@k8s03 ~]# free -m
total used free shared buff/cache available
Mem: 2831 419 1994 8 417 2214
Swap: 0 0 0
[root@k8s03 ~]# grep -i selinux= /etc/sysconfig/selinux
# SELINUX= can take one of these three values:
SELINUX=disabled
[root@k8s03 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@k8s03 ~]# ping baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=1 ttl=128 time=24.7 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=2 ttl=128 time=26.5 ms
^C
--- baidu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 24.725/25.624/26.524/0.913 ms
[root@k8s03 ~]#
2.安装依赖包
[root@k8s03 ~]# yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++
-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp xhost unzip zip libXtst libXp*.i686 libXt*.i686 xterm xdpyinfo smartmontools-* readline-devel*
[root@k8s03 ~]#
3.修改内核参数
[root@k8s03 ~]# vim /etc/sysctl.conf
kernel.shmall = 2097152
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 = 1048586
fs.file-max = 6815744
fs.aio-max-nr = 1048576
[root@k8s03 ~]# sysctl -p
[root@k8s03 ~]# 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
oracle hard stack 10240
[root@k8s03 ~]# vim /etc/pam.d/login
session required pam_limits.so
[root@k8s03 ~]#
4.创建用户和添加环境变量
[root@k8s03 ~]# groupadd oinstall
[root@k8s03 ~]# groupadd dba
[root@k8s03 ~]# useradd -g oinstall -G dba oracle
[root@k8s03 ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
[root@k8s03 ~]# mkdir /u01/app/oracle/product/11.2.0.1/db_1 -p
[root@k8s03 ~]# chown -R oracle:oinstall /u01/
[root@k8s03 ~]# vim /etc/profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.1/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
[root@k8s03 ~]# . /etc/profile
5.在windows机器安装Xmanager - Passive(图形化界面)
8.开机自启动
[root@k8s03 ~]$ vim /etc/oratab
orcl:/u01/app/oracle/product/11.2.0.1/db_1:Y --最后的N改写Y
[root@k8s03 ~]# chmod 755 /etc/rc.d/rc.local
[root@k8s03 ~]$ vim /etc/rc.d/rc.local
su oracle -lc “/u01/app/oracle/product/11.2.0.1/db_1/bin/lsnrctl start”
su oracle -lc /u01/app/oracle/product/11.2.0.1/db_1/bin/dbstart
[root@k8s03 ~]# reboot