In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
It is a troublesome thing to install Oracle database under Linux.
Because different installation packages may be selected during the installation of Linux, some software packages may be missing or more during the installation of Oracle, so it is difficult to install successfully at one time. Therefore, this paper records the installation process of Oracle on Linux in detail for reference.
This environment is only for software development and testing environment, and is not suitable for production environment.
The Linux distributions officially supported by Oracle are RedHat and Oracle Linux, so when we install Oracle (11gR2) under CentOS (7.4), we still need to do some special preparation.
CentOS 7.4 of this article is installed using the CentOS-7-x86_64-DVD-1708.iso file downloaded on the official website. Select Server with GUI and FTP Server during installation. The language is in English.
Select the installation package
For the convenience of daily use, execute the command systemctl set-default multi-user.target, let linux start, and go directly to the character interface.
The Oracle database of this article uses 11.2.0.4 (this version is suitable for Red Hat 7, and the free version downloaded from the official website does not apply to Red Hat 7).
Download address is attached, please use Xunlei to download.
Https://updates.oracle.com/Orion/Services/download/p13390677_112040_Linux-x86-64_1of7.zip?aru=16716375&patch_file=p13390677_112040_Linux-x86-64_1of7.ziphttps://updates.oracle.com/Orion/Services/download/p13390677_112040_Linux-x86-64_2of7.zip?aru=16716375&patch_file=p13390677_112040_Linux-x86-64_2of7.ziphttps://updates.oracle.com/Orion/Services/download/p13390677_112040_Linux-x86-64_3of7. Zip?aru=16716375&patch_file=p13390677_112040_Linux-x86-64_3of7.zip https://updates.oracle.com/Orion/Services/download/p13390677_112040_Linux-x86-64_4of7.zip?aru=16716375&patch_file=p13390677_112040_Linux-x86-64_4of7.ziphttps://updates.oracle.com/Orion/Services/download/p13390677_112040_Linux-x86-64_5of7.zip?aru=16716375&patch_file=p13390677_112040_Linux-x86-64_5of7.ziphttps://updates.oracle.com/ Orion/Services/download/p13390677_112040_Linux-x86-64_6of7.zip?aru=16716375&patch_file=p13390677_112040_Linux-x86-64_6of7.zip https://updates.oracle.com/Orion/Services/download/p13390677_112040_Linux-x86-64_7of7.zip?aru=16716375&patch_file=p13390677_112040_Linux-x86-64_7of7.zip
1. Turn off the firewall
As it is a development test environment, for convenience, turn off the firewall. However, in a formal production environment, do not do this.
First execute the command systemctl status firewalld.service to check the status of the firewall
Check the status of the firewall
Then, execute the command systemctl stop firewalld.service to turn off the firewall.
Of course, we can execute the command systemctl disable firewalld.service to disable the firewall.
Disable the firewall
two。 Close selinux
Selinux provides a lot of system security measures for Linux. In the demonstration system, turn it off for easy operation. It should be noted that in a formal production environment, do not do so.
Execute the command getenforce to check the status of selinux, and the initial installation of CentOS7 is open.
Execute the command vi / etc/selinux/config, edit the file, configure SELINUX=disabled, and close selinux.
3. Configure the Ali source for yum
During the installation of Oracle, you need to install some dependency packages. In order to speed up the installation, it is best to update the yum source to the domestic one, and the Ali yum source is the first one.
Execute the command cd / etc/yum.repos.d/, and then execute the command wget http://mirrors.aliyun.com/repo/Centos-7.repo to download the Ali yum source. Execute the command mv CentOS-Base.repo CentOS-Base.repo.bak to back up existing source information. Execute the command mv Centos-7.repo CentOS-Base.repo, using the Ali yum source downloaded in the previous step. Update the yum source by executing the commands yum clean all, yum makecache, and yum update.
4. (optional) generate a snapshot of the virtual machine
To be on the safe side, take a snapshot of the virtual machine, avoid subsequent installation errors, and install the operating system all over again.
5. Create a database directory
Create the installation directory for the Oracle database to / opt.
Execute the command mkdir-p / opt/oracle to create the oracle installation directory; execute the command mkdir-p / opt/oraInventory to create the oracle database configuration file directory; execute the command chown-R oracle:oinstall / opt/oracle to set oracle as the owner of the directory; execute the command chown-R oracle:oinstall / opt/oraInventory to set oracle as the owner of the directory.
6. Create users and user groups
Fixed users and user groups are required during Oracle installation.
Execute the command groupadd oinstall to create the oinstall user group; execute the command groupadd dba to create the dba user group; execute the command useradd-g oinstall-g dba-m oracle to create the oracle user; execute the command passwd oracle to set the password for the oracle user to 123456; execute the command id oracle to view the oracle user information you just created.
Create user groups and users
Execute the command vi / home/oracle/.bash_profile, add the following, and set the environment variable for the oracle user.
Export ORACLE_BASE=/opt/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_SID=orclexport ORACLE_TERM=xtermexport PATH=$ORACLE_HOME/bin:/usr/sbin:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/libexport LANG=Cexport NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
Execute the command source / home/oracle/.bash_profile to make the configuration take effect immediately.
7. Set restrictions on oracle users
In order to improve the performance of the software, it is necessary to set restrictions on oracle users.
Execute the command vi / etc/security/limits.conf and add the following:
Oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536
Verify that the latest version of PAM has been loaded, and if it does not exist, add the following to the / etc/pam.d/login file:
Session required pam_limits.so
Verify the current ulimits and enable it. This can be done in many ways, and it is recommended to add the following to / etc/profile:
If [$USER = "oracle"]; then if [$SHELL = "/ bin/ksh"]; then ulimit-u 16384 ulimit-n 65536 else ulimit-u 16384-n 65536 fi fi
8. Modify OS system identity
Oracle database supports installation on Red Hat and Oracle Linux, but does not support installation on CentOS, so you need to modify the OS system to be marked as Red Hat.
Execute the command vi / etc/redhat-release and modify the system ID as redhat-7.
9. Modify kernel parameters
Some parameters can be repaired automatically during Oracle installation (using root users to execute the repair script given by the Oracle installer), but some cannot be repaired automatically.
Execute the command vi / etc/sysctl.conf
The modified kernel parameters are as follows:
Kernel.shmall = 2097152kernel.sem = 32000 128fs.file-max = 6815744net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.wmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_max = 1048576kernel.shmmax = 2079272960kernel.shmmni = 4096fs.aio-max-nr = 1048576
Execute the command sysctl-p to make the modified kernel parameters take effect.
10. Install dependent software packages
Oracle11gR2 is installed on CentOS7.4, and the following 19 packages are missing. You need to execute the command yum install-y gcc libaio glibc.i686 compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf-devel glibc-devel glibc-headers gcc-c++ libaio-devel libaio-devel.i686 libgcc.i686 libstdc++ libstdc++.i686 unixODBC unixODBC.i686 unixODBC-devel unixODBC-devel.i686 ksh to install the 19 dependent packages you need.
For problems that pdksh can't find, you can install ksh. It is said that oracle uses the new ksh, but pdksh is also used in the check script
Missing dependency package
After installing the dependent package in the ssh terminal, check out the environment again and find that the following packages are missing. In fact, it is xxx (i386), because i686 is already used in CentOS7, just ignore it and continue to install it.
After installing the dependency package
11. Install Oracle
Start the graphical installation interface and follow the prompts to install. If the check fails, please choose to ignore it.
Enter the installation file directory of the Oracle database, such as / software/database, execute the command. / runInstaller, and start the Oracle database installer.
Start the installer
Follow the installation wizard tips, step by step to install, it should be noted that the use of Chinese generally choose ZHS16GBK, otherwise there will be garbled.
During installation
An error will occur at about 70% during installation
Error in invoking target 'agent nmhs' of makefile' / u01max oracleUniverse product 11.2.0Universe dbspur 1once sysmanActionsysmanAction.mk'
Solution: keep the installation process, open another terminal window, change the (MK_EMAGENT_NMECTL) in the ins_emagent.mk file to $(MK_EMAGENT_NMECTL)-lnnz11, and then click Retry during the installation process.
In vim, type / perform a lookup, and type I to switch to the insert state.
About 10 minutes later, the installation was successful.
Installation succeeded
12 start and shut down
Log in to the system with the oracle user, execute the command sqlplus / as sysdba, and connect to the database.
Start command: startup
Close command: shutdown
Start the listener and execute the lsnrctl start command from the linux command line (not from sqlplus).
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.