暂无图片
暂无图片
2
暂无图片
暂无图片
暂无图片

Oracle Linux Server release 7.6 安装 Oracle 19.3(升级到19.16)

原创 虚幻的世界 2023-09-13
220

操作系统和数据库(实例)信息

选项

描述

IP

192.168.164.150

OS Version

Oracle Linux Server release 7.6

DB Version

19.16.0.0.0

Hostname

Linux01

Instance name

orcl

dbname

orcl

pdbname

pdb_orcl

SID

orcl

1.操作系统版本和内核检查

[root@linux01 ~]# cat /etc/oracle-release
Oracle Linux Server release 7.6
[root@linux01 ~]# uname -a
Linux linux01 4.14.35-1818.3.3.el7uek.x86_64 #2 SMP Mon Sep 24 14:45:01 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@linux01 ~]# 

2.检查内存和SWAP大小(建议:内存偏小的使用-m参数)

[root@linux01 ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3678         683        2090          32         905        2690
Swap:          8191           0        8191
[root@linux01 ~]# egrep 'Mem|Swap' /proc/meminfo
MemTotal:        3766620 kB
MemFree:         2140444 kB
MemAvailable:    2755116 kB
SwapCached:            0 kB
SwapTotal:       8388604 kB
SwapFree:        8388604 kB
[root@linux01 ~]# 

3.查看OS运行级别

[root@linux01 ~]# runlevel
N 5
[root@linux01 ~]# 

如果想改运行级别为3,执行(需要问清楚)

#systemctl set-default multi-user.target(运行级别为3)

4.逻辑卷挂载

1.操作系统版本和内核检查

[root@linux01 ~]# cat /etc/oracle-release
Oracle Linux Server release 7.6
[root@linux01 ~]# uname -a
Linux linux01 4.14.35-1818.3.3.el7uek.x86_64 #2 SMP Mon Sep 24 14:45:01 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@linux01 ~]# 
2.检查内存和SWAP大小(建议:内存偏小的使用-m参数)

[root@linux01 ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3678         683        2090          32         905        2690
Swap:          8191           0        8191
[root@linux01 ~]# egrep 'Mem|Swap' /proc/meminfo
MemTotal:        3766620 kB
MemFree:         2140444 kB
MemAvailable:    2755116 kB
SwapCached:            0 kB
SwapTotal:       8388604 kB
SwapFree:        8388604 kB
[root@linux01 ~]# 
3.查看OS运行级别

[root@linux01 ~]# runlevel
N 5
[root@linux01 ~]# 
如果想改运行级别为3,执行(需要问清楚)

#systemctl set-default multi-user.target(运行级别为3)

4.逻辑卷挂载

--查看是否有磁盘没有挂载
[root@linux01 ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000ab67b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     4196351     2097152   83  Linux
/dev/sda2         4196352    20973567     8388608   82  Linux swap / Solaris
/dev/sda3        20973568    41943039    10484736   83  Linux

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
--数据库软件安装目录和数据库数据文件存放目录
[root@linux01 ~]# mkdir /u01
[root@linux01 ~]# mkdir /data
--LVM创建
[root@linux01 ~]# pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created.
[root@linux01 ~]# vgcreate vgoracle /dev/sdb
  Volume group "vgoracle" successfully created
[root@linux01 ~]# lvcreate -n lvoracle -l +100%FREE vgoracle
  Logical volume "lvoracle" created.
[root@linux01 ~]# pvcreate /dev/sdc
  Physical volume "/dev/sdc" successfully created.
[root@linux01 ~]# vgcreate vgdata /dev/sdc
  Volume group "vgdata" successfully created
[root@linux01 ~]# lvcreate -n lvdata -l +100%FREE vgdata
  Logical volume "lvdata" created.
[root@linux01 ~]# pvs
  PV         VG       Fmt  Attr PSize   PFree
  /dev/sdb   vgoracle lvm2 a--  <50.00g    0 
  /dev/sdc   vgdata   lvm2 a--  <50.00g    0 
[root@linux01 ~]# vgs
  VG       #PV #LV #SN Attr   VSize   VFree
  vgdata     1   1   0 wz--n- <50.00g    0 
  vgoracle   1   1   0 wz--n- <50.00g    0 
[root@linux01 ~]# lvs
  LV       VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lvdata   vgdata   -wi-a----- <50.00g                                                    
  lvoracle vgoracle -wi-a----- <50.00g 
--格式化创建的逻辑卷(LVM)
[root@linux01 ~]# mkfs.xfs /dev/mapper/vgoracle-lvoracle
meta-data=/dev/mapper/vgoracle-lvoracle isize=256    agcount=4, agsize=3276544 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0, sparse=0
data     =                       bsize=4096   blocks=13106176, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=6399, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@linux01 ~]# mkfs.xfs /dev/mapper/vgdata-lvdata 
meta-data=/dev/mapper/vgdata-lvdata isize=256    agcount=4, agsize=3276544 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0, sparse=0
data     =                       bsize=4096   blocks=13106176, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=6399, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@linux01 ~]# 
--修改/etc/fstab 文件,实现文件开机自动挂载
[root@linux01 ~]# vim /etc/fstab

#
# /etc/fstab
# Created by anaconda on Wed Sep 13 19:06:05 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=eaf99dcf-fff8-43da-b803-fd9fa91a607d /                       xfs     defaults        0 0 
UUID=90bf0145-4d45-434c-b711-c306cf0ff0d7 /boot                   xfs     defaults        0 0 
UUID=774fd297-813a-4173-a339-cd4454f2b668 swap                    swap    defaults        0 0
# 添加挂载
/dev/mapper/vgdata-lvdata /data  xfs     defaults        0 0  
/dev/mapper/vgoracle-lvoracle /u01  xfs     defaults        0 0
[root@linux01 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        1.8G     0  1.8G   0% /dev
tmpfs           1.8G     0  1.8G   0% /dev/shm
tmpfs           1.8G  9.5M  1.8G   1% /run
tmpfs           1.8G     0  1.8G   0% /sys/fs/cgroup
/dev/sda3        10G  5.1G  5.0G  51% /
/dev/sda1       2.0G  218M  1.8G  11% /boot
tmpfs           368M   12K  368M   1% /run/user/42
tmpfs           368M     0  368M   0% /run/user/0
[root@linux01 ~]# mount -a
[root@linux01 ~]# df -h
Filesystem                     Size  Used Avail Use% Mounted on
devtmpfs                       1.8G     0  1.8G   0% /dev
tmpfs                          1.8G     0  1.8G   0% /dev/shm
tmpfs                          1.8G  9.5M  1.8G   1% /run
tmpfs                          1.8G     0  1.8G   0% /sys/fs/cgroup
/dev/sda3                       10G  5.1G  5.0G  51% /
/dev/sda1                      2.0G  218M  1.8G  11% /boot
tmpfs                          368M   12K  368M   1% /run/user/42
tmpfs                          368M     0  368M   0% /run/user/0
/dev/mapper/vgdata-lvdata       50G   33M   50G   1% /data
/dev/mapper/vgoracle-lvoracle   50G   33M   50G   1% /u01
[root@linux01 ~]# 

5.关闭透明大页

--查看透明大页情况
[root@linux01 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
--在文件中写入下面的内容
[root@linux01 ~]# cat /etc/systemd/system/disable-thp.service
[Unit]
Description=Disable Transparent Huge Pages (THP)
[Service]
Type=simple
ExecStart=/bin/sh -c "echo 'never' >/sys/kernel/mm/transparent_hugepage/enabled && echo 'never' >/sys/kernel/mm/transparent_hugepage/defrag"
[Install]
WantedBy=multi-user.target
[root@linux01 ~]# 
--重启服务
[root@linux01 ~]# systemctl daemon-reload
[root@linux01 ~]# systemctl start disable-thp
[root@linux01 ~]# systemctl enable disable-thp
Created symlink from /etc/systemd/system/multi-user.target.wants/disable-thp.service to /etc/systemd/system/disable-thp.service.
[root@linux01 ~]# systemctl status disable-thp
● disable-thp.service - Disable Transparent Huge Pages (THP)
   Loaded: loaded (/etc/systemd/system/disable-thp.service; enabled; vendor preset: disabled)
   Active: inactive (dead)

Sep 13 21:16:14 linux01 systemd[1]: Started Disable Transparent Huge Pages (THP).
[root@linux01 ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
[root@linux01 ~]# 

6、配置/etc/hosts 文件

[root@linux01 ~]# ifconfig 
ens33: flags=4163  mtu 1500
        inet 192.168.164.150  netmask 255.255.255.0  broadcast 192.168.164.255
        inet6 fe80::c7d9:9031:8114:55de  prefixlen 64  scopeid 0x20
        ether 00:0c:29:95:17:7c  txqueuelen 1000  (Ethernet)
        RX packets 3201  bytes 292336 (285.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1347  bytes 239045 (233.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@linux01 ~]# hostname
linux01
[root@linux01 ~]# ifconfig 
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.164.150 linux01 #添加

7.关闭selinux服务

[root@linux01 ~]# vim /etc/hosts
[root@linux01 ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled #修改成disabled 
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 
--修改之后需要重启服务器生效,下面是临时生效的办法
[root@linux01 ~]# getenforce 
Enforcing
[root@linux01 ~]# setenforce 0
[root@linux01 ~]# getenforce 
Permissive
[root@linux01 ~]# 

8.关闭防火墙服务

[root@linux01 ~]#  systemctl status firewalldfirewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2023-09-13 19:44:54 CST; 1h 44min ago
     Docs: man:firewalld(1)
 Main PID: 5204 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─5204 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Sep 13 19:44:54 linux01 systemd[1]: Starting firewalld - dynamic firewall daemon...
Sep 13 19:44:54 linux01 systemd[1]: Started firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.
[root@linux01 ~]#  systemctl stop firewalld
[root@linux01 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@linux01 ~]#  systemctl status firewalldfirewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

Sep 13 19:44:54 linux01 systemd[1]: Starting firewalld - dynamic firewall daemon...
Sep 13 19:44:54 linux01 systemd[1]: Started firewalld - dynamic firewall daemon.
Sep 13 21:29:18 linux01 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Sep 13 21:29:21 linux01 systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.
[root@linux01 ~]# 

9.关闭NetworkManager服务

[root@linux01 ~]# systemctl status NetworkManager
 NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2023-09-13 19:44:54 CST; 1h 45min ago
     Docs: man:NetworkManager(8)
 Main PID: 5254 (NetworkManager)
   CGroup: /system.slice/NetworkManager.service
           └─5254 /usr/sbin/NetworkManager --no-daemon

Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.4807] device ...)
Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.4825] device ....
Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.4837] device ...)
Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.4839] device ...)
Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.4861] device ....
Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.5252] device ...)
Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.5257] device ...d
Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.5257] device ...0
Sep 13 21:00:33 linux01 NetworkManager[5254]:   [1694610033.3618] device ...d
Sep 13 21:00:43 linux01 NetworkManager[5254]:   [1694610043.6020] device ...d
Hint: Some lines were ellipsized, use -l to show in full.
[root@linux01 ~]# systemctl stop NetworkManager
[root@linux01 ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
Removed symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.
[root@linux01 ~]# systemctl status NetworkManager
 NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled; vendor preset: enabled)
   Active: inactive (dead) since Wed 2023-09-13 21:30:30 CST; 8s ago
     Docs: man:NetworkManager(8)
 Main PID: 5254 (code=exited, status=0/SUCCESS)

Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.5252] device ...)
Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.5257] device ...d
Sep 13 19:44:56 linux01 NetworkManager[5254]:   [1694605496.5257] device ...0
Sep 13 21:00:33 linux01 NetworkManager[5254]:   [1694610033.3618] device ...d
Sep 13 21:00:43 linux01 NetworkManager[5254]:   [1694610043.6020] device ...d
Sep 13 21:30:29 linux01 systemd[1]: Stopping Network Manager...
Sep 13 21:30:29 linux01 NetworkManager[5254]:   [1694611829.9749] caught ....
Sep 13 21:30:29 linux01 NetworkManager[5254]:   [1694611829.9767] device ...0
Sep 13 21:30:29 linux01 NetworkManager[5254]:   [1694611829.9807] exiting...)
Sep 13 21:30:30 linux01 systemd[1]: Stopped Network Manager.
Hint: Some lines were ellipsized, use -l to show in full.
[root@linux01 ~]# 

