Linux installation configuration Oracle+plsql installation configuration (super detailed)

Note: There are a lot of interface screenshots in this article, if the viewing effect is not good, you can go to the text version:

Linux installation configuration Oracle+plsql installation configuration (detailed) - Super love slow blog - CSDN blog

Table of contents

1 Install the virtual machine system

1.1 Install a virtual machine

2. Configure the virtual machine

2.1 Set the machine name

 2.2 Modify domain name mapping

 2.3 Fixed IP address

​2.4 Turn off the firewall

 2.5 Changing the security mechanism

 2.6 restart reboot

3 modify the configuration

3.1 Modify logo

 3.2 Modify kernel parameters

 3.3 After modification, enable the new configuration

 3.4 Update yum source

3.5 Install required packages

3.6 Create users and groups

 3.7 id oracle query oracle user information

3.8 Create installation directory

 3.9 Modify the security performance settings of the oracle user

3.10 Modify user environment variables and modify files

3.11 Upload the two installation zip packages of oracle to /opt

4 Install Oracle

4.1 Edit the database installation file /data/src/database/response/db_install.rsp

4. 2 Execute oracle

4.3 Execute the configuration script

4.4 Configuring the Oracle listener

 4.5 About the power on and off of the monitor [default open]

 4.6 Adding a database instance

 4.7 Modify the procedures for starting and shutting down instances

5. Finishing touches

5.1 Start Oracle at boot

5.2 start sqlplus

6 PLSQL Developer installation

6.1 Download the installation package

6.2 Decompression and installation

6.3 Create tnsnames.ora file

6.4 Configure the windows environment

 6.5 plsql developer configuration

6.5 plsql login


1 Install the virtual machine system

1.1 Install a virtual machine

VM download + installation and configuration tutorial + installation and configuration of Linux system + network configuration (super detailed) (including activation method)_Super Love Slow Blog-CSDN Blog

 Here it is recommended to install the file transfer tool mobaXterm, or Xshell, or finalshell, because the content cannot be copied between the virtual machine and the local machine, so it will be very convenient to install these tools (the screenshots shown here are from the mobaXterm tool, and you can also not install it anyway the content is the same)

Here is a reminder that it is best to take a snapshot after each link is successfully completed (little knowledge: take a snapshot after shutdown), because if something goes wrong, it is better to return to the snapshot and start again too quickly than to find out what went wrong.

2. Configure the virtual machine

2.1 Set the machine name

 hostnamectl set-hostname cm04

 This step is just to determine your hostname

Query hostname:

hostname

 2.2  Modify domain name mapping

vi /etc/hosts
192.168.233.129  cm01

 2.3 Fixed IP address

 In fact, this step can be done at the step of installing the virtual machine. If you have done it, you can skip this step after specifying your IP address.

More detailed steps are in VM download + installation and configuration tutorial + installation and configuration of Linux system + network configuration (super detailed) (including activation method)_Super Love Slow Blog-CSDN Blog

(1) Edit the /etc/sysconfig/network-scripts/ifcfg-ens33 file

vi /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTROTO=”static”
IPADDR=”192.168.233.140”
NETMASK=”255.255.255.0”
GATEWAY=”192.168.233.2”
DNS1=”114.114.114.114”
DNS2=”8. 8 .8.8”
(Note: Some images need to add ONBOOT="yes")

(2) Restart the network

 systemctl restart network

(3) Test the external network

ping www.baidu.com -c 3

 2.4 Turn off the firewall

 systemctl stop firewalld
systemctl disable firewalld

 2.5 Changing the security mechanism

vi /etc/selinux/config
SELINUX=disabled

 

 2.6 restart reboot

reboot

3 modify the configuration

3.1 Modify logo

Modify the CentOS system logo (because Oracle does not support CentOS by default)
modify the file: /etc/redhat-release
and replace the file content with: redhat-7

 3.2 Modify kernel parameters

Modify the file: /etc/sysctl.conf
   add the following:

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
kernel.shmall = 2097152
kernel.shmmax = 2147483648
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
net.core.rmem_default = 262144
net.core.rmem_max= 4194304
net.core.wmem_default= 262144
net.core.wmem_max= 1048576

 3.3 After modification, enable the new configuration

 sysctl -p

 3.4 Update yum source

 yum install -y wget
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo_bak


wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo [These two lines are one line of commands (to prevent some small partners from viewing the device word wrap)]


yum clean all
yum makecache #update package cache

 

3.5 Install required packages

 

3.6  Create users and groups

 groupadd oinstall #Create and install oracle program user group 
