In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how to install Oracle 11g under Linux". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to install Oracle 11g under Linux" can help you solve the problem.
Oracle 11g client is a specialized relational database management system made by Oracle. Oracle 11g client has powerful functions and has the characteristics of high efficiency, security, stability and extensibility. Almost all large information systems in the world are using Oracle database technology.
1. Environment preparation before installation
1.1. Configure a local yum source
# due to the company's intranet environment, there is no Internet, so you need to configure local yum sources, install the required dependency packages, and so on. # Mount ios image centos7.5-1804 [root@oracle ~] # mount / dev/cdrom / mnt# backup original configuration file [root@oracle ~] # cd / etc/yum.repos.d/ [root@oracle ~] # mkdir bak [root@oracle ~] # mv * bak# create yum configuration file [root@oracle ~] # vi / etc/yum.repos.d/local.repo# add the following [local] name=localbaseurl= file:///mntgpgcheck=0enabled=1# to clear all yum sources Information [root@oracle ~] # yum clean all# View all software of the local source [root@oracle ~] # yum list
1.2 upload and decompress oracle 11g installation package
# Unzip the downloaded linux.x64_11gR2_database_1of2.zip and linux.x64_11gR2_database_2of2.zip to the / usr/local/apps/oracle directory [root@oracle ~] # mkdir-p / usr/local/apps/oracle [root@oracle ~] # cd / usr/local/apps/oracle [root@oracle oracle] # unzip p13390677_112040_Linux-x86-64_1of7.zip & & unzip p13390677_112040_Linux-x86-64_2of7.zip# does not install the unzip command The installation of the tool [root@oracle ~] # yum install unzip-y # will produce a database directory after decompression. Namely / usr/local/apps/oracle/database, the directory contains the installation files for oracle11g Enterprise Edition.
1.3. Map the IP address of the local service
# add native IP address and hostname [root@oracle oracle] # vim / etc/hosts10.0.0.10 oracle
1.4. Close selinux
# modify SELINUX=disabled [root@oracle ~] # vi / etc/selinux/configSELINUX=disabled [root@oracle ~] # setenforce 0setenforce: SELinux is disabled
1.5. Turn off the firewall
[root@oracle ~] # service iptables stop [root@oracle ~] # systemctl stop firewalld [root@oracle ~] # systemctl disable firewalld
1.6. Install the Oracle 11g dependency package
[root@oracle ~] # yum install gcc make ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-devel-y
1.7. Add installation users and user groups
# create user group [root@oracle ~] # groupadd oinstall [root@oracle ~] # groupadd dba# create oracle user and specify user group [root@oracle ~] # useradd-g oinstall-G dba oracle# set password for oracle user [root@oracle ~] # passwd oracle# View user information [root@oracle ~] # id oracle uid=1001 (oracle) gid=1001 (oinstall) group = 1001 (oinstall), 1002 (dba) # if the above similar information is displayed, the user and user group are added successfully
1.8. Modify kernel parameters
[root@oracle ~] # vi / etc/sysctl.conf# add the following fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 1073741824kernel.shmmni = 4096kernel.sem = 25032000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 104857, where shmmax is the maximum value of a single shared memory segment, which is generally set to half of the local physical memory Unit is byte, you can make corresponding adjustments according to your actual situation # to make the new kernel parameters effective [root@oracle ~] # sysctl-p
1.9. Modify the user's restriction file
[root@oracle ~] # vi / etc/security/limits.conf# add the following content oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240
1.10. Modify / etc/pam.d/login file
[root@oracle ~] # vi / etc/pam.d/login# add the following content session required / lib64/security/pam_limits.sosession required pam_limits.so
1.11. Modify / etc/profile file
[root@oracle ~] # vi / etc/profile# add the following if [$USER = "oracle"]; thenif [$SHELL = "/ bin/ksh"]; thenulimit-p 16384ulimit-n 65536elseulimit-u 16384-n 65536fifi# to make it effective [root@oracle ~] # source / etc/profile
1.12. Create installation directory and set file permissions
[root@oracle ~] # mkdir-p / usr/local/apps/oracle/product/11.2.0 [root@oracle ~] # mkdir / usr/local/apps/oracle/oradata [root@oracle ~] # mkdir / usr/local/apps/oracle/inventory [root@oracle ~] # mkdir / usr/local/apps/oracle/fast_recovery_ area [root @ oracle ~] # chown-R oracle:oinstall / usr/local/apps/oracle [root@oracle ~] # chmod-R 775 / usr/local/apps/oracle
1.13. Set oracle user environment variables
[root@oracle ~] # su-oracle# Note here, when switching users, remember to add "-". If you add -, you will have the environment variable of the target user. If you do not add "-", you will not. Detailed online search for answers [oracle@oracle ~] $vi .bash _ profile# add the following content ORACLE_BASE=/usr/local/apps/oracleORACLE_HOME=$ORACLE_BASE/product/11.2.0ORACLE_SID=orclPATH=$PATH:$ORACLE_HOME/binexport ORACLE_BASEexport ORACLE_HOMEexport ORACLE_SIDexport PATH# to make the configuration effective [oracle@oracle ~] $source .bash _ profile
1.14. Edit the silent installation response file
[oracle@oracle ~] $cp-R / usr/local/apps/oracle/database/response/ / home/oracle [oracle@oracle ~] $cd / home/oracle/response [oracle@oracle ~] $vi db_install.rsp# needs to be set as follows. Note that only the following settings are modified, and other settings remain unchanged, otherwise an error will be reported. Oracle.install.option=INSTALL_DB_SWONLYORACLE_HOSTNAME=oracleUNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/usr/local/apps/oracle/inventorySELECTED_LANGUAGES=en Zh_CNORACLE_HOME=/usr/local/apps/oracle/product/11.2.0ORACLE_BASE=/usr/local/apps/oracleoracle.install.db.InstallEdition=EEoracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=dbaDECLINE_SECURITY_UPDATES=true2 silently installs Oracle11g Enterprise Edition Enterprise Edition according to the response file [oracle@oracle ~] $cd / usr/local/apps/oracle/database [oracle@oracle ~] $. / runInstaller-silent-responseFile / home/oracle/response/db_install.rsp-ignorePrereq#Oracle starts silent installation in the background If you prompt Successfully, the installation is successful # execute the script as required, open the terminal, log in as the root user, and execute the script [root@oracle ~] # / usr/local/apps/oracle/inventory/orainstRoot.sh [root@oracle ~] # / usr/local/apps/oracle/product/11.2.0/root.sh3. Configure listening silently # Log in as oracle user and execute [oracle@oracle ~] $netca / silent / responsefile / home/oracle/response/netca.rsp# to check whether port 1521 is listening through the netstat command [oracle@oracle ~] $ss-tnulp | grep 15214. Create a new library silently, as well as a corresponding instance
4.1. Modify dbca.rsp configuration file
[oracle@oracle ~] $vim / home/oracle/response/dbca.rsp# set the following parameters [CREATEDATABASE] GDBNAME = "orcl" SID = "orcl" SYSPASSWORD = "123456" SYSTEMPASSWORD = "123456" SYSMANPASSWORD = "123456" DBSNMPPASSWORD = "123456" DATAFILEDESTINATION = / usr/local/apps/oracle/oradataRECOVERYAREADESTINATION=/usr/local/apps/oracle/fast_recovery_areaCHARACTERSET = "AL32UTF8" TOTALMEMORY = "800" # where TOTALMEMORY =" 800" is 800MB, which is generally set to 80% of physical memory
4.2. Create an instance with silent configuration
[oracle@oracle ~] $dbca-silent-responseFile / home/oracle/response/dbca.rsp# check the instance process after building the database [oracle@oracle ~] $ps-ef | grep ora_ | grep-v grep# to view the listening status [oracle@oracle ~] $lsnrctl status# login to view the instance status [oracle@oracle ~] $sqlplus / as sysdbaSQL > select status from v$instance # if STATUS-OPEN# is displayed, it means that the instance is started. # View database code SQL > select userenv ('language') from dual;# view database version SQL > select * from vault version. Oracle boot setting
5.1. Modify startup script file
# modify / usr/local/apps/oracle/product/11.2.0/bin/dbstart [oracle@oracle ~] $vi / usr/local/apps/oracle/product/11.2.0/bin/dbstart# modify ORACLE_HOME_LISTNER=$1 to ORACLE_HOME_LISTNER=$ORACLE_HOME# / usr/local/apps/oracle/product/11.2.0/bin/dbshut [oracle@oracle ~] $vi / usr/local/apps/oracle/product/11.2.0/bin/dbshut# ORACLE _ HOME_LISTNER=$1 changed to ORACLE_HOME_LISTNER=$ORACLE_HOME
5.2. Modify / etc/oratab file
[oracle@oracle ~] $vi / etc/oratab# change the last N in orcl:/usr/local/apps/oracle/product/11.2.0:N to Y, become orcl:/usr/local/apps/oracle/product/11.2.0:Y# input dbshut and dbstart test [oracle@oracle ~] $dbshut#Oracle snooping stops, process disappears [oracle@oracle ~] $dbstart#Oracle snooping starts, process starts 5.3. Switch to the root account and set up the self-startup script [oracle@oracle ~] $su-[root@oracle ~] # vim / etc/rc.d/init.d/oracle# to add the following (some values such as ORA_HOME and ORA_USER can be modified according to the actual situation): #! / bin/sh# chkconfig: 35 801 description: Oracle auto start-stop script.## Set ORA_HOME to be equivalent to the $ORACLE_HOME# from which you wish to execute dbstart and dbshut # # Set ORA_OWNER to the user id of the owner of the# Oracle database in ORA_HOME.ORA_HOME=/usr/local/apps/oracle/product/11.2.0ORA_OWNER=oracleif [!-f $ORA_HOME/bin/dbstart] then echo "Oracle startup: cannot start" exitficase "$1" in'start') # Start the Oracle databases:echo "Starting Oracle Databases. "echo"-- "> > / var/log/oracledate +" T% a% D: Starting Oracle Databases as part of system up. "> > / var/log/oracleecho"-- -"> > / var/log/oraclesu-$ORA_OWNER-c" $ORA_HOME/bin/dbstart "> / var/log/oracleecho" Done "# Start the Listener:echo" Starting Oracle Listeners. "echo"-- "> > / var/log/oracledate +" T% a% D: Starting Oracle Listeners as part of system up. "> > / var/log/oracleecho"-- -"> > / var/log/oraclesu-$ORA_OWNER-c" $ORA_HOME/bin/lsnrctl start "> > / var/log/oracleecho" Done. "echo"-- > / var/log/oracledate + "% T% a% D. : Finished. "> > / var/log/oracleecho"-- > / var/log/oracletouch / var/lock/subsys/oracle ; 'stop') # Stop the Oracle Listener:echo "Stoping Oracle Listeners... "echo"-- "> > / var/log/oracledate +" T% a% D: Stoping Oracle Listener as part of system down. "> > / var/log/oracleecho"-- -"> > / var/log/oraclesu-$ORA_OWNER-c" $ORA_HOME/bin/lsnrctl stop "> > / var/log/oracleecho" Done. "rm-f / var/lock/subsys/oracle# Stop the Oracle Database:echo" Stoping Oracle Databases. "echo"-- "> > / var/log/oracledate +" T% a% D: Stoping Oracle Databases as part of system down. "> > / var/log/oracleecho"-- -"> > / var/log/oraclesu-$ORA_OWNER-c" $ORA_HOME/bin/dbshut "> > / var/log/oracleecho" Done. "echo"echo"-- "> > / var/log/oracledate +"% T% a % D: Finished. "> > / var/log/oracleecho"-> > / var/log/oracle ; 'restart') $0 stop$0 start;;esac
5.4. Modify / etc/init.d/oracle service file permissions
[root@oracle ~] # chmod 755 / etc/init.d/oracle
5.5. Add self-booting service
[root@oracle ~] # chkconfig oracle on
5.6. You need to stop the database before shutting down or restarting the machine.
# shutdown [root@oracle ~] ln-s / etc/init.d/oracle / etc/rc0.d/K01oracle# restart [root@oracle ~] ln-s / etc/init.d/oracle / etc/rc6.d/K01oracle # to test [root@oracle ~] # service oracle start # start oracle [root @ oracle ~] # service oracle stop # shut down oracle
5.7. Restart to see if both Oracle snooping and instance processes can be started automatically
That's all for [root@oracle] # reboot about "how to install Oracle 11g under Linux". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.