10.关闭postfix服务

[root@linux01 ~]# vi /etc/postfix/main.cf
inet_protocols = ipv4 #修改成ipv4
[root@linux01 ~]# systemctl status postfix
 postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2023-09-13 19:44:56 CST; 1h 48min ago
 Main PID: 6149 (master)
   CGroup: /system.slice/postfix.service
           ├─2216 pickup -l -t unix -u
           ├─6149 /usr/libexec/postfix/master -w
           └─6158 qmgr -l -t unix -u

Sep 13 19:44:55 linux01 systemd[1]: Starting Postfix Mail Transport Agent...
Sep 13 19:44:56 linux01 postfix/postfix-script[6138]: starting the Postfix mail ...
Sep 13 19:44:56 linux01 postfix/master[6149]: daemon started -- version 2.10.1,...x
Sep 13 19:44:56 linux01 systemd[1]: Started Postfix Mail Transport Agent.
Hint: Some lines were ellipsized, use -l to show in full.
[root@linux01 ~]# systemctl stop postfix
[root@linux01 ~]# systemctl start postfix
[root@linux01 ~]# systemctl stop postfix
[root@linux01 ~]# systemctl disable postfix
Removed symlink /etc/systemd/system/multi-user.target.wants/postfix.service.
[root@linux01 ~]# systemctl status postfix
 postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

