preface

I wrote an article called “full record of Oracle11g installed on CentOS7 in 2021”. Since I wrote it as I went along, it might seem confusing and redundant. So I decided to sort it out properly, hoping to help you in front of the computer, less detours. Stayed up intermittently for 3 days and finally managed to install Oracle 11g with 0 warning. Force witness Gospel!

Environmental information

Different environments may be slightly different, but it’s all the same. Here is the version information I used:

project version
The operating system CentOS Linux release 7.9.2009 (Core)
oracle Linux. X64_11g_11. 2.0.4

Oracle11g version selection: it is strongly recommended to download 11.2.0.4 version, oracle version is downloaded from the official website 11.2.0.1 there is a bit of a hole in it, I changed to 11.2.0.4 version after encountering a hole later.

CentOS7 install 11.2.0.1

  1. The operating system kernel parameter Semmni is set correctly, but the prerequisite check will indicate that the parameter is incorrect
  2. Some packages are already installed, and a prerequisite check will indicate that they are not installed
  3. Installation to 68% complains: makefile ‘/ home/oracle/app/oracle/product / 11.2.0 / dbhome_1 / CTX/lib/ins_ctx. Mk’ goal ‘install’ error

Pit 1,2 can be directly ignored, 3 there are solutions online. But it’s always a little uncomfortable. Fortunately, there are no more pits in 11.2.0.4.

11.2.0.4 is not available for ordinary users on the official website. If you can’t find it, you can send me a private message.

The preparatory work

When the troops and horses are not moved, food and grass should come first. Personally, installing Oracle on Linux is a bit of a hassle. In real work, I often help customers install Oracle remotely. In order to simulate the customer site environment, I installed the database on my REMOTE CentOS7 virtual machine on the computer.

Before installation, we need to do some simple preparatory work, roughly as follows:

  1. Create Oracle users and groups
  2. Graphical operating environment: VNC remote or directly local graphical operations.

I’m using OpenBox for my desktop because it’s short and compact! Did you not understand the article? Take a look at the video how it works! B station: www.bilibili.com/video/BV1Mh…

One-click install and configure VNC graphically related

Root run the following command to copy and paste the entire copy to the terminal (not line by line).

# graphical interface necessary 'X Window System'
yum -y groupinstall "X Window System"
Install ePEL source
yum -y install epel-release
Install VNC+ graphics required software
yum -y install tigervnc-server openbox xfce4-terminal tint2 cjkuni-ukai-fonts network-manager-applet
# automatically modify/etc/XDG openbox/autostart configuration file
echo 'if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then' > /etc/xdg/openbox/autostart
echo ' eval `dbus-launch --sh-syntax --exit-with-session`' >> /etc/xdg/openbox/autostart
echo 'fi' >> /etc/xdg/openbox/autostart
echo 'tint2 &' >> /etc/xdg/openbox/autostart
echo 'nm-applet &' >> /etc/xdg/openbox/autostart
echo 'xfce4-terminal &' >> /etc/xdg/openbox/autostart
echo ' ' >> /etc/xdg/openbox/autostart
Firewall allows VNC ports
firewall-cmd --add-port=5901/tcp
firewall-cmd --add-port=5901/tcp --permanent
Copy the code

Create a user

For security reasons, you are not advised to use root as the VNC user. It is safer to create a separate user. Since oracle is installed, I will use oracle for username.

Root run the following command to copy and paste the entire copy to the terminal (not line by line).

Create a database user group
groupadd database
Create an Oracle user and add it to the database group
useradd oracle -g database
Set the oracle password
passwd oracle 
Copy the code

The password I set is database@2021

Enabling the VNC Service

Switch to the Oracle user

su oracle
VNC /xstartup configuration files generated during the first run
vncserver :1 -geometry 1024x768
Copy the code

The password I set here is vnc@2021 oracle user run the following command, directly copy and paste the entire terminal (do not copy line by line).

Configure VNC to start OpenBox by default
echo "openbox-session &" > ~/.vnc/xstartup
# stop service
vncserver -kill: 1.Restart the VNC service
vncserver :1 -geometry 1024x768
Copy the code

The client connects to VNC for remote control

Use your VNC client to connect, but skip it if you can. I use: VNC Viewer click download my address is as follows:

172.16.184.5:5901
Copy the code

Then enter the connection password set above. The password I set here isvnc@2021

If you find that there is no interface, a black screen and only a mouse when you connect, then you can restart VNC service to try. Switch to the oracle user su oracle command:

