The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Time:2020-3-31

Preface

Because it is installed on a personal virtual machine and can be connected to the public network, and what is actually used through VMware is your CD-ROM image, so the local Yum source can be installed directly using Yum without configuration.

Operating system installation

1、 Download and install VMware, prepare centos7 image ISO
There is not much to say about this. You can download it yourself on the Internet, and there are many cracked versions. Just choose one.
Note that if you choose to install some versions of VMware from ISO, the minimum installation will be triggered, so there is no way to open the graphical interface, so when installing, you choose to create a blank disk, as shown in the following figure:
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)
2、 Choose to open the graphical interface during installation
To give a connection, it is quite comprehensive:

https://blog.csdn.net/weixin_…

But the picture is wrong when he selects the graphical interface. The correct choice is as follows:
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)
3、 Partition
Disk partition is particularly important. The first time in this document, because the partition partition is too small, the operating system was reinstalled..
Here is mainly to reflect the purpose of your server planning, according to your needs to partition.
I plan to install a single instance oracle on this machine and open the archive.
ZABBIX may be integrated on this machine later.
So I’ve got 20 g’s for the root,/optDivided into 25 G
Alone/optNext, divide again/opt/ora_dataUsed to save data files,/opt_ora_archiveUsed to save archive logs.
After installationdf -hThe results are as follows:
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Operating system configuration

1、 Check dependency
Switch the root user and execute the following command:

yum install binutils-2.* compat-libstdc++-33* elfutils-libelf-0.* elfutils-libelf-devel-* gcc-4.* gcc-c++-4.* glibc-2.* glibc-common-2.* glibc-devel-2.* glibc-headers-2.* ksh-2* libaio-0.* libaio-devel-0.* libgcc-4.* libstdc++-4.* libstdc++-devel-4.* make-3.* sysstat-7.* unixODBC-2.* unixODBC-devel-2.* pdksh*

After the execution is successful, input again, and the return result is as follows:
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)
2、 Turn off firewall
Execute command:
systemctl stop firewalld.serviceTurn off the firewall
systemctl disable firewalld.serviceDo not use firewall (restart is also prohibited)

3、 Modify OS system ID
Oracle does not support the OS requirements of Oracle Database 11g release 2 on CentOS by default. Refer to:https://docs.oracle.com/cd/E11882_01/install.112/e47689/pre_install.htm#LADBI1106
Execute command:
vi /etc/redhat-release#Replace the contents with redhat-7 and save to exit.

4、 Turn off SELinux (restart takes effect)
Change the position of the red box in the picture todisabled
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

5、 Modify kernel parameters
vi /etc/sysctl.conf
Copy these in, as shown in the red box:

net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
fs.file-max = 6815744#Set the maximum number of open files
fs.aio-max-nr = 1048576
kernel.shmall = 2097152#Total amount of shared memory, 8g memory setting: 2097152 * 4K / 1024 / 1024
kernel.shmmax = 2147483648#Segment size of maximum shared memory
kernel.shmmni = 4096#Maximum number of shared memory terminals in the whole system
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500#Available IPv4 port ranges
net.core.rmem_default = 262144
net.core.rmem_max= 4194304
net.core.wmem_default= 262144
net.core.wmem_max= 1048576

The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

After executionsysctl -pMake configuration information effective

6、 Create system users and user groups running Oracle Database
groupadd oinstall
groupadd dba
useradd -g oinstall -g dba -m oracle
passwd oracle
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

7、 Create Oracle database installation directory
mkdir -p /opt/oracle#Oracle database installation directory
mkdir -p /opt/oraInventory#Oracle database profile directory
mkdir -p /opt/database#Oracle database software package decompression directory
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

chown -R oracle:oinstall /opt/oracle#Set Oracle users whose directory owner is the oinstall user group
chown -R oracle:oinstall /opt/oraInventory
chown -R oracle:oinstall /opt/database
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