Sep 13 19:44:56 linux01 postfix/postfix-script[6138]: starting the Postfix mail ...
Sep 13 19:44:56 linux01 postfix/master[6149]: daemon started -- version 2.10.1,...x
Sep 13 19:44:56 linux01 systemd[1]: Started Postfix Mail Transport Agent.
Sep 13 21:33:54 linux01 systemd[1]: Stopping Postfix Mail Transport Agent...
Sep 13 21:33:54 linux01 systemd[1]: Stopped Postfix Mail Transport Agent.
Sep 13 21:34:02 linux01 systemd[1]: Starting Postfix Mail Transport Agent...
Sep 13 21:34:02 linux01 postfix/master[2664]: daemon started -- version 2.10.1,...x
Sep 13 21:34:02 linux01 systemd[1]: Started Postfix Mail Transport Agent.
Sep 13 21:34:08 linux01 systemd[1]: Stopping Postfix Mail Transport Agent...
Sep 13 21:34:08 linux01 systemd[1]: Stopped Postfix Mail Transport Agent.
Hint: Some lines were ellipsized, use -l to show in full.
[root@linux01 ~]# 

11.关闭cups服务

[root@linux01 ~]# systemctl status cupscups.service - CUPS Printing Service
   Loaded: loaded (/usr/lib/systemd/system/cups.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2023-09-13 19:44:55 CST; 1h 50min ago
 Main PID: 5731 (cupsd)
   CGroup: /system.slice/cups.service
           └─5731 /usr/sbin/cupsd -f

Sep 13 19:44:55 linux01 systemd[1]: Started CUPS Printing Service.
[root@linux01 ~]# systemctl stop cups
Warning: Stopping cups.service, but it can still be activated by:
  cups.path
  cups.socket
[root@linux01 ~]# systemctl disable cups
Removed symlink /etc/systemd/system/multi-user.target.wants/cups.path.
Removed symlink /etc/systemd/system/multi-user.target.wants/cups.service.
Removed symlink /etc/systemd/system/sockets.target.wants/cups.socket.
Removed symlink /etc/systemd/system/printer.target.wants/cups.service.
[root@linux01 ~]# systemctl status cupscups.service - CUPS Printing Service
   Loaded: loaded (/usr/lib/systemd/system/cups.service; disabled; vendor preset: enabled)
   Active: inactive (dead) since Wed 2023-09-13 21:35:14 CST; 11s ago
 Main PID: 5731 (code=exited, status=0/SUCCESS)

Sep 13 19:44:55 linux01 systemd[1]: Started CUPS Printing Service.
Sep 13 21:35:14 linux01 systemd[1]: Stopping CUPS Printing Service...
Sep 13 21:35:14 linux01 systemd[1]: Stopped CUPS Printing Service.
[root@linux01 ~]# 

12.关闭chrony服务

[root@linux01 ~]# systemctl status chronydchronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2023-09-13 19:44:54 CST; 1h 51min ago
     Docs: man:chronyd(8)
           man:chrony.conf(5)
 Main PID: 5095 (chronyd)
   CGroup: /system.slice/chronyd.service
           └─5095 /usr/sbin/chronyd

Sep 13 19:44:53 linux01 systemd[1]: Starting NTP client/server...
Sep 13 19:44:53 linux01 chronyd[5095]: chronyd version 3.2 starting (+CMDMON +...G)
Sep 13 19:44:53 linux01 chronyd[5095]: Frequency 0.000 +/- 1000000.000 ppm rea...ft
Sep 13 19:44:54 linux01 systemd[1]: Started NTP client/server.
Hint: Some lines were ellipsized, use -l to show in full.
[root@linux01 ~]# systemctl stop chronyd
[root@linux01 ~]# systemctl disable chronyd
Removed symlink /etc/systemd/system/multi-user.target.wants/chronyd.service.
[root@linux01 ~]# systemctl status chronydchronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:chronyd(8)
           man:chrony.conf(5)

Sep 13 19:44:53 linux01 systemd[1]: Starting NTP client/server...
Sep 13 19:44:53 linux01 chronyd[5095]: chronyd version 3.2 starting (+CMDMON +...G)
Sep 13 19:44:53 linux01 chronyd[5095]: Frequency 0.000 +/- 1000000.000 ppm rea...ft
Sep 13 19:44:54 linux01 systemd[1]: Started NTP client/server.
Sep 13 21:36:15 linux01 systemd[1]: Stopping NTP client/server...
Sep 13 21:36:15 linux01 systemd[1]: Stopped NTP client/server.
Hint: Some lines were ellipsized, use -l to show in full.
[root@linux01 ~]# 

13.禁用avahi-daemon服务

[root@linux01 ~]# systemctl status avahi-dnsconfd
Unit avahi-dnsconfd.service could not be found.
[root@linux01 ~]# systemctl stop avahi-dnsconfd
Failed to stop avahi-dnsconfd.service: Unit avahi-dnsconfd.service not loaded.
[root@linux01 ~]# systemctl status avahi-daemon
 avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Wed 2023-09-13 21:38:11 CST; 46s ago
 Main PID: 5139 (code=exited, status=0/SUCCESS)
   Status: "avahi-daemon 0.6.31 starting up."

Sep 13 19:44:55 linux01 avahi-daemon[5139]: Registering new address record for ....
Sep 13 19:44:56 linux01 avahi-daemon[5139]: Joining mDNS multicast group on int....
Sep 13 19:44:56 linux01 avahi-daemon[5139]: New relevant interface virbr0.IPv4 ....
Sep 13 19:44:56 linux01 avahi-daemon[5139]: Registering new address record for ....
Sep 13 19:44:57 linux01 avahi-daemon[5139]: Registering new address record for ....
Sep 13 21:38:11 linux01 systemd[1]: Stopping Avahi mDNS/DNS-SD Stack...
Sep 13 21:38:11 linux01 avahi-daemon[5139]: Got SIGTERM, quitting.
Sep 13 21:38:11 linux01 avahi-daemon[5139]: Leaving mDNS multicast group on int....
Sep 13 21:38:11 linux01 avahi-daemon[5139]: Leaving mDNS multicast group on int....
Sep 13 21:38:11 linux01 systemd[1]: Stopped Avahi mDNS/DNS-SD Stack.
Hint: Some lines were ellipsized, use -l to show in full.
[root@linux01 ~]# systemctl stop avahi-daemon
Warning: Stopping avahi-daemon.service, but it can still be activated by:
  avahi-daemon.socket
[root@linux01 ~]# systemctl disable avahi-daemon
Removed symlink /etc/systemd/system/multi-user.target.wants/avahi-daemon.service.
Removed symlink /etc/systemd/system/sockets.target.wants/avahi-daemon.socket.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.Avahi.service.
[root@linux01 ~]# 

14.设置RemoveIPC

在RHEL7.2+平台上,systemd-login服务增加了一个特性在用户完全退出时清除所有的IPC对象,通过/etc/systemd/logind.conf配置文件中的RemoveIPC选项控制。
当最后一个用户断开连接时,OS移除这些用户的共享内存段和信号量,进而导致ASM和DB实例崩溃,oracle linux 默认为no
#This is default for OL7.2
RemoveIPC=no 

15.ORACLE需求软件包检查

--创建目录存放镜像文件和repo文件
[root@linux01 ~]# mkdir -p /data/repo/OracleLinux
[root@linux01 ~]# mkdir -p /data/soft
[root@linux01 ~]# 
--上传镜像到/data/soft/
--挂载镜像文件
[root@linux01 ~]# mount -o loop /data/soft/V980739-01-Oracle-Linux-7.6.iso /mnt/
mount: /dev/loop0 is write-protected, mounting read-only
#拷贝repo文件到/data/repo/OracleLinux
[root@linux01 ~]# cd /mnt
[root@linux01 mnt]# cp -rp * /data/repo/OracleLinux
[root@linux01 mnt]# 
--创建本地yum源
[root@linux01 mnt]# cd /etc/yum.repos.d/
[root@linux01 yum.repos.d]# ls
public-yum-ol7.repo
[root@linux01 yum.repos.d]# mkdir bk
[root@linux01 yum.repos.d]# mv *.repo bk
[root@linux01 yum.repos.d]# ls
bk
[root@linux01 yum.repos.d]# vim myrepo.repo
[local]
name=My Awesome Repo
baseurl=file:///data/repo/OracleLinux
enabled=1
gpgcheck=0
[root@linux01 yum.repos.d]# yum clean all
Loaded plugins: langpacks, ulninfo
Cleaning repos: local
[root@linux01 yum.repos.d]# yum makecache
Loaded plugins: langpacks, ulninfo
local                                                       | 3.6 kB  00:00:00     
(1/4): local/group_gz                                       | 144 kB  00:00:00     
(2/4): local/filelists_db                                   | 3.8 MB  00:00:00     
(3/4): local/primary_db                                     | 5.0 MB  00:00:00     
(4/4): local/other_db                                       | 1.6 MB  00:00:00     
Metadata Cache Created
[root@linux01 yum.repos.d]#
--安装软件依赖包
[root@linux01 yum.repos.d]# yum -y install compat-libcap1 compat-libstdc++-33 elfutils-libelf-devel glibc-devel ksh fontconfig-devel libaio-devel libXrender-devel gcc-c++ librdmacm-devel libstdc++-devel python-configshell python-rtslib targetcli
Loaded plugins: langpacks, ulninfo
Package compat-libcap1-1.10-7.el7.x86_64 already installed and latest version
Package compat-libstdc++-33-3.2.3-72.el7.x86_64 already installed and latest version
Package glibc-devel-2.17-260.0.9.el7.x86_64 already installed and latest version
Package gcc-c++-4.8.5-36.0.1.el7.x86_64 already installed and latest version
Package libstdc++-devel-4.8.5-36.0.1.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package elfutils-libelf-devel.x86_64 0:0.172-2.el7 will be installed
--> Processing Dependency: pkgconfig(zlib) for package: elfutils-libelf-devel-0.172-2.el7.x86_64
---> Package fontconfig-devel.x86_64 0:2.13.0-4.3.el7 will be installed
--> Processing Dependency: pkgconfig(freetype2) >= 20.0.14 for package: fontconfig-devel-2.13.0-4.3.el7.x86_64
--> Processing Dependency: freetype-devel >= 2.8-7 for package: fontconfig-devel-2.13.0-4.3.el7.x86_64
--> Processing Dependency: pkgconfig(uuid) for package: fontconfig-devel-2.13.0-4.3.el7.x86_64
--> Processing Dependency: pkgconfig(expat) for package: fontconfig-devel-2.13.0-4.3.el7.x86_64
---> Package ksh.x86_64 0:20120801-139.0.1.el7 will be installed
---> Package libXrender-devel.x86_64 0:0.9.10-1.el7 will be installed
---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
---> Package python-configshell.noarch 1:1.1.fb23-5.0.1.el7 will be installed
--> Processing Dependency: python-urwid for package: 1:python-configshell-1.1.fb23-5.0.1.el7.noarch
--> Processing Dependency: pyparsing for package: 1:python-configshell-1.1.fb23-5.0.1.el7.noarch
---> Package python-rtslib.noarch 0:2.1.fb63-13.0.1.el7 will be installed
--> Processing Dependency: python-kmod for package: python-rtslib-2.1.fb63-13.0.1.el7.noarch
---> Package rdma-core-devel.x86_64 0:17.2-3.el7 will be installed
---> Package targetcli.noarch 0:2.1.fb46-7.el7 will be installed
--> Running transaction check
---> Package expat-devel.x86_64 0:2.1.0-10.el7_3 will be installed
---> Package freetype-devel.x86_64 0:2.8-12.el7 will be installed
--> Processing Dependency: pkgconfig(libpng) for package: freetype-devel-2.8-12.el7.x86_64
---> Package libuuid-devel.x86_64 0:2.23.2-59.el7 will be installed
---> Package pyparsing.noarch 0:1.5.6-9.el7 will be installed
---> Package python-kmod.x86_64 0:0.9-4.el7 will be installed
---> Package python-urwid.x86_64 0:1.1.1-3.el7 will be installed
---> Package zlib-devel.x86_64 0:1.2.7-18.el7 will be installed
--> Running transaction check
---> Package libpng-devel.x86_64 2:1.5.13-7.el7_2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================
 Package                    Arch        Version                   Repository  Size
===================================================================================
Installing:
 elfutils-libelf-devel      x86_64      0.172-2.el7               local       38 k
 fontconfig-devel           x86_64      2.13.0-4.3.el7            local      137 k
 ksh                        x86_64      20120801-139.0.1.el7      local      883 k
 libXrender-devel           x86_64      0.9.10-1.el7              local       16 k
 libaio-devel               x86_64      0.3.109-13.el7            local       12 k
 python-configshell         noarch      1:1.1.fb23-5.0.1.el7      local       67 k
 python-rtslib              noarch      2.1.fb63-13.0.1.el7       local      100 k
 rdma-core-devel            x86_64      17.2-3.el7                local      207 k
 targetcli                  noarch      2.1.fb46-7.el7            local       66 k
Installing for dependencies:
 expat-devel                x86_64      2.1.0-10.el7_3            local       56 k
 freetype-devel             x86_64      2.8-12.el7                local      446 k
 libpng-devel               x86_64      2:1.5.13-7.el7_2          local      121 k
 libuuid-devel              x86_64      2.23.2-59.el7             local       91 k
 pyparsing                  noarch      1.5.6-9.el7               local       93 k
 python-kmod                x86_64      0.9-4.el7                 local       56 k
 python-urwid               x86_64      1.1.1-3.el7               local      653 k
 zlib-devel                 x86_64      1.2.7-18.el7              local       49 k

Transaction Summary
===================================================================================
Install  9 Packages (+8 Dependent packages)

Total download size: 3.0 M
Installed size: 12 M
Downloading packages:
-----------------------------------------------------------------------------------
Total                                                 181 MB/s | 3.0 MB  00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : zlib-devel-1.2.7-18.el7.x86_64                                 1/17 
  Installing : 2:libpng-devel-1.5.13-7.el7_2.x86_64                           2/17 
  Installing : freetype-devel-2.8-12.el7.x86_64                               3/17 
  Installing : python-urwid-1.1.1-3.el7.x86_64                                4/17 
  Installing : expat-devel-2.1.0-10.el7_3.x86_64                              5/17 
  Installing : python-kmod-0.9-4.el7.x86_64                                   6/17 
  Installing : python-rtslib-2.1.fb63-13.0.1.el7.noarch                       7/17 
  Installing : pyparsing-1.5.6-9.el7.noarch                                   8/17 
  Installing : 1:python-configshell-1.1.fb23-5.0.1.el7.noarch                 9/17 
  Installing : libuuid-devel-2.23.2-59.el7.x86_64                            10/17 
  Installing : fontconfig-devel-2.13.0-4.3.el7.x86_64                        11/17 
  Installing : targetcli-2.1.fb46-7.el7.noarch                               12/17 
  Installing : elfutils-libelf-devel-0.172-2.el7.x86_64                      13/17 
  Installing : libaio-devel-0.3.109-13.el7.x86_64                            14/17 
  Installing : libXrender-devel-0.9.10-1.el7.x86_64                          15/17 
  Installing : rdma-core-devel-17.2-3.el7.x86_64                             16/17 
  Installing : ksh-20120801-139.0.1.el7.x86_64                               17/17 
  Verifying  : elfutils-libelf-devel-0.172-2.el7.x86_64                       1/17 
  Verifying  : ksh-20120801-139.0.1.el7.x86_64                                2/17 
  Verifying  : 2:libpng-devel-1.5.13-7.el7_2.x86_64                           3/17 
  Verifying  : fontconfig-devel-2.13.0-4.3.el7.x86_64                         4/17 
  Verifying  : python-rtslib-2.1.fb63-13.0.1.el7.noarch                       5/17 
  Verifying  : rdma-core-devel-17.2-3.el7.x86_64                              6/17 
  Verifying  : libXrender-devel-0.9.10-1.el7.x86_64                           7/17 
  Verifying  : targetcli-2.1.fb46-7.el7.noarch                                8/17 
  Verifying  : zlib-devel-1.2.7-18.el7.x86_64                                 9/17 
  Verifying  : libuuid-devel-2.23.2-59.el7.x86_64                            10/17 
  Verifying  : freetype-devel-2.8-12.el7.x86_64                              11/17 
  Verifying  : libaio-devel-0.3.109-13.el7.x86_64                            12/17 
  Verifying  : 1:python-configshell-1.1.fb23-5.0.1.el7.noarch                13/17 
  Verifying  : pyparsing-1.5.6-9.el7.noarch                                  14/17 
  Verifying  : python-kmod-0.9-4.el7.x86_64                                  15/17 
  Verifying  : expat-devel-2.1.0-10.el7_3.x86_64                             16/17 
  Verifying  : python-urwid-1.1.1-3.el7.x86_64                               17/17 

Installed:
  elfutils-libelf-devel.x86_64 0:0.172-2.el7                                       
  fontconfig-devel.x86_64 0:2.13.0-4.3.el7                                         
  ksh.x86_64 0:20120801-139.0.1.el7                                                
  libXrender-devel.x86_64 0:0.9.10-1.el7                                           
  libaio-devel.x86_64 0:0.3.109-13.el7                                             
  python-configshell.noarch 1:1.1.fb23-5.0.1.el7                                   
  python-rtslib.noarch 0:2.1.fb63-13.0.1.el7                                       
  rdma-core-devel.x86_64 0:17.2-3.el7                                              
  targetcli.noarch 0:2.1.fb46-7.el7                                                

Dependency Installed:
  expat-devel.x86_64 0:2.1.0-10.el7_3      freetype-devel.x86_64 0:2.8-12.el7      
  libpng-devel.x86_64 2:1.5.13-7.el7_2     libuuid-devel.x86_64 0:2.23.2-59.el7    
  pyparsing.noarch 0:1.5.6-9.el7           python-kmod.x86_64 0:0.9-4.el7          
  python-urwid.x86_64 0:1.1.1-3.el7        zlib-devel.x86_64 0:1.2.7-18.el7        

Complete!
[root@linux01 yum.repos.d]# 

16.设置SSH(可选)

[root@linux01 ~]# vi /etc/profile
#找到export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL 这行 ,在上面添加
TMOUT=600
HISTSIZE=3000
HISTTIMEFORMAT="%Y-%M-%D %H:%M:%S"

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL TMOUT HISTTIMEFORMAT
[root@linux01 ~]# source /etc/profile

[root@linux01 ~]# vi /etc/ssh/sshd_config
LoginGraceTime 0   #添加
[root@linux01 ~]# 

17.配置ntp服务(可选)

[root@linux01 yum.repos.d]# yum -y install ntp
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package ntp.x86_64 0:4.2.6p5-28.0.1.el7 will be installed
--> Processing Dependency: libopts.so.25()(64bit) for package: ntp-4.2.6p5-28.0.1.el7.x86_64
--> Running transaction check
---> Package autogen-libopts.x86_64 0:5.18-5.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================
 Package                Arch          Version                   Repository    Size
===================================================================================
Installing:
 ntp                    x86_64        4.2.6p5-28.0.1.el7        local        548 k
Installing for dependencies:
 autogen-libopts        x86_64        5.18-5.el7                local         65 k

Transaction Summary
===================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 613 k
Installed size: 1.5 M
Downloading packages:
-----------------------------------------------------------------------------------
Total                                                 158 MB/s | 613 kB  00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : autogen-libopts-5.18-5.el7.x86_64                               1/2 
  Installing : ntp-4.2.6p5-28.0.1.el7.x86_64                                   2/2 
  Verifying  : autogen-libopts-5.18-5.el7.x86_64                               1/2 
  Verifying  : ntp-4.2.6p5-28.0.1.el7.x86_64                                   2/2 

Installed:
  ntp.x86_64 0:4.2.6p5-28.0.1.el7                                                  

Dependency Installed:
  autogen-libopts.x86_64 0:5.18-5.el7                                              

Complete!
[root@linux01 yum.repos.d]# vi /etc/ntp.conf
#server 0.rhel.pool.ntp.org iburst  #注释掉
#server 1.rhel.pool.ntp.org iburst  #注释掉
#server 2.rhel.pool.ntp.org iburst  #注释掉
#server 3.rhel.pool.ntp.org iburst  #注释掉
server *.*.*.* prefer   #添加*.*.*.* 这个是NTP服务器的IP地址
restrict  *.*.*.0 mask 255.255.255.255 nomodify notrap #添加 *.*.* 修改
broadcastdelay 0.008
vi /etc/sysconfig/ntpd
# Command line options for ntpd
OPTIONS="-g"
SYNC_HWCLOCK=yes #添加
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid -g" #添加
[root@linux01 yum.repos.d]# systemctl enable ntpd
Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.
[root@linux01 yum.repos.d]# /usr/sbin/ntpdate -us *.*.*.*;hwclock -w;  -手动同步 *.*.*.* 这个是NTP服务器的IP地址
[root@linux01 yum.repos.d]# systemctl restart ntpd
[root@linux01 yum.repos.d]# ntpq -p

18.设置系统日志保留时间(可选)

[root@linux01 yum.repos.d]# vi /etc/logrotate.conf
# keep 4 weeks worth of backlogs
rotate 53 ##保留1年

19.配置内核参数和网络参数

PS:在Linux 7上,建议在/etc/sysctl.d/下创建一个配置文件而不是直接修改/etc/sysctl.conf配置文件
vi /etc/sysctl.d/99-xoracledatabase-sysctl.conf
kernel.core_uses_pid = 1
kernel.shmall = 1048576  #kernel.shmall =memory/4*1024*1024
kernel.shmmax = 3221225472  #kernel.shmmax=(memory/2+1)*1024^3
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 3145728
fs.file-max = 6815744
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_forward = 0
net.ipv4.conf.default.accept_source_route = 0
vm.nr_hugepages = 1025    #HugePages_Total= memory/2*1024/2+4
vm.swappiness = 5
kernel.panic_on_oops = 1
vm.max_map_count = 262144
net.ipv4.ipfrag_high_thresh = 16777216
net.ipv4.ipfrag_low_thresh = 15728640
kernel.randomize_va_space=0
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

--生效
[root@linux01 yum.repos.d]# sysctl --system
* Applying /usr/lib/sysctl.d/00-system.conf ...
* Applying /usr/lib/sysctl.d/10-default-yama-scope.conf ...
kernel.yama.ptrace_scope = 0
* Applying /usr/lib/sysctl.d/50-default.conf ...
kernel.sysrq = 16
kernel.core_uses_pid = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.promote_secondaries = 1
net.ipv4.conf.all.promote_secondaries = 1
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
* Applying /usr/lib/sysctl.d/60-libvirtd.conf ...
fs.aio-max-nr = 1048576
* Applying /etc/sysctl.d/99-sysctl.conf ...
* Applying /etc/sysctl.d/99-xoracledatabase-sysctl.conf ...
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.shmall = 1048576  #kernel.shmall =memory/4*1024*1024
kernel.shmmax = 3221225472  #kernel.shmmax=(memory/2+1)*1024^3
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 3145728
fs.file-max = 6815744
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_forward = 0
net.ipv4.conf.default.accept_source_route = 0
vm.nr_hugepages = 1025    #HugePages_Total= memory/2*1024/2+4
vm.swappiness = 5
kernel.panic_on_oops = 1
vm.max_map_count = 262144
net.ipv4.ipfrag_high_thresh = 16777216
net.ipv4.ipfrag_low_thresh = 15728640
kernel.randomize_va_space = 0
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
* Applying /etc/sysctl.conf ...
[root@linux01 yum.repos.d]# 

20.创建用户和组

[root@linux01 yum.repos.d]# id oracle
id: oracle: no such user
[root@linux01 yum.repos.d]# groupadd -g 1010 oinstall
[root@linux01 yum.repos.d]# groupadd -g 1011 dba
[root@linux01 yum.repos.d]# groupadd -g 1012 asmdba
[root@linux01 yum.repos.d]# groupadd -g 1013 backupdba
[root@linux01 yum.repos.d]# groupadd -g 1014 dgdba
[root@linux01 yum.repos.d]# groupadd -g 1015 kmdba
[root@linux01 yum.repos.d]# groupadd -g 1016 racdba
[root@linux01 yum.repos.d]# groupadd -g 1017 oper
[root@linux01 yum.repos.d]# useradd -u 1101 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper  oracle
[root@linux01 yum.repos.d]# passwd oracle
Changing password for user oracle.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@linux01 yum.repos.d]# 