vncserver -kill :1
vncserver :1 -geometry 1024x768

Copy the code

Isn’t it easy?

If you need more detailed tutorial, please see: “Centos7 to install and configure VNC server – openbox” blog.csdn.net/lxyoucan/ar…

Install the Oracle installer dependency package

Run the following command as user root: su root

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
Copy the code

Install Chinese fonts to solve Chinese garbled characters

By default, due to the lack of easy Song Typeface 18030 in CentOS, the Chinese version will be displayed as □□□□. Chinese is the most beautiful character in the world, it’s a pity that it can’t be displayed. It’s easy to add the font you need. Operation is as follows: download fonts: download.csdn.net/download/lx… Root Run the following command: create a folder

mkdir -p /usr/share/fonts/zh_CN/TrueType
Copy the code

TTF upload to /usr/share/fonts/zh_CN/TrueType

chmod 75 /usr/share/fonts/zh_CN/TrueType/zysong.ttf
Copy the code

Font installation complete, so that the installation of Oracle will not be Chinese garbled.

I like the English installation interface. What if I want to use the English interface? If you do not want to use the Chinese interface for installation, run the following command before installation to temporarily use the English environment.

LANG=en_US
Copy the code

Upload and decompress the installation package

Upload installation packages to the CentOS7 server. I uploaded it to the /home/oracle/ directory. After the upload, the file path and name are as follows:

[oracle@localhost ~]$ pwd
/home/oracle
[oracle@localhost ~]$ ls
p13390677_112040_Linux-x86-64_1of7.zip  p13390677_112040_Linux-x86-64_2of7.zip
Copy the code

You only need *1of7.zip and *2of7.zip.

If you do not have the unzip tool, install unzip for file unzip root to perform below

yum install unzip
Copy the code

Log in to VNC as the Oracle user and run the following command to decompress the installation package

Unzip the first zip
unzip p13390677_112040_Linux-x86-64_1of7.zip
Unzip the second zip
unzip p13390677_112040_Linux-x86-64_2of7.zip
Copy the code

Unzip the database and install it. The documents are as follows:

[oracle@localhost ~]$ ls
database  p13390677_112040_Linux-x86-64_1of7.zip  p13390677_112040_Linux-x86-64_2of7.zip
Copy the code

Preparatory work has been completed!


Install Oracle database

Now that the preparation is over, the installation is pretty much the same as installing Oracle on Windows. To sum up, basically you can follow the interface prompts along the way “next step (N)” can be completed. A little attention should be paid to:

  1. Desktop class and server class selection
  2. Setting the super administrator password
  3. Prerequisite check

The rest can be done according to your needs, or the “next step (N)” along the way. For some friends to see more intuitively, I took a screenshot of each step, you can jump to see.

The Oracle user logs in to the VNC remote desktop.

Go to the ~/database/ directory.

Go to the installation directory
cd ~/database/
Run setup
./runInstaller
Copy the code

Configuring security Updates

If you want to set it, I’m not going to set it here.

Download software Updates

It’s based on individual needs. I’m going to do it hereSkip software updates (S).

Network installation options

Select the”Create and configure a database (C)

Desktop class or server class

The description is very clear. Choose according to your needs. So I’m going to choose thetaServer Class (S).

Installation type

I’m going to go with the default,Single-instance database Installation (S)Select this parameter based on actual requirements.

Typical installation

The defaultTypical Installation (T)Can.

Typical Installation and Configuration

Mainly set the password, other default can be. The password must contain uppercase letters, lowercase letters, and digits. For example: I set it toDatabase123.

Create a product list

Default.

Perform prerequisite checks

This is going to take a little bit of time. Each person’s display may be slightly different. For example: physical memory detection, I this 1G memory will prompt less than expected. Treatment methods:

  • According to the prompt information to do processing, such as: small memory, increase the memory ah.
  • performRepair and recheck (F)It can be repaired automatically
  • Above all can’t solve, baidu you know. There is a solution for most of them.

My previous display is as follows:performRepair and recheck (F) The method is clearly described above. Root permission to execute:

/ TMP/CVU_11 2.0.4.0 _oracle/runfixup shCopy the code

When finished, click in the dialog box aboveConfirm (O)It turns out most of them are restored. As follows:The rest of the warning as far as possible to resolve, if you know the impact is not directly click on the upper right corner☐ Ignore allCan. For example, if my vm memory is 30MB less than the expected value, you can ignore it. The solution is also very simple, increase the memory. I’m ready to write the tutorial, just pursue perfection, I’ll increase the virtual machine memory a little bit.