8、 Set restrictions on Oracle users to improve software performance
vi /etc/security/limits.conf
Copy these in, as shown in the red box:

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)
9、 Configure environment variables for users
vi /home/oracle/.bash_profile
Copy these in and modify them according to your own directory, as shown in the red box:

export ORACLE_BASE=/opt/oracle#Oracle database installation directory
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1#Oracle database path
export ORACLE_SID=orcl#Oracle startup database instance name
export ORACLE_TERM=xterm#Xterm window mode installation
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH#Add system environment variable
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib#Add system environment variable
export LANG=C#Prevent random code during installation
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK#Set the Oracle client character set, which must be consistent with the character set set set during Oracle installation

The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Make the above configuration effective immediately:
source /home/oracle/.bash_profile

Database software installation

Preparation

1、 Install vsftpd service
When I set up the virtual machine, this service was not installed. Please install it with yum, or I will not be able to transfer the installation package
yum install vsftpd
service vsftpd start#Start vsftpd service
After that/etc/vsftpdLoweruser_listandftpusersIn the documentrootUser comments, you can use FTP tool to log in with root user.

afterrootExecute the following command (allow FTP to upload and generate files):

setsebool allow_ftpd_full_access 1
setsebool allow_ftpd_use_cifs 1
setsebool allow_ftpd_use_nfs 1
setsebool httpd_enable_ftp_server 1
setsebool tftp_anon_write 1

Executionservice vsftpd restartRestart vsftp service

2、 Upload Oracle installation package
Upload the following file to/usr/local/srcFolder, you can also put a place, but the directory to remember that the following commands are related to this.

p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7.zip

The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

3、 Unzip the installation package
Execute command:(/opt/databaseIs the directory of the Oracle database software package created before.)

unzip p13390677_112040_Linux-x86-64_1of7.zip -d /opt/database/
unzip p13390677_112040_Linux-x86-64_2of7.zip -d /opt/database/

After executionchown -R oracle:oinstall /opt/database/database/Authorization

4、 Graphical Oracle installation
su - oracle
cd /opt/database/database/

./runInstaller
A common error occurred:
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)
Here because we uselijianUsers log in to the system, but onlysureachoracle, we will cancel it withoracleUser login and try again
You can see that it is successful, and the Oracle environment variable we set before has also taken effect, and there is no Chinese confusion.
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

12 steps of database software installation

Step one:
Remove the tick and click Next directly to go to the next step
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The second step:
Select skip update.
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The third step:
We choose to install the database software instead of the default database
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The fourth step:
We choose single instance installation, because I set up this library for testing, single point is enough, and Rac is not needed
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The fifth step:
This is to set product language, not character set, remember!
The most intuitive difference between English and Chinese is the subsequent inputsqlplusThe language returned is independent of the character set.
We will choose English.
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The sixth step:
Default install enterprise
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The seventh step:
Determine the installation path of the data software. Here is the automatic reading of the value configured in the environment variable
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The eighth step:
DetermineorainventoryIt also automatically reads the environment variables
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The ninth step:
Theoretically to createDatabase Operation(OSOPER)Group:operBecause I used it for testing, directlyDBAIn the production environment, we still need to buildoper
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The tenth step:
Installation check. We have installed dependency packages in front of us. When installing the system, the memory is also given to 3G. This is the only onepdkshExceptions,pdkshVery old, yeskshJust click on the aboveignore allSkip directly.
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

There is a common mistake here. ClicknextAfter that, a vertical line will appear in the middle of the screen, which makes the whole process unable to go down, as shown in the figure:
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

On the Internet, it can be passed onjdkAnd thenrunInstallerIt can be solved by adding parameters later.

I have a simple method here, just press the direction key < – (left), and then enter. (in fact, it’s the analog selection button. Here’s a package that we ignored. Oracle will ask you if you confirm to ignore it. Just select Yes with the keyboard and enter. Although you can’t see it, the keyboard can still read ~)

Step 11:
Confirm the information and click Install:
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Step 12:
Enter the installation interface:
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