21.创建数据库软件目录

–-数据库家目录
[root@linux01 yum.repos.d]# mkdir -p /u01/app/oracle/product/19.3.0/db_1 
[root@linux01 yum.repos.d]# chown -R oracle.oinstall /u01
[root@linux01 yum.repos.d]# chmod -R 755 /u01
--数据库表空间目录
[root@linux01 yum.repos.d]# mkdir -p /data/oradata
--默认闪回空间
[root@linux01 yum.repos.d]# mkdir -p /data/fast_recovery_area
--orcl 这个是实例名,归档日志路径
[root@linux01 yum.repos.d]# mkdir -p /data/archlog/orcl
[root@linux01 yum.repos.d]# chown -R oracle:oinstall /data/oradata
[root@linux01 yum.repos.d]# chown -R oracle:oinstall /data/fast_recovery_area 
[root@linux01 yum.repos.d]# chown -R oracle:oinstall /data/archlog/orcl
[root@linux01 yum.repos.d]# chown -R oracle:oinstall /data/soft
[root@linux01 yum.repos.d]# chmod -R 755 /data
[root@linux01 yum.repos.d]# 

22.配置用户登录权限

--配置/etc/pam.d/login文件
[root@linux01 ~]#/etc/pam.d/login
#添加
session required pam_limits.so