Solution package: PDksh-5.2.14 Warning

This warning, I guess, should just be ignored. Because kSH-20120801-142.el7.x86_64 has been installed on this machine. Yum Search PDKSH search failed to find it. You have to install it manually.

Download the installation packageWget HTTP: / / http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpmCopy the code

Yum install wget yum install wget

The RPM - the ivh PDKSH - 5.2.14-37. El5_8. 1. X86_64. RPMCopy the code

The result is as follows: The installation fails because it conflicts with the one already installed.

RPM RPM -ivh pdksh-5.2.14-37.el5_8.1.x86_64. RPM Warning: pdksh-5.2.14-37.el5_8.1.x86_64. RPM Header V3 DSA/SHA1 Signature, key ID E8562897: NOKEY error: Dependency detection failure: PDKSH conflicts with (installed) KSH-20120801-142.el7.x86_64Copy the code

Uninstall the conflict

rpm -e ksh-20120801-142.el7.x86_64
Copy the code

The installation again

The RPM - the ivh PDKSH - 5.2.14-37. El5_8. 1. X86_64. RPMCopy the code

The whole process is as follows:

[root@localhost ~]# RPM - the ivh PDKSH - 5.2.14-37. El5_8. 1. X86_64. RPMWarning: pdksh-5.2.14-37.el5_8.1.x86_64. RPM: V3 DSA/SHA1 Signature, key ID E8562897: NOKEY error: dependency detection failed: PDKSH conflicts with (installed) kSH-20120801-142.el7.x86_64 [root@localhost ~]# rpm -e ksh-20120801-142.el7.x86_64
[root@localhost ~]# RPM - the ivh PDKSH - 5.2.14-37. El5_8. 1. X86_64. RPMWarning: pdksh-5.2.14-37.el5_8.1.x86_64. RPM: header V3 DSA/SHA1 Signature, key ID E8562897: NOKEY Preparing...# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [100%]Upgrading/installing... 1: PDKSH 5.2.14-37. El5_8. 1# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [100%]
Copy the code

Recheck and found the warning disappeared!!

Swap partition Settings

If there is no such item in the check, it can be ignored! I have encountered this problem before, but I don’t have it again when I write this article. The solution below is for reference.

If the Swap space does not meet the requirements, the Oracle installation file checks that the Swap space is insufficient. The size is generally set to 1.5 times of memory.

(root permission) Query the Swap partition Settings.

swapon -s
Copy the code

Or usefreeTools to view memory and Swap.

free -m
Copy the code

The result is in MB:

[root@localhost ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           1475         439         171          13         865         877
Swap:          2047           0        2047
Copy the code

Creating a Swap fileNext we will create a swap file on the file system. We will be havingThe root directory /Create a new one calledswapfileOf course, you can also choose your favorite file name. The space allocated by this file will be equal to the swap space we need. More than 1.5 times of general memory is good. You can also follow the installer’s instructions.

Root Run the following command to create a swap partition:

Bs =2300 is usually set to more than 1.5 times memory
dd if=/dev/zero of=/var/swap bs=2500 count=1000000
You need to change the permission of swap file to make sure that only root can read it
chmod 600 /var/swap
Tell the system to use this file for swap
mkswap /var/swap
# Start using this swap
swapon /var/swap
Make the Swap file permanent and add /etc/fstab to the configuration
echo "/var/swap swap swap sw 0 0" >> /etc/fstab
Copy the code

If the size creation error is found after the above creation. How do you reset it?

Swapoff -a rm /var/swap delete the file and create the appropriate swap file.

All warnings are gone

After our constant efforts, all the warnings disappeared. There are some warnings that don’t make any difference, but they are always uncomfortable. It’s so comfortable without ⚠️.

The profile

The summary of the installation configuration is shown here. Check to see if it is correct. Start installing if you have no problem!

Install the product

It’s been a long time since the actual installation started.

Progress 70% ins_emagent.mk error pop-up

It’s here, it’s here, I’ve been waiting for it.

Editor: / home/oracle/app/oracle/product / 11.2.0 / dbhome_1 / sysman/lib/ins_emagent. About 176 lines of mk, can search$(MK_EMAGENT_NMECTL)Keyword quickly found.Modified as follows:

# = = = = = = = = = = = = = = = = = = = = = = = = = = =
# emdctl
# = = = = = = = = = = = = = = = = = = = = = = = = = = =

$(SYSMANBIN)emdctl:
	$(MK_EMAGENT_NMECTL) -lnnz11

# = = = = = = = = = = = = = = = = = = = = = = = = = = =
# nmocat
# = = = = = = = = = = = = = = = = = = = = = = = = = = =
Copy the code

When the modification is complete, clickRetry (R)

Copying database files

After the above problems are resolved, the following interface will appear after a while of installation. Just be patient.

Database creation complete

After a period of waiting, the following page is displayed.

Executing the Configuration Script

As suggested above,root should execute the above two scripts. The results are as follows: [root @ localhost ~] # / home/oracle/app/oraInventory/orainstRoot sh change permissions/home/oracle/app/oraInventory. Add read and write permissions to the group. Deletes global read, write, and execute permissions.

More restructuring of/home/oracle/app/oraInventory to the database. Execution of the script is complete.

[root@localhost ~]# /home/oracle/app/oraInventory/orainstRoot.sh Change the permissions/home/oracle/app/oraInventory. Add read and write permissions to the group. Deletes global read, write, and execute permissions. More restructuring of/home/oracle/app/oraInventory to the database. Execution of the script is complete. [root@localhost ~]# / home/oracle/app/oracle/product / 11.2.0 / dbhome_1 / root. Sh
Performing root user operation for Oracle 11g 

The following environment variables are setAs: ORACLE_OWNER = oracle ORACLE_HOME = / home/oracle/app/oracle/product / 11.2.0 / dbhome_1 Enter the full pathname of thelocal bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@localhost ~]# 

