Oracle Database 12C in CentOS7 the most complete installation (with whole can do!)

Oracle Database 12C in CentOS7 the most complete installation (with whole can do!)

Before installation you can download 12 Second Edition installation package from the Oracle official website

Here Insert Picture Description

The first step: we need to add a 20G hard drive to install Oracle, and format disk XFS

#进入服务器先关闭防火墙
systemctl stop firewalld.service 
systemctl disable firewalld.service 
setenforce 0

To format and partition:

cd /dev
fdisk /dev/sdb 
欢迎使用 fdisk (util-linux 2.23.2)。
更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。
Device does not contain a recognized partition table
使用磁盘标识符 0xc21d9b12 创建新的 DOS 磁盘标签。
命令(输入 m 获取帮助):n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
分区号 (1-4,默认 1):
起始 扇区 (2048-41943039,默认为 2048):
将使用默认值 2048
Last 扇区, +扇区 or +size{K,M,G} (2048-41943039,默认为41943039):
将使用默认值 41943039
分区 1 已设置为 Linux 类型,大小设为 20 GiB
命令(输入 m 获取帮助):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
正在同步磁盘。
mkfs -t xfs /dev/sdb1
mkdir /orc

vim /etc/hostname 
第二行添加:HOSTNAMME=oracle
vim /etc/hosts 
第三行添加:192.168.18.128 oracle(此处添加自己linux的IP地址)

hostnamectl set-hostname oracle
su
mount /dev/sdb1 /orc

Configure the system environment:

yum install binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel -y

Modify kernel parameters:

vim /etc/sysctl.conf
#在末行插入以下内容
fs.aio-max-nr = 1048576 #异步Io请求数目推荐值是: 1048576 其实它等于1024*1024 也就是1024K个
fs.file-max = 6815744   #打开的文件句柄的最大数量,防止文件描述符耗尽的问题
kernel.shmall = 2097152 #共享内存总量页为单位,内存除以4K所得
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
#SEMMSL: 每个信号集的最大信号数量SEMMNS:用于控制整个Linux 系统中信号的最大数SEMOPM内核参数用于控制每个semop系统调用可以执行的信号操作的数量SEMMNI:内核参数用于控制整个Linux 系统中信号集的最大数量
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 #套接字发送缓冲区大小的最大值
#修改完成后按Esc退出插入模式,输入:wq保存退出
sysctl -p       #生效

User environment configuration:

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle 
更改用户 oracle 的密码 。
新的密码:123123
无效的密码: 密码少于 8 个字符
重新输入新的 密码:123123
passwd:所有的身份验证令牌已经成功更新。

mkdir -p /orc/app/oracle
chown -R oracle:oinstall /orc/app/
chmod -R 755 /orc/app/oracle/
vim /home/oracle/.bash_profile 
10-12行删除,插入以下内容
umask 022
ORACLE_BASE=/orc/app/oracle
ORACLE_HOME=/orc/app/oracle/product/12.2.0/dbhome_1/
ORACLE_SID=orcl
MLS_LANG="SIMPLIFIED CHINESE_CHINA".UTF8
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin
LANG=zh_CN.UTF-8

export PATH LANG NLS_LANG ORACLE_BASE ORACLE_HOME ORACLE_SID

Allocation of resources limits:

vim /etc/pam.d/login
#第7行下插入
session required        /lib/security/pam_limits.so
session     required        pam_limits.so
#修改完成后按Esc退出插入模式,输入:wq保存退出

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       
#堆栈设置
#修改完成后按Esc退出插入模式,输入:wq保存退出

Changing the system environment variables:

vim /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

Sharing a database file in the host machine:

smbclient -L //192.168.10.190/
mkdir /abc
mount.cifs //192.168.10.190/database /abc

It should be noted here: first enter xhost + at the root account

Then switch to the user oracle, enter the following:

su - oracle 
export DISPLAY=:0.0
cd /abc
 ./runInstaller

At this time, the window will automatically open the installation, the installation steps described:

1. accept the security update to the hook, click Next, choose
2. Select system type: Service Class
3 is the default installation options: to create and configure a database, a single instance database
4. Installation type: Typical installation
The Typical installation configuration : password abc123, other paths do not need to make any changes, click the installation
6. during installation script prompt window will pop performed, the process is as follows: Here Insert Picture Description
7. at this point the need to root execute the following commands:
/ ORC / App / oraInventory / the orainstRoot.sh
/orc/app/oracle/product/12.2.0/dbhome_1/root.sh after hit enter, you need to enter yes This command
reminder: we have to wait is finished and then back to the installation screen and click OK!
8. Progress to 100% click Next, and this time it has been installed, it shows the URL address of the oracle:
the Oracle Enterprise Manager Database Express URL: HTTPS: // oracle: 5500 / EM

These are the Oracle database 12C of the entire installation process!

Guess you like

Origin blog.51cto.com/14464303/2458058