--配置用户shell limits
[root@linux01 ~]# vi /etc/security/limits.conf
#添加
# End of file
oracle soft nproc 16384
oracle hard nproc 16384 
oracle soft nofile 65536 
oracle hard nofile 65536 
oracle soft stack 10240 
oracle hard stack 32768 
oracle soft memlock 3145728  #memory*0.9*1024*1024 向下取整
oracle hard memlock 3145728 #memory*0.9*1024*1024 向下取整


--配置oracle.sh 文件
[root@linux01 ~]# vi /etc/profile.d/oracle.sh
#添加
if [ "\$USER" = "oracle" ] || [ "\$USER" = "grid" ]; then 
        if [ "\$SHELL" = "/bin/ksh" ];then 
                ulimit -p 16384 
                ulimit -n 65536 
        else 
                ulimit -u 16384 -n 65536 
        fi 
fi

--验证
[root@linux01 ~]# su - oracle
[oracle@linux01 ~]$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 14578
max locked memory       (kbytes, -l) 3145728
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 16384
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

23.配置环境变量

[oracle@linux01 ~]$ vim ~/.bash_profile
#添加
umask 022
export TMP=/tmp
export TMPDIR=/tmp
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/db_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
stty -istrip tab3 -clocal echoe 
stty erase ^H
cd $ORACLE_HOME
echo '' 
echo 'ORACLE_SID = : '$ORACLE_SID 
echo ''

