RHEL7.2 build a database oracle11g

Copyright: Jiang Productions, All Rights Reserved. Https://blog.csdn.net/weixin_44953658/article/details/89917115

Compared everyone oracle database is already very familiar with it, here ado, directly on the configuration

This article is divided into two parts

First, the failure phenomenon may experience when you install the database and Solutions

1. installation interface garbled
Solution:

  • A temporary code may be used LANG = en_US ./runInstaller

  • Download a font package

2. Install when prompted
OUI-10182: The effective user ID does not match the owner of the file, or the process is not the super-user; the system indicates that super-user privilege is required.
The solution:

  • Cause: The installation directory does not have permission to lead
  • To give permission to the Oracle -R chown: oinstall / opt
    chmod -R 777 / opt

3. After the installation is complete If the file can not be found initorcl.ora
solution:

  • Copy to copy /opt/app/oracle/admin/orcltest/pfile/init.ora.330... initorcl should be in the directory, you can

4. When memory_max_target
solution:

  • Memory_target display does not support this system, you can restart the server

The most important
Redhat7 installed oracle, the default is to install the database software only, there is no database, you need to install the database dbca be created, will have a corresponding pile of catalogs, such as admin, etc., in order to find initorcl.ora

Second, the installation process

First configure yum warehouse
where we use the image file provided Ali

wget -O /etc/yum.repo.d/centos.repo http://mirrors.aliyun.com/repo/Centos-7.repo

sed -i 's/$releasever/7/g' /etc/yum.repo.d/centos.repo

yum clean all

First, the operating system,
red hat 7.2

oracle database version
11.2.0.4

The corresponding file
Oracle_11gR2_linux.x64_database_1of2.zip
Oracle_11gR2_linux.x64_database_2of2.zip

IP address planning:
the DNS Server: 192.168.81.2
IP address: 192.168.81.200

Second, the basic configuration

1, modify the host name:
vi / etc / hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.82.2   test

vi / etc / hostname configuration file

localhost.localdomain改为test

or

hostnamectl set-hostname <machine name>

2, dynamic IP modified as a static IP
CD / etc / sysconfig / Network-scripts /
BOOTPROTO = "static" to static #dhcp

3, modify the network card configuration:

#vim /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
DEVICE=ens32
ONBOOT=yes
IPADDR=192.168.81.200
NETMASK=255.255.255.0
GATEWAY=192.168.81.2
DNS1=192.168.81.2

If the card end configuration DNS, you can configure the resolv.conf file

#vim /etc/resolv.conf
nameserver 192.168.81.2

Restart the card:

systemctl restart network.service

4, directly off the firewall

systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

5, turn off selinux

#vim /etc/sysconfig/selinux
修改文件
SELINUX=disabled
临时关闭
#setenforce 0

Third, the software environment configuration
1, oracle necessary development tools

#yum -y install glibc \glibc-devel \
glibc-headers \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel \
pdksh \
compat-libcap1 \
compat-libstdc++-33 \
elfutils-libelf-devel \
gcc \
gcc-c++ \
smartmontools \
pdksh \
compat-libstdc \
cvuqdisk

If the swap space is not enough you can use the following command to increase:

dd if=/dev/zero of=/test bs=1G count=4
mkswap -f /test
swapon /test
free -m

2, modify the operating system kernel parameters

Perform the following steps in the Root User:

1) Modify limit SHELL user, modifying document /etc/security/limits.conf

Enter the command: vi /etc/security/limits.conf, press i to enter edit mode, the following is added to the file.

vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

2) modification of /etc/pam.d/login, enter the command: vi /etc/pam.d/login, press i to enter the edit mode, the following is added to the file .

vim /etc/pam.d/login
session  required      pam_limits.so

3) Modify the linux kernel, modify /etc/sysctl.conf file, enter the command: vi /etc/sysctl.conf, press i to enter the edit mode, will be added to the file following

#vim /etc/sysctl.conf  
fs.aio-max-nr = 1048576
fs.file-max = 6815744  
kernel.shmall = 1073741824  
kernel.shmmax = 4398046511104  
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 = 1048586

Note: sysctl.conf file has the following two parameters, remember to comment out
# kernel.shmmax # kernel.shmall

Take effect the sysctl

#sysctl -p

3, create the oracle user and group

#groupadd oinstall     //创建安装组
#groupadd dba           //创建管理组
#mkdir -p /opt/app
#useradd -g oinstall -G dba oracle      //创建运行用户(此处oracle使用默认家目录/home/oracle,所以没有用-d指家目录的)
#passwd oracle          //设置oracle用户的密码

Modify directory permissions:

#chown -R oracle:oinstall /opt/app
#chmod 755 -R /opt/app