Copy the code

To complete the two scripts, clickdetermine

The Oracle Database has been successfully installed

Through our efforts, we have finally come to this step. The Oracle Database has been successfully installed.Click on theShut downCan.

Firewall pass 1521

The default port is 1521

# firewall allows 1521oracle port
firewall-cmd --add-port=1521/tcp
firewall-cmd --add-port=1521/tcp --permanent
Copy the code

Configuring environment Variables

su oracle
Copy the code

Switch to oracle user operation. Editing a Configuration File

vi ~/.bash_profile
Copy the code

Add the following at the end of the file, ORACLE_HOME to your actual installation path

exportORACLE_HOME = / home/oracle/app/oracle/product / 11.2.0 dbhome_1 /export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
Copy the code

Using the configuration file takes effect immediately.

source ~/.bash_profile
Copy the code

Daily operations

Start the oracle

su oracle
sqlplus /nolog
SQL> connect /as sysdba
SQL> startup
Copy the code

Sys Login

[oracle@localhost ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Tue Feb 2 02:59:38 2021

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect as sysdba
Enter user-name: sys
Enter password: 
Connected.
SQL> select 1 from dual;

	 1
----------
	 1

SQL> 

Copy the code

If no problem is found, oracle connects to Oracle successfully.

Start listening

lsnrctl start
Copy the code

PLSQL connection test

Use another machine to connect to our newly installed Oracle for connection testing. Change the configuration file C:\app\itkey\product\11.2.0\client_1\network\admin\tnsnames.ora (the path depends on the actual situation)

CentOS7ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.184.5)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
Copy the code

conclusion

CentOS7 is not difficult to install Oracle 11g, encountered problems can be solved by Baidu. It’s just a bit of a hassle to install under Windows. Most of the minor problems encountered during the installation were caused by the age of Oracle 11g. I guess it might be easier to install a new version of Oracle on a new system. Maybe even as simple as Windows! Or would it be easier to install using Oracle’s own Linux system? I can test it later when I have time.

Reference documentation

The CentOS7 installation Oracle11g all records 2021 blog.csdn.net/lxyoucan/ar…

Adding Swap Space on CentOS 7 blog.csdn.net/zstack_org/…

Invoking target ‘install’ of makefile ‘../dbhome_1/ CTX /lib/ins_ctx.mk’… Blog.csdn.net/xch_yang/ar…

//usr/lib64/libstdc++. So. Undefined reference to ` memcpy@GLIBC_2.14 ‘> www.cnblogs.com/yhq1314/p/1…

The Linux/Centos install oracle error “call makefile ‘/ oracle/product / 11.2.0 / dbhome_1 / sysman/lib/ins_emagent. Mk target” solve” Blog.csdn.net/weixin_4107… “When install oracle 11 g R2 CenOS tip: PDKSH package is not installed” my.oschina.net/u/3318604/b…