--生效 
[oracle@linux01 ~]$ source ~/.bash_profile

ORACLE_SID = : orcl

[oracle@linux01 db_1]$ exit[root@linux01 ~]# 

24.远程环境配置(图形化选择)

--使用root用户安装VNC软件
[root@linux01 ~]# yum install tigervnc-server -y
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package tigervnc-server.x86_64 0:1.8.0-13.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================
 Package                 Arch           Version                Repository     Size
===================================================================================
Installing:
 tigervnc-server         x86_64         1.8.0-13.el7           local         214 k

Transaction Summary
===================================================================================
Install  1 Package

Total download size: 214 k
Installed size: 509 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : tigervnc-server-1.8.0-13.el7.x86_64                             1/1 
  Verifying  : tigervnc-server-1.8.0-13.el7.x86_64                             1/1 

Installed:
  tigervnc-server.x86_64 0:1.8.0-13.el7                                            

Complete!

25.重启服务器

[root@linux01 ~]# reboot

26.远程连接服务器(VNC)

[root@linux01 ~]# su - oracle
Last login: Wed Sep 13 22:35:14 CST 2023 on pts/0

ORACLE_SID = : orcl

[oracle@linux01 db_1]$ vncserver 

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? y
Password:
Verify:
xauth:  file /home/oracle/.Xauthority does not exist

