当前位置:网站首页>Linux centos7 installation Oracle11g super perfect novice tutorial
Linux centos7 installation Oracle11g super perfect novice tutorial
2022-07-01 23:58:00 【1024 questions】
1 Introduction to the basic environment
2 Check if... Is installed Oracle
3 uninstall Oracle
3.1 Make virtual machine again
3.2 uninstall Oracle
4 Installation preparation
4.1 establish oracle Users and user groups
4.2 by Oracle Create relevant directories for the installation of
4.3 Optimize OS Kernel parameters
4.4 Limit oracle User shell jurisdiction
4.5 by Oracle Users add Oracle environment variable
4.6 To configure hostname( This machine IP mapping )
4.7 install VNC&Oracle Related dependencies
4.7.1 To configure yum Source
4.7.2 Installation dependency
4.7.4 If the installation fails, install the dependency separately
4.7.5 Install language pack
4.8 Open ports / Turn off firewall
4.8.1 Open ports
4.8.2 Turn off firewall
4.9 Upload Oracle The installation files
4.10 install
4.10.1 To add or modify oracle Environment variables of
4.10.2 Configure listener
5 Create database
5.1 Delete the instance
5.2 land Oracle
summary
1 Introduction to the basic environmentLinux We use it by default CentOS 7 x64
So in order to correspond to the operating system, we use 64 Bit Oracle 11g database
Oracle11g Need to prepare at least :2 nucleus CPU、2G Memory 、8GB Hard disk space for
see cpu Details
lscbu
View memory details
free -h
View storage disk details
lsblk
Ensure that the server can access the Internet
Sure ping www.baidu.com To test
2 Check if... Is installed OracleCheck to see if there is oracle The process of
ps -ef | grep oraCheck if there is oracle user
# General installation oracle By default, a oracle user id oracle3 uninstall Oracle3.1 Make virtual machine again 3.2 uninstall Oracle4 Installation preparationbecause Oracle Uninstallation of is extremely troublesome , In terms of efficiency, it is not even as efficient as reinstalling the virtual machine directly
4.1 establish oracle Users and user groupsOracle The installation of requires a graphical interface , So as a form of command Linux The operating system needs to install a graphical interface :VNC;
For safety's sake , Not recommended root As vnc user , therefore , install oracle Set up a separate user to install oracle relevant
# stay Linux Created in oinstall User group groupadd oinstall# establish dba User group groupadd dba# establish oper User group groupadd oper# by dba and oper User group creation oracle user # -g Primary user group # -G Additional group useradd -g oinstall -G dba,oper oracle# take oracle The user's password is set to oracleecho "oracle"|passwd oracle --stdin4.2 by Oracle Create relevant directories for the installation of # Build folder mkdir -p /u01/app/oracle/product/11.2.0/db_1# Change the subject and group chown -R oracle:oinstall /u01/app# Authorize folders chmod -R 775 /u01/app4.3 Optimize OS Kernel parameters vim /etc/sysctl.conf# Add the following fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152# kernel.shmmax The parameter is set to half of the physical memory kernel.shmmax = 1200000000kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576# Because I just customized the configuration shmmax、shmmni、shmall, So comment out the original shmmax、shmall These attributes After saving and exiting , Parameters need to be made effective
sysctl -p4.4 Limit oracle User shell jurisdiction In order to optimize performance , Need to add oracle User's limit parameters
vim /etc/security/limits.conf # Add the following four lines at the end of the file # Set the soft limit of the number of processes oracle soft nproc 2047# Set a hard limit on the number of processes oracle hard nproc 16384# Set the soft limit of the number of files oracle soft nofile 1024# Set a hard limit on the number of files oracle hard nofile 65536# The process session limit can be pam_limits Authentication module to achieve , By modifying the login program login Of PAM Set to enable the authentication vim /etc/pam.d/login # Add the following line at the end of the file session required /lib64/security/pam_limits.so# It's usually 64 Bit system ,64 The bit system needs to be set to /lib64/security/pam_limits.so Otherwise, the command line cannot log in after restarting the server , However, if you can log in through the desktop session required pam_limits.soMake parameters effective
source /etc/profile4.5 by Oracle Users add Oracle environment variable su - oraclevim .bash_profile# Add the following ORACLE_BASE=/u01/app/oracleORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1PATH=$PATH:$ORACLE_HOME/binORACLE_SID=orclNLS_LANG="SIMPLIFIED CHINESE_CHINA.UTF8"export ORACLE_BASE ORACLE_HOME ORACLE_SID PATHif [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fifiAfter exiting, you need to refresh the environment variables
source .bash_profile or source /home/oracle/.bash_profile4.6 To configure hostname( This machine IP mapping )install oracle when , Make sure that the hostname appears in /etc/hosts in
vim /etc/hosts# Add the following 127.0.0.1 localhost192.168.222.30mydbtest hostname
ping -c 3 mydb/etc/sysconfig/network Medium hostname To work with /etc/hosts In the same
vim /etc/sysconfig/network# Add the following NETWORKING=yesHOSTNAME=mydb# The server IPGATEWAY=192.168.222.30NTPSERVERARGS=iburst4.7 install VNC&Oracle Related dependencies 4.7.1 To configure yum Source cd /etcmv yum.repos.d yum.repos.d.bakmkdir yum.repos.dwget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo# Clean cache yum clean all# Build cache yum makecache# install epel Source yum -y install epel-release4.7.2 Installation dependency # Graphical interface essential `X Window System`yum -y groupinstall "X Window System"# install VNC+ graphics 、oracle Dependency needed ( Software )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 \libXp4.7.3 Check whether the dependency installation is complete
rpm -q \binutils \compat-libstdc++-33 \elfutils-libelf \elfutils-libelf-devel \expat \gcc \gcc-c++ \glibc \glibc-common \glibc-devel \glibc-headers \libaio \libaio-devel \libgcc \libstdc++ \libstdc++-devel \make \pdksh \sysstat \unixODBC \unixODBC-devel | grep "not installed"4.7.4 If the installation fails, install the dependency separately Method 1 : adopt yum install
yum -y install pdksh( Installation failed package)Method 2 :wget Command direct download pdksh Of rpm package , Download to /tmp/
wget -O /tmp/pdksh-5.2.14-37.el5_8.1.x86_64.rpm http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm# install pdkshrpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm4.7.5 Install language pack The server &VNC&Oracle The language of the installation package should be unified , Here I use the Chinese installation package , To avoid Chinese garbled code , Need to install Chinese language pack ( If you are all English, you can ignore this step )
————— Upload method —————
# 1. Switch to oracle The installation directory cd /u01/# 2. Upload files to server rz/sz# or shell Tool drag # or # ---------------------------------------------------------------scp -r /Users/nan/Desktop/Oracle [email protected]:/opt/test/ # analysis scp -r dir [email protected]:dir command recursive File path to copy Destination host user name @ Destination host ip: Destination path # ---------------------------------------------------------------# 3. Install Chinese font package yum –y install pdksh-5.2.14-37.el5_8.1.x86_64.rpm4.8 Open ports / Turn off firewall 4.8.1 Open ports Firewall release VNC port 5901 and Oracle Default port 1521
edit iptables, to open up 1521 port :
sudo vi /etc/sysconfig/iptables-A INPUT -p tcp -m state --state NEW -m tcp --dport 1521 -j ACCEPT service iptables restart
sudo service iptables restartSave configuration , In order to linux Still valid after restart
sudo service iptables save View firewall rules :
sudo iptables -L –n4.8.2 Turn off firewall service iptables stopchkconfig iptables offvim /etc/sysconfig/selinuxSELINUX=enforcing Change to SELINUX=disabled4.9 Upload Oracle The installation files Switch users and directories
xhost +su - oraclecd /u01/swUpload Linux-x86-64_1of7.zip and Linux-x86-64_2of7.zip Document to /u01/sw Directory upload method
Unzip the installation file
unzip linux.x64_11gR2_database_1of2.zipunzip linux.x64_11gR2_database_2of2.zipSwitch after completion root user , Copy authorization
su - rootmkdir /home/oracle/etc/cp /db/database/response/* /home/oracle/etc/chmod 777 /home/oracle/etc/*.rspSign in oracle user
su – oraclevi /home/oracle/etc/db_install.rsp# The information is as follows :oracle.install.option=INSTALL_DB_SWONLYUNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/db/app/oracle/oraInventorySELECTED_LANGUAGES=en,zh_CNORACLE_HOSTNAME=oracleORACLE_HOME=/db/app/oracle/product/11.2.0/db_1ORACLE_BASE=/db/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.isCustomInstall=trueoracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=oinstalloracle.install.db.config.starterdb.type=GENERAL_PURPOSEoracle.install.db.config.starterdb.globalDBName=orcloracle.install.db.config.starterdb.SID=orcloracle.install.db.config.starterdb.memoryLimit=512oracle.install.db.config.starterdb.password.ALL=oracleDECLINE_SECURITY_UPDATES=true4.10 install perform Oracle The installation files
su - oracle./runInstaller -silent -force -responseFile /home/oracle/etc/db_install.rsp -ignorePrereqCan be used during installation tail Order to watch oracle Installation log of
cd /db/app/oracle/oraInventory/logs/tail -f installActions2021-11-10_10-38-29AM.log
installation is complete , Tips Successfully Setup Software

Use root User execution script
su - root/db/app/oracle/product/11.2.0/db_1/root.sh4.10.1 To add or modify oracle Environment variables of su - oraclevi ~/.bash_profileexport ORACLE_HOME=/db/app/oracle/product/11.2.0/db_1export TNS_ADMIN=$ORACLE_HOME/network/adminexport PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/binexport PATH=${PATH}:/usr/bin:/bin:/usr/local/binexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/libexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/libexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/libexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlibexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlibexport CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlibexport LIBPATH=${CLASSPATH}:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/libexport ORACLE_OWNER=oracleexport SPFILE_PATH=$ORACLE_HOME/dbsexport ORA_NLS10=$ORACLE_HOME/nls/dataMake configuration effective
source ~/.bash_profile4.10.2 Configure listener Configured to monitor
# Make sure that the oracle The directory bin Next pwd/db/app/oracle/product/11.2.0/db_1/bin./netca /silent /responseFile /home/oracle/etc/netca.rspStart listening
# Make sure that the oracle The directory bin Next pwd/db/app/oracle/product/11.2.0/db_1/bin# Start listening lsnrctl start# Check the listening status lsnrctl startLSNRCTL for Linux: Version 11.2.0.1.0 - Production on 25-MAY-2019 00:13:21Copyright (c) 1991, 2009, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1522)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionStart Date 25-MAY-2019 00:05:55Uptime 0 days 0 hr. 7 min. 32 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /db/app/oracle/product/11.2.0/db_1/network/admin/listener.oraListener Log File /db/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1522)))The listener supports no servicesThe command completed successfully
Listening state
lsnrctl start# It is shown as follows LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 25-MAY-2019 00:13:21Copyright (c) 1991, 2009, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1522)))5 Create database Edit the answer file
vi /etc/dbca.rspGDBNAME="orcl.oracle" SID="orcl"SYSPASSWORD = "oracle" SYSTEMPASSWORD = "oracle" CHARACTERSET="AL32UTF8" NATIONALCHARACTERSET="UTF8"# perform :$ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/etc/dbca.rspBuilding database
pwd/db/app/oracle/product/11.2.0/db_1/bindbca -silent -responseFile etc/dbca.rsp# This completes the creation of the database instance Set up Oracle Boot up
vim /etc/oratab# hold “N” Change to “Y”orcl:/db/app/oracle/product/11.2.0/db_1:Y 5.1 Delete the instance [[email protected] bin]$ vi /etc/orataborcl:/db/app/oracle/product/11.2.0/db_1:Y # // hold “N” Change to “Y”# Save and exit [[email protected] bin]$ pwd/db/app/oracle/product/11.2.0/db_1/bin# adopt dbstart Start this instance , Monitor ## ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener## Usage: ./dbstart ORACLE_HOME[[email protected] bin]$ ./dbstart $ORACLE_HOME;# oracle Process shutdown for , The listener also stops ;[[email protected] bin]$ ./dbshut $ORACLE_HOME;# Start listening [[email protected] bin]$ ./lsnrctl start;# Check monitor [[email protected] bin]$ ./lsnrctl status5.2 land Oracle[[email protected] bin]$ pwd/db/app/oracle/product/11.2.0/db_1/bin[[email protected] bin]$ ./sqlplus /nolog# Enter the system to manage users SQL> conn / as sysdbaConnected to an idle instance.# start-up oracle example SQL> startup;1、 Use oracle Users log on to the desktop , Open the terminal and run the installer
[[email protected] ~] cd /ora/database[[email protected] ~] ./runInstaller1) Subscribe to email skip

2) Choose ignore updates ( Or let me choose the desktop version or the server version , If you choose the server version )

3) Here you choose to install the database only , Configure the initialization data later .

4): Select single instance installation .

5): Language ,linux Don't think about Chinese on the server , Let's default to English .

6): Default

7): Here is the corresponding directory information created at the beginning , Will automatically read .

8): next step

9): choice group The group is created before oinstall

10): The following warning messages may appear during installation , As a reminder semmni by 0 The problem of , The cause of this problem has not been found , We have adjusted it in the process of modifying the kernel above kernel.sem = 250 32000 100 128 But the test failed ( There is no solution for the moment )、 Other dependent component prompts , Actually, we have already installed it , It's just centos7 On yum The installed dependent packages are better than oracle 11g Required package updates , Higher version , So you can just ignore these tips ( Check ignore all).

3、 A prompt will appear at the end of the installation : Need to use root Permissions to perform 2 individual shell Script , So we are in the previous root Run the corresponding script file in the prompt under the user terminal .
Here or earlier steps may appear a very magical (zhizhang) The problem of , The dialog box may not pop up normally , Test in VM Virtual machine or cloud server , Such as Alibaba cloud , But you can drag it away with the mouse . Yes , You're not mistaken , Directly drag out the dialog box . The reason for this problem is unknown , If you know, please leave a message , Thank you very much .

There may also be a dialog box that cannot be dragged at all ( Repeated tests on Alibaba cloud , Is that there will be ) In the end, there's no way , Run the virtual machine locally and simulate the installation step by step , Discovery is a warning , General press 4 Time tab Key to switch to the next option and press enter .

4、 After installation, you need to create a database , It's the same Oracle In the user desktop environment , Reopen a terminal , Input dbca Command to pop up the corresponding database creation wizard .

If the prompt doesn't have this command , Please check whether the above dependent package is installed correctly , In addition, if a prompt appears during the creation process oracle not available Check if the host name has been added to hosts In file .
summaryThis is about Linux CentOS7 install Oracle11g This is the end of the article , More about Linux CentOS7 install Oracle11g Please search the previous articles of software development network or continue to browse the relevant articles below. I hope you will support software development network more in the future !
边栏推荐
- How to realize parallel replication in MySQL replication
- 2021 robocom world robot developer competition - preliminary competition of higher vocational group
- 安全协议重点
- SecurityUtils. getSubject(). How to solve the problem that getprincipal() is null
- VIM color the catalogue
- ConcurrentSkipListMap——跳表原理
- Soft exam information system project manager_ Compiled abbreviations of the top ten management processes to help memory recitation - -- software test advanced information system project manager 054
- Relatively easy to understand PID understanding
- Redis master-slave synchronization
- UDS bootloader of s32kxxx bootloader
猜你喜欢

Use pair to do unordered_ Key value of map

使用 pair 做 unordered_map 的键值
![[QT] test whether QT can connect to the database](/img/63/32530c15995ef23bde8cadc3adfd11.png)
[QT] test whether QT can connect to the database

使用VB.net将PNG图片转成icon类型图标文件
![[QT] solve the problem that QT MSVC 2017 cannot compile](/img/35/e458fd437a0bed4bace2d6d65c9ec8.png)
[QT] solve the problem that QT MSVC 2017 cannot compile

ConcurrentSkipListMap——跳表原理

Pytorch learning record

kubernetes资源对象介绍及常用命令(三)

RPA tutorial 01: Excel automation from introduction to practice

ARP message header format and request flow
随机推荐
BlocProvider为什么感觉和Provider很相似?
【QT】Qt 使用MSVC2017找不到编译器的解决办法
微信小程序缓存过期时间的相关设置(推荐)
[must] bm41 output the right view of the binary tree [medium +]
使用uni-simple-router,动态传参 TypeError: Cannot convert undefined or null to object
13 MySQL constraint
- Oui. Env. Fichier XXX, avec constante, mais non spécifié
Selectively inhibiting learning bias for active sampling
常见的积分商城游戏类型有哪些?
vs2015 AdminDeployment. xml
RPA教程01:EXCEL自动化从入门到实操
在代码中使用SqlCommand对象
Pytorch learning record
第六章 数据流建模
USB-IF协会与各种接口的由来
Kubernetes resource object introduction and common commands (III)
[QT] QT cannot find a solution to the compiler using msvc2017
[Qt] résoudre le problème que Qt msvc 2017 ne peut pas Compiler
Windows installation WSL (II)
Concepts of dictionary, hash table and array