Will be ready to install the package: p13390677_112040_Linux-x86-64_1of7-data1.zip p13390677_112040_Linux-x86-64_2of7-data2.zip put under the oracle user directory, it belongs to the owner and group oracle: oinstall, and unzip
Here Insert Picture Description

Fourth, the installation oracle 11.2.0.4 software

Switch to the oracle user (oracle user login system):
1) Configure the oracle user environment variables

[oracle@test ~]$ vim .bash_profile
 #.bash_profile
 #Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
#User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export ORACLE_SID=orcl
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH=/opt/app/oracle/product/11.2.0/dbhome_1/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export PATH=$ORACLE_HOME/bin:$PATH:/sbin/
LANG=zh_CN.UTF-8; export LANG NLS_LANG='AMERICAN_AMERICA.AL32UTF8'; export NLS_LANG
#LANG=en_US.utf8; export LANG NLS_LANG='AMERICAN_AMERICA.AL32UTF8'; export NLS_LANG

2) to start the installation

#su - oracle
$ export DISPLAY=ip:0.0 //ip为你本机ip
$ xhost +
$ export  LANG=zh_CN.UTF-8
$ unzip Oracle_11gR2_linux.x64_database_1of2.zip
$ unzip Oracle_11gR2_linux.x64_database_1of2.zip
$ cd database
$ ./runInstaller

If desired installation interface in Chinese:
a coding system to set UTF8 encoding, not oracle database, without setting 16GBK
#vi .bash_profile
the LANG =-zh_CN.UTF. 8; Export the LANG
the NLS_LANG = 'SIMPLIFIED Chinese_China.AL32UTF8'; Export NLS_LANG

Add Chinese Language Pack

#mkdir -p /usr/share/fonts/zh_CN/TrueType
将zysong.ttf文件放至/usr/share/fonts/zh_CN/TrueType目录中
chmod 777 usr/share/fonts/zh_CN/TrueType/zysong.ttf

In extracting database run the installation script, here and install grid like to start the installation wizard
Here Insert Picture Description
Here Insert Picture Description
to install only the database software here, click on the Next
Here Insert Picture Description
! [Insert Picture description here] ( https://img-blog.csdnimg.cn/20190507105607700.png? = Process-OSS-X image / Watermark, type_ZmFuZ3poZW5naGVpdGk, shadow_10, text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDk1MzY1OA ==, size_16, color_FFFFFF, t_70
! [inserted here described image] ( https://img-blog.csdnimg.cn/20190507105627927.png?x- oss-process = image / watermark,
type_ZmFuZ3poZW5naGVpdGk, shadow_10, text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDk1MzY1OA ==, size_16, color_FFFFFF, t_70 here to choose a cluster installation, has one of three options:
choose to install a single-instance database software, click Next
Here Insert Picture Description

Select product language, Simplified Chinese and English, click Next
Here Insert Picture Description

Select the database version, the default Enterprise Edition, click Next to
Here Insert Picture Description
configure the Oracle installation directory, due to the installation configuration environment variable before installation program automatically reads the configuration, automatically choosing the Oracle Base (Oracle Base) and software position (Software Location), As shown, click Next as shown
Here Insert Picture Description
above, the list of products catalog (Oracle inventory directory) also automatically select OK, click Next
Here Insert Picture Description
to keep the default, click Next

Here Insert Picture Description
Mounting inspection
Here Insert Picture Description
after testing points installed
Here Insert Picture Description
in the root user to perform two scripts that perform End Point OK
Here Insert Picture Description
installed
Here Insert Picture Description

V. Database Construction
1) Enter the following interface will pop up dbca command
Here Insert Picture Description
to create a library
Here Insert Picture Description
to select general purpose or transaction
Here Insert Picture Description
configured global database name and SID

Here Insert Picture Description
The Enterprise Manager Configuration check mark canceled
Here Insert Picture Description

Here Insert Picture Description
Here Insert Picture Description
Features four built-in super administrator password, a password is recommended unified, easy to remember with

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

Memory Allocation (Check the Use automatic memory management)
Here Insert Picture Description
specify the character set
Here Insert Picture Description
Here Insert Picture Description

Create a complete database point
Here Insert Picture Description
Here Insert Picture Description
had a long wait, when you see this screen, indicating oracle building a database to complete the
Here Insert Picture Description
six installation monitor
1) Enter the command netca will pop up the following interface. Create a listening service (acting as oracle server, allowing other clients to connect this oracle oracle server)

Here Insert Picture Description

Here Insert Picture Description

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
2) Configure local network service name (client acts as oracle, connect another oracle server)

Here Insert Picture Description
Here Insert Picture Description

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

carry out
Here Insert Picture Description

Finally, use the lsnrctl start listener to open

Such oracle server to configure the basic installation is complete, view the next oracle home directory has two files listener.ora and tnsnames.ora

Guess you like

Origin blog.csdn.net/weixin_44953658/article/details/89917115