New 'linux01:1 (oracle)' desktop is linux01:1

Creating default startup script /home/oracle/.vnc/xstartup
Creating default config /home/oracle/.vnc/config
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/linux01:1.log

[oracle@linux01 db_1]$ 

27.安装数据库软件

--找到文件上传的目录
[oracle@linux01 19.3.0]$ cd /data/soft
--解压数据库软件到数据库家目录
[oracle@linux01 soft]$ unzip -qd /u01/app/oracle/product/19.3.0/db_1/   LINUX.X64_193000_db_home.zip
--进入ORACLE_HOME 安装数据库软件
[oracle@linux01 soft]$ cd $ORACLE_HOME
[oracle@linux01 db_1]$ ls
addnode     dbjava       hs             md       ords     rdbms          sqlj
apex        dbs          install        mgw      oss      relnotes       sqlpatch
assistants  deinstall    instantclient  network  oui      root.sh        sqlplus
bin         demo         inventory      nls      owm      root.sh.old    srvm
clone       diagnostics  javavm         odbc     perl     root.sh.old.1  suptools
crs         dmu          jdbc           olap     plsql    runInstaller   ucp
css         drdaas       jdk            OPatch   precomp  schagent.conf  usm
ctx         dv           jlib           opmn     QOpatch  sdk            utl
cv          env.ora      ldap           oracore  R        slax           wwg
data        has          lib            ord      racg     sqldeveloper   xdk
[oracle@linux01 db_1]$ ./runInstaller 图我就不放了,我这只安装了数据库软件,没有dbca建库

28.数据库升级

--上传升级包到/data/soft目录下,解压
[oracle@linux01 34133642]$ cd /data/soft/
[oracle@linux01 34133642]$ unzip p34133642_190000_Linux-x86-64.zip
[oracle@linux01 soft]$ cd 34133642/
--检查冲突
[oracle@linux01 34133642]$  opatch prereq CheckConflictAgainstOHWithDetail -ph  ./
Oracle Interim Patch Installer version 12.2.0.1.30
Copyright (c) 2023, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/19.3.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.3.0/db_1/oraInst.loc
OPatch version    : 12.2.0.1.30
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatch/opatch2023-09-13_23-05-27PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
--正式升级
[oracle@linux01 34133642]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.30
Copyright (c) 2023, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.3.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.3.0/db_1/oraInst.loc
OPatch version    : 12.2.0.1.30
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatch/opatch2023-09-13_23-06-27PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   34133642  

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/19.3.0/db_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '34133642' to OH '/u01/app/oracle/product/19.3.0/db_1'
ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.ons.cclient, 19.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 19.0.0.0.0 ] , [ oracle.sdo.companion, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ]  not present in the Oracle Home or a higher version is found.
Patching component oracle.bali.jewt, 11.1.1.6.0...

