Detailed steps to install Oracle Database12C under Linux server without network

Preface

The main purpose of this article is to introduce the installation of OracleDatabase12C under the Linux CentOS7.7 system without network. The emphasis here is to install in a non-network environment mainly because there is no network when installing on a server on the internal network, and the dependency packages required to install the database cannot be downloaded and installed. , If there are any shortcomings, please provide valuable suggestions from the Great God.

1. Mount the image

1. Use the root user to upload the CentOS-7-x86_64-DVD-1908.iso system image to the /home directory.

2. Use the following command to mount the image file in the /home path to the /mnt path.

mount -o loop /home/CentOS-7-x86_64-DVD-1908.iso /mnt

Insert picture description here
Tip: mount: /dev/loop0 is write-protected, mounting read-only means the mounting is successful.

3. You can also use the df -lh command to check whether the mounting is successful.

Insert picture description here

Two, configure the local yum source and install the database dependency package

1. Enter the yum configuration file directory.

cd /etc/yum.repos.d

2. Create a new yum configuration file.

vim CentOS-media.repo

3. Add the following content:

[centos-7]
name=centos7
baseurl=file:///mnt
enabled=1
gpgcheck=0
gpgkey=file:///mnt

4. Modify the file name of Base.repo.

mv CentOS-Base.repo  CentOS-Base.repo.bak

5. Put the packages downloaded by the service in the local cache.

yum makecache

6. Install the dependent packages required by the database.

yum -y install binutils compat-libcap1 gcc gcc-c++ glibc glibc-devel ksh libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel

Three, modify the server name in the hosts file

1. Use the following command to view the name of the machine.

more /proc/sys/kernel/hostname

2. Switch to the /etc path to modify the contents of the hosts file.

cd /etc

vi hosts

Modify the machine name to 127.0.0.1 (if the machine name has not been changed, this step can be omitted)

Insert picture description here

Four, Linux installation Oracle system requirements

1. Physical memory above 4G is recommended.

2. The swap space is generally twice the size of the memory, for example: 1G of memory can be set to 3G size of the swap partition.

3. The hard disk space is at least 5G or more. Use df -h to view the system disk space.

Five, system related parameter modification

To modify the core parameters of the operating system, perform the following steps as the root user:

1. Modify the user's SHELL limit and modify the /etc/security/limits.conf file.
Enter the command: vi /etc/security/limits.conf Press the i key to enter the editing mode, and add the following content to the file.

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

After editing, press Esc and enter: wq to save and exit.

2. Modify the /etc/pam.d/login file and enter the command: vi /etc/pam.d/login Press the i key to enter the editing mode, and add the following content to the file.

session required /lib/security/pam_limits.so 
session required pam_limits.so

After editing, press Esc and enter: wq to save and exit.

3. Modify the linux kernel, modify the /etc/sysctl.conf file, enter the command: vi /etc/sysctl.conf Press the i key to enter the editing mode, and add the following content to the file.

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

After editing, press Esc and enter: wq to save and exit.

4. To make /etc/sysctl.conf change effective immediately, you need to execute the following command:

sysctl -p

5. Edit /etc/profile and enter the command: vi /etc/profile Press the i key to enter the editing mode, and add the following content to the file.

if [ $USER = "oracle" ];
then
if [ $SHELL = "/bin/ksh" ];
then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

After editing, press Esc and enter: wq to save and exit.

Six, create an Oracle user and configure related parameters

1. Use the root user to create related users and groups as the owner of the software installation and support group.
To create a user group, enter the command:

groupadd oinstall

groupadd dba

2. Use the root user to create an Oracle user and password, and enter the command:

useradd -g oinstall -g dba -m oracle

passwd oracle

Then you will be asked to enter the password. Enter the password twice at will, but it must be consistent. Press Enter to confirm.

3. Use the root user to create the database software directory and data file storage directory. The location of the directory is determined according to your own situation. Pay attention to the disk space. Here I put it under the Oracle user, for example:

input the command:

mkdir  /home/oracle/app

mkdir /home/oracle/app/oracle

4. Change the directory owner to be owned by the Oracle user, enter the command:

chown -R oracle:oinstall /home/oracle/app

chmod -R 755 /home/oracle/app/oracle

5. Configure the environment variables of the Oracle user. First, switch to the newly created Oracle user and enter:

su - oracle

Then directly input: vi .bash_profile command, press i to edit .bash_profile, enter the editing mode, and add the following:

umask 022
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/12.2.0/dbhome_1
export ORACLE_SID=orcla
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

After editing, press Esc and enter: wq to save and exit.

6. Execute the following command to make the environment variable take effect immediately.

 source .bash_profile 

Seven, start the installation

1. Upload the installation package to the /home/oracle directory and decompress it. The graphical installation is mainly introduced here.

cd /home/oracle

unzip linuxx64_12201_database.zip

2. Switch root user and execute the following commands.

xhost +

Insert picture description here

3. Switch to the Oracle user and execute the following commands.

su - oracle

export DISPLAY=本机的IP地址:0

xhost +

Insert picture description here

4. Switch to the installation package path and execute the installation program file. After a while, the graphical installation interface will appear.

cd /home/oracle/database

./runInstaller

5. Installation drawings will be uploaded later.

Supplement one, modify the login policy

When the lower version of PLSQL cannot be connected, you can use this method to solve it, and modification is not allowed in the formal environment. Use the Oracle user to perform the following operations:

1. Switch to the relevant configuration file directory.

cd /home/oracle/app/oracle/product/12.2.0/dbhome_1/network/admin

2. Edit the sqlnet.ora file.

vi sqlnet.ora

3. Add some information

SQLNET.ALLOWED_LOGON_VERSION=8

After editing, press Esc and enter: wq to save and exit.

4. The password needs to be reset after changing the login policy.

sqlplus / as sysdba

alter user system identified by a;

Supplement 2: Modify the character set to HS16GBK

sqlplus / as sysdba
shutdown immediate;
STARTUP MOUNT EXCLUSIVE;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
ALTER DATABASE OPEN;
ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK;
ALTER DATABASE NATIONAL CHARACTER SET INTERNAL_USE AL16UTF16;
SHUTDOWN IMMEDIATE;
STARTUP;

Supplement three, modify the character set to AL32UTF8

su - oracle
sqlplus / as sysdba
shutdown immediate;
startup mount;
alter session set sql_trace=true; 
alter system enable restricted session; 
alter system set job_queue_processes=0; 
alter system set aq_tm_processes=0; 
alter database open; 
ALTER DATABASE character set INTERNAL_USE AL32UTF8;
shutdown immediate;
startup;

Supplement 4. Open the graphical configuration monitoring page.

Switch to the Oracle user and execute the netca command.

netca

Guess you like

Origin blog.csdn.net/ZGS_CSDN_YH/article/details/109184654