groupadd dba #Create DBA user group
useradd -g dba -m oracle #Create user oracle and join it to dba group
usermod -a -G oinstall oracle #Add user oracle to oinstall group
passwd oracle # Modify the password of user oracle
# The password is oracle

 3.7 id oracle query oracle user information

id oracle

 Note: If we are still in the yum.repos.d directory, this command cannot be recognized

 

3.8 Create installation directory

mkdir -p /data/oracle #Create oracle main directory
mkdir -p /data/inventory #Create oralce configuration directory
mkdir -p /data/src #Create oracle compressed package decompression directory
chown -R oracle:oinstall /data/oracle #Modify Directory permissions
chown -R oracle:oinstall /data/inventory chown -R oracle:oinstall /data/src
ll /data #View directory permissions    

 3.9 Modify the security performance settings of the oracle user

vi /etc/security/limits.conf
Before the last line of the file, add the following content
#@student - maxlogins 4

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

# End of file

3.10 Modify user environment variables and modify files

vi /home/oracle/.bashrc append the following content

export PATH
export ORACLE_BASE=/data/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export LANG=C
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

Enable immediately after modification:
source /home/oracle/.bashrc

3.11 Upload the two installation zip packages of oracle to /opt

First transfer the two installation zip packages to the opt folder of the virtual machine

Friends who do not have the installation package can pick it up here

Link: https://pan.baidu.com/s/1KyWEWfePQm37v_5V2pPRVA?pwd=pb68 
Extraction code: pb68

Here, pass the installation package to the /opt directory through mobaterm

yum install -y zip unzip

cd /opt
unzip linux.x64_11gR2_database_1of2.zip -d /data/src/
unzip linux.x64_11gR2_database_2of2.zip -d /data/src/

 

4 Install Oracle

4.1 Edit the database installation file /data/src/database/response/db_install.rsp

vi  /data/src/database/response/db_install.rsp

oracle.install.option=INSTALL_DB_SWONLY vu# Installation type (only install database software)
ORACLE_HOSTNAME=oracle.server # Host name
UNIX_GROUP_NAME=oinstall # Installation group
INVENTORY_LOCATION=/data/inventory #INVENTORY directory
SELECTED_LANGUAGES=en,zh_CN # Select language
ORACLE_HOME= /data/oracle/product/11.2.0/db_1 #oracle_home
ORACLE_BASE=/data/oracle #oracle_base
oracle.install.db.InstallEdition=EE #oracle version
oracle.install.db.DBA_GROUP=dba # dba user group
oracle.install .db.OPER_GROUP=oinstall # oper user group

oracle.install.db.config.starterdb.type=GENERAL_PURPOSE    
# database type

oracle.install.db.config.starterdb.globalDBName=orcl      
# globalDBName

oracle.install.db.config.starterdb.SID=orcl    # SID

oracle.install.db.config.starterdb.characterSet=AL32UTF8   
# Default database encoding

oracle.install.db.config.starterdb.memoryLimit=800         
# Minimum memory for automatic memory management (M)

oracle.install.db.config.starterdb.password.ALL=oracle     
# Set all database users to use the same password

DECLINE_SECURITY_UPDATES=true # Set security updates

 (You can enter / followed by the content you want to search in the non-insert state to quickly locate the modified place)

 

 

 

 

4. 2 Execute oracle

su oracle

(The following is a statement)
$ /data/src/database/runInstaller -silent -responseFile /data/src/database/response/db_install.rsp -ignorePrereq

4.3 Execute the configuration script

   1. Open a terminal window
    2. Log in as "root"
    3. Run the script
      /data/inventory/orainstRoot.sh
      /data/oracle/product/11.2.0/db_1/root.sh
    4. Return to this window and press " Enter" key to continue 

This step will start when this interface appears in the previous step 

 

4.4 Configuring the Oracle listener

Edit the listening configuration file /data/src/database/response/netca.rsp
to modify the following parameters
INSTALL_TYPE=""custom"" # Type of installation
LISTENER_NUMBER=1 # Number of listeners
LISTENER_NAMES={"LISTENER"} # List of names of listeners
LISTENER_PROTOCOLS={"TCP;1521"} # List of communication protocols used by the listener
LISTENER_START=""LISTENER"" # The name of the listener startup

Execution command:
su oracle
(one-line command)
$ /data/oracle/product/11.2.0/db_1/bin/netca /silent /responseFile /data/src/database/response/netca.rsp

#Check whether the listener is running
su root
yum install net-tools
$ netstat -tnulp | grep 1521

 This shows that the monitoring has started successfully.

 4.5  Turn on and off the monitor [default open]