Patching component oracle.bali.ewt, 11.1.1.6.0...

Patching component oracle.help.ohj, 11.1.1.7.0...

Patching component oracle.perlint, 5.28.1.0.0...

Patching component oracle.rdbms.locator, 19.0.0.0.0...

Patching component oracle.perlint.expat, 2.0.1.0.4...

Patching component oracle.rdbms.rsf, 19.0.0.0.0...

Patching component oracle.rdbms, 19.0.0.0.0...

Patching component oracle.rdbms.util, 19.0.0.0.0...

Patching component oracle.assistants.acf, 19.0.0.0.0...

Patching component oracle.assistants.deconfig, 19.0.0.0.0...

Patching component oracle.assistants.server, 19.0.0.0.0...

Patching component oracle.buildtools.rsf, 19.0.0.0.0...

Patching component oracle.ctx, 19.0.0.0.0...

Patching component oracle.dbdev, 19.0.0.0.0...

Patching component oracle.dbjava.ic, 19.0.0.0.0...

Patching component oracle.dbjava.jdbc, 19.0.0.0.0...

Patching component oracle.dbjava.ucp, 19.0.0.0.0...

Patching component oracle.duma, 19.0.0.0.0...

Patching component oracle.javavm.client, 19.0.0.0.0...

Patching component oracle.ldap.owm, 19.0.0.0.0...

Patching component oracle.ldap.rsf, 19.0.0.0.0...

Patching component oracle.ldap.security.osdt, 19.0.0.0.0...

Patching component oracle.marvel, 19.0.0.0.0...

Patching component oracle.network.rsf, 19.0.0.0.0...

Patching component oracle.odbc.ic, 19.0.0.0.0...

Patching component oracle.oracore.rsf, 19.0.0.0.0...

Patching component oracle.precomp.common.core, 19.0.0.0.0...

Patching component oracle.rdbms.crs, 19.0.0.0.0...

Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...

Patching component oracle.rdbms.deconfig, 19.0.0.0.0...

Patching component oracle.rdbms.oci, 19.0.0.0.0...

Patching component oracle.rhp.db, 19.0.0.0.0...

Patching component oracle.sdo, 19.0.0.0.0...

Patching component oracle.sdo.locator.jrf, 19.0.0.0.0...

Patching component oracle.sqlplus, 19.0.0.0.0...

Patching component oracle.sqlplus.ic, 19.0.0.0.0...

Patching component oracle.wwg.plsql, 19.0.0.0.0...

Patching component oracle.ctx.rsf, 19.0.0.0.0...

Patching component oracle.ons, 19.0.0.0.0...

Patching component oracle.rdbms.rman, 19.0.0.0.0...

Patching component oracle.rdbms.install.plugins, 19.0.0.0.0...

Patching component oracle.rdbms.scheduler, 19.0.0.0.0...

Patching component oracle.dbtoolslistener, 19.0.0.0.0...

Patching component oracle.nlsrtl.rsf, 19.0.0.0.0...

Patching component oracle.rdbms.install.common, 19.0.0.0.0...

Patching component oracle.ons.ic, 19.0.0.0.0...

Patching component oracle.install.deinstalltool, 19.0.0.0.0...

Patching component oracle.oraolap, 19.0.0.0.0...

Patching component oracle.javavm.server, 19.0.0.0.0...

Patching component oracle.rdbms.hsodbc, 19.0.0.0.0...

Patching component oracle.rdbms.hs_common, 19.0.0.0.0...

Patching component oracle.precomp.rsf, 19.0.0.0.0...

Patching component oracle.xdk.rsf, 19.0.0.0.0...

Patching component oracle.ldap.client, 19.0.0.0.0...

Patching component oracle.odbc, 19.0.0.0.0...

Patching component oracle.oraolap.api, 19.0.0.0.0...

Patching component oracle.ldap.rsf.ic, 19.0.0.0.0...

Patching component oracle.ctx.atg, 19.0.0.0.0...

Patching component oracle.rdbms.drdaas, 19.0.0.0.0...

Patching component oracle.mgw.common, 19.0.0.0.0...

Patching component oracle.xdk.xquery, 19.0.0.0.0...

Patching component oracle.rdbms.dv, 19.0.0.0.0...

Patching component oracle.xdk.parser.java, 19.0.0.0.0...

Patching component oracle.ovm, 19.0.0.0.0...

Patching component oracle.xdk, 19.0.0.0.0...

Patching component oracle.oraolap.dbscripts, 19.0.0.0.0...

Patching component oracle.network.client, 19.0.0.0.0...

Patching component oracle.rdbms.lbac, 19.0.0.0.0...

Patching component oracle.ldap.ssl, 19.0.0.0.0...

Patching component oracle.sdo.locator, 19.0.0.0.0...

Patching component oracle.network.listener, 19.0.0.0.0...

Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0...

Patching component oracle.precomp.common, 19.0.0.0.0...

Patching component oracle.precomp.lang, 19.0.0.0.0...

Patching component oracle.jdk, 1.8.0.201.0...
Patch 34133642 successfully applied.
Sub-set patch [29517242] has become inactive due to the application of a super-set patch [34133642].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatch/opatch2023-09-13_23-06-27PM_1.log

OPatch succeeded.
[oracle@linux01 34133642]$

--验证
[oracle@linux01 34133642]$ opatch lspatches
34133642;Database Release Update : 19.16.0.0.220719 (34133642)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)

OPatch succeeded.
[oracle@linux01 34133642]$ opatch lsinventory

29.dbca建库

[oracle@linux01 ~]$ dbca
图我就不放了

30.静态监听配置

[oracle@linux01 ~]$ netmgr
图我就不放了
[oracle@linux01 admin]$ cd $ORACLE_HOME/network/admin
[oracle@linux01 admin]$ vi sqlnet.ora
#添加
SQLNET.ALLOWED_LOGON_VERSION_SERVER=9
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=9

[oracle@linux01 admin]$ lsnrctl start

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 13-SEP-2023 12:04:09

Copyright (c) 1991, 2022, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/19.3.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.3.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/linux01/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.164.129)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.164.129)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                13-SEP-2023 12:04:09
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/linux01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.164.129)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

31.参数调整

每家公司都不一样,根据公司的要求来

32.定时任务设置

根据实际的情况来,公司不一样,设置的标准不一样





「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论