vmware virtual machine CentOS7 installs oracle database

 

 

 

I want to install an oracle with a linux virtual machine, but there are too many pits in the middle. Finally, it is installed. I must write a comprehensive tutorial.

Ado

Common editing commands:

vi test.txt #Enter edit mode

After editing, press ESC to exit the editing mode

:wq Enter to save the edited file

1. Set linux to automatically open the network connection when booting up. If the network connection is not turned on, SecureCRT cannot be connected.

cd /etc/sysconfig/network-scripts/ #Enter the network script directory

vi ifcfg-ens33 #Edit file

Change the last line ONBOOT=no to "yes" to save and exit.

2. Uninstall CentOS7's own jdk1.8, install your own jdk and set environment variables

rpm -qa |grep jdk #View the jdk installation directory (jdk has been uninstalled on your computer, borrow a picture...)

#Use the remove command to remove all jdk related software

yum -y remove java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64   
yum -y remove java-1.7.0-openjdk-1.7.0.141-2.6.10.5.el7.x86_64
yum -y remove java-1.7.0-openjdk-headless-1.7.0.141-2.6.10.5.el7.x86_64
yum -y remove java-1.8.0-openjdk-headless-1.8.0.131-11.b12.el7.x86_64
yum -y remove copy-jdk-configs-2.2-3.el7.noarch

You can enter the java command to determine whether the uninstallation is complete

vi /etc/profile #Add your own jdk directory environment variables

Add the following:

export JAVA_HOME=/usr/local/soft/java/jdk1.7 #Note that this is your own jdk decompression directory
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME /lib/tools.jar

Save and exit
source /etc/profile #Make the configuration take effect

You can enter the java, javac, java -version commands to determine whether the newly configured java environment is normal

3. Create system users and user groups that run the oracle database
groupadd oinstall
groupadd dba
useradd -g oinstall -g dba -m oracle
passwd oracle #This command will make you confirm the password twice, if the password is too simple and does not meet the rules, it will be required to re-enter

4. Create the oracle database installation directory and assign the directory to the oracle user

mkdir -p /opt/oracle
mkdir -p /opt/oracle/oraInventory
mkdir -p /opt/oracle/database
chown -R oracle:oinstall /opt/oracle
chown -R oracle:oinstall /opt/oracle/oraInventory
chown -R oracle:oinstall /opt/oracle/database

Note: It is best to choose the opt directory, directly select the home directory and most of the installation prompts insufficient space

5. Modify the OS system logo

vi /etc/redhat-release

Change the original system ID to: redhat-7

6. Install the packages required by the oracle database

yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh numactl-devel glibc-headers

 

7. Turn off the firewall (permanent)
systemctl disable firewalld.service

 8. Shut down selinux, you need to restart to take effect, you can wait for the next few steps to complete before restarting.

vi /etc/selinux/config

9. Modify the kernel parameters
vi /etc/sysctl.conf

Add the following:

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

 

sysctl -p #Make the configuration take effect

10. Set limits for oracle users to improve software performance
vi /etc/security/limits.conf
add:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

 

11.配置用户环境变量
vi /opt/oracle/.bash_profile
添加:
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_TERM=xterm
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.ZHS16GBK

source /home/oracle/.bash_profile #Make the configuration take effect

12. Put the two compressed file packages of the oracle database into the /opt/oracle/database directory and decompress them. The operation will not be described in detail.

Unzip command: unzip filename

Authorize the directory after decompression: chown -R oracle:oinstall /opt/oracle/database/database/

13. Restart linux and log in with the oracle user

 14. It is best to use the linux interface command to enter the /opt/oracle/database/database directory and execute the command:

./runInstaller -jreLoc /usr/local/soft/java/jdk1.7.0_80/

Note: The installation path of jdk during oracle installation is specified here, otherwise when oracle starts the interface next, it will be stuck in a certain interface and will not move, there is a vertical line in the middle! ! ! This problem has been bugging me for days! ! !

Wait for a few seconds, the oracle installation interface appears, congratulations, the installation can proceed normally!

15. Solutions for insufficient swap space

Excuting an order:

dd if=/dev/zero of=/opt/swap bs=1024 count=2048000
mkswap /opt/swap
swapon /opt/swap
free -m #View memory status

Next check again

ok, the problem of insufficient swap is solved, check Ignore All to continue next!

The installation of oracle is relatively long, and you can wait patiently.

When the installation reaches 68%, a problem will pop up, click continue.

When the installation reaches 95%, you will be prompted to configure the password of the database administrator account, and you need to execute two commands. Do not close the installation interface. After configuring the password, go directly to the directory and execute it.

Borrow a picture. . .

After installation is complete

[oracle@localhost ~]$ lsnrctl start #Open the listening service

[oracle@localhost ~]$ sqlplus / as sysdba  #登入

SQL> shutdown immediate #Close the database service immediately (usually closed)
SQL> startup #Start the database service (important, must lose)

SQL> exit #exit

 

The writing is not good, please bear with me. Basically, the problems I encountered were solved according to these steps. Linux installation of oracle is indeed a problem. Different Linux versions will encounter various pits. If you have any questions, you can leave a message and ask questions. , I know I will try my best to help you solve it.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324828934&siteId=291194637