su oracle
start monitoring: /data/oracle/product/11.2.0/db_1/bin/lsnrctl start
close monitoring: /data/oracle/product/11.2.0/db_1/bin/lsnrctl stop

 4.6 Adding a database instance

su root
to edit the database instance file /data/src/database/response/dbca.rsp
and modify the following parameters

RESPONSEFILE_VERSION = "11.2.0" // Do not change
OPERATION_TYPE = "createDatabase" // The operation is to create an instance  
GDBNAME = "orcl" // Database instance name
SID = "orcl" // Instance name
TEMPLATENAME = "General_Purpose.dbc" // template file for database construction
SYSPASSWORD = "oracle" // SYS administrator password
SYSTEMPASSWORD = "oracle" // SYSTEM administrator password
SYSMANPASSWORD= "oracle"
DBSNMPPASSWORD= "oracle"
DATAFILEDESTINATION =/data/oracle/oradata // Data file storage directory
RECOVERYAREADESTINATION=/data/oracle/flash_recovery_area // Recovery data storage directory
CHARACTERSET = "AL32UTF8" // character set
NATIONALCHARACTERSET = "AL16UTF16" // character set
TOTALMEMORY = "1638" // 1638MB, physical memory 2G*80%.


 Execute command:
 su oracle
 
$ /data/oracle/product/11.2.0/db_1/bin/dbca -silent -responseFile /data/src/database/response/dbca.rsp


su root
yum install -y net-tools
netstat -tnulp |grep 1521


See if the instance is running
$ ps -ef | grep ora_ | grep -v grep

 

 

 

 

 

 4.7 Modify the procedures for starting and shutting down instances

Modify the file: /data/oracle/product/11.2.0/db_1/bin/dbstart
      /data/oracle/product/11.2.0/db_1/bin/dbshut
change
ORACLE_HOME_LISTNER=$1
to
  ORACLE_HOME_LISTNER=/data/oracle/product/ 11.2.0/db_1
modify file: /etc/oratab


orcl:/data/oracle/product/11.2.0:N
修改为
orcl:/data/oracle/product/11.2.0:Y


Start or shut down the instance
Start the instance: /data/oracle/product/11.2.0/db_1/bin/dbstart
Close the instance: /data/oracle/product/11.2.0/db_1/bin/dbshut

5. Finishing touches

5.1 Start Oracle at boot

Root user mode:
su root
chmod +x /etc/rc.d/rc.local


Modify the file /etc/rc.d/rc.local
and add the following content at the end of the file:
su oracle -lc "/data/oracle/product/11.2.0/db_1/bin/lsnrctl start"
su oracle -lc "/data/ oracle/product/11.2.0/db_1/bin/dbstart"

 

5.2 start sqlplus

su oracle

cd  /data/oracle/product/11.2.0/db_1/bin

./sqlplus /nolog

6 PLSQL Developer installation

6.1 Download the installation package

Link: https://pan.baidu.com/s/1LQmK7hU05D_CZSlwS0vtPg?pwd=z5tm 
Extraction code: z5tm

Here is the installation package needed by pysql, and the small partners who need it can mention it by themselves

6.2 Decompression and installation

Unzip instantclient to any directory

 Run the pysqlDeveloper installation package

 

 

 

 

6.3 Create tnsnames.ora file

6.3.1 Create NETWORK\ADMIN folder in order under the root directory of instantclient decompression
6.3.2 Create tnsnames.ora file in ADMIN folder
6.3.3 tnsnames.ora content:

ORCL = 
    (DESCRIPTION = 
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.232.131)(PORT = 1521)) 
        (CONNECT_DATA = 
            (SERVER = DEDICATED) 
            (SERVICE_NAME = ORCL) 
    ) 
)

 It is recommended to change the format first and then add content to it to prevent garbled content after changing the format

6.4 Configure the windows environment

6.4.1 Place TNS_ADMIN: D:\instantclient_19_10\NETWORK\ADMIN
6.4.2 Place NLS_LANG: SIMPLIFIED CHINESE_CHINA.ZHS16GBK

 

 Remember to confirm all three after configuring, the second is the same 

 6.5 plsql developer configuration

If we double-click plsql, we will be prompted to log in. If we click cancel, we will enter plsql in the unlogged state, and then we can configure plsql

Right click on the blank space and select preferences

6.5 plsql login

 

 The login is successful as follows:

 Remarks: If some friends encounter the problem that the database instance cannot be started automatically or monitor

The steps to start manually are as follows:

Oracle start/shutdown/view monitor + start/shutdown/view database instance command - Super love slow blog - CSDN blog

Guess you like

Origin blog.csdn.net/jojo_oulaoula/article/details/131591556