During the installation process, there will be three vertical lines. The first two times, press enter directly to let him continue. The corresponding button is continue. reach95%There will be a vertical line when you use it. Please pay attention to it. It’s for your userootUser to execute 2 scripts

The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Let’s click enter directly to prompt that the installation is completed
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

After that, we userootEnter into/opt/oraInventoryand/opt/oracle/product/11.2.0/db_1Execute these two scripts in the directory.

5 steps of database monitoring installation

oracleUser, command line inputnetcaAs shown in Fig.
Step one:
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The second step:
Select add a listener.
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The third step:
Give the monitor a name, we can use the default
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The fourth step:
Choose which protocol to use for listening. We use the defaultTCPAgreement
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The fifth step:
Select the open port for listening. We use the default1521Port can
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Then exit, executelsnrctl startTo start listening

Here is an error, as shown in the figure
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

This error is mostly caused by the inconsistency between the host name and the configuration file. Execute the following command:

vi /etc/sysconfig/network(addHOSTNAME=oraclevm
vi /etc/hosts(handle)oraclevmAdd to the end of the first line, preceded by a space)
hostname oraclevm

Restart the monitoring, and the start is successful
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

11 steps of database instance installation

oracleUser executiondbca, enter the graphical interface
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Step one:
Choose to create a database
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The second step:
Select create template, the first one by default
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The third step:
Create a global name and Sid, and we will name itorcl
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The fourth step:
Enable em by default
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The fifth step:
We choose the following, set a password, and use the password uniformly for the users above
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The sixth step:
Here, we can operate on the data file. We selected it when we built the system/opt/ora_dataSave path as data file.
If you want to useASMTo manage data files, select from the drop-down box aboveASMJust fine.
implementchown -R oracle:oinstall /opt/ora_data/Authorization
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The seventh step:
Set whether to open the flash back recovery area and archive or not. Here we select the previously set disk directory, which is divided into 10g and 5g.
implementchown -R oracle:oinstall /opt/ora_archive/Authorization
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The eighth step:
By default
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The ninth step:
Here you can set the memory size, connection number, character set, etc. of Oracle,Focus on the character set. Set the Chinese characters according to the picture without disorderly coding
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The tenth step:
Set it up hereredo logI changed the size to 3 groups, 1 group 1g
Here, we should pay attention to the following units of each groupM Bytes
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Step 11:
clickfinishYou can create a database instance
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Pop up some parameter information of creating database. You can check it.
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Start installation
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

The prompt after installation tells us the address of EM login
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Post installation verification

oracleUser, throughsqlplus / as sysdbaLand
Execute a SQL query statement and return the result normally.

select * from dual;

The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Log in EM management interface
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Create a user for Lijian and authorize:

create user lijian identified by lijian;
grant dba to lijian;  ---DBA
Grant create session to Lijian; -- login permission, which enables the user to be called by other programs, such as PLSQL
Grant unlimited tablespace to Lijian; -- permission to use tablespace
Grant create table, create view, create trigger, create sequence, create procedure, create type to Lijian; -- permission to create table, view, trigger, sequence, stored procedure, type.

The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Check whether the archive mode is turned on

As you can see, the database has turned on the archive mode
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

View archive log path and size

The path and size of the archive log are also set before
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Log in to RMAN to view the configuration information

The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Using PLSQL to access oracle on virtual machine

Configure thetnsname.orafile
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Log in to Oracle through PLSQL
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Test query
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

Create a new table, insert Chinese characters, and check whether there is disorder
The process of installing Oracle 11gr2 server (single instance) on personal virtual machine (centos7)

At this point, the whole process of configuration, installation and verification is over.

Recommended Today

PHP Basics – String Array Operations

In our daily work, we often need to deal with some strings or arrays. Today, we have time to sort them out String operation <?php //String truncation $str = ‘Hello World!’ Substr ($STR, 0,5); // return ‘hello’ //Chinese string truncation $STR = ‘Hello, Shenzhen’; $result = mb_ Substr ($STR, 0,2); // Hello //First occurrence of […]