본문 바로가기

Database/Oracle

03 - 오라클 설치 준비

1. Edit the host file

The computer file hosts is an operating system file that maps hostnames to IP addresses.

You must login as root

<IP-address> <fully-qualified-machine-name> <machine-name>

vi /etc/hosts

 

2. Automatic Setup for oracle prerequisite , no need to do it manually any more.

Run this : yum install -y oracle-database-preinstall-19c

this package do a lot of things, like creating groups and Oracle user

Note: this command is work only for oracle Linux

After ruining, just do the command ID oracle to make sure the oracle user created

https://oracle-base.com/articles/19c/oracle-db-19c-installation-on-oracle-linux-9

 

Oracle Database 19c Installation On Oracle Linux 9 (OL9)

This article describes the installation of Oracle Database 19c 64-bit on Oracle Linux 9 (OL9) 64-bit.

oracle-base.com

 

3. Create directories for oracle software and data

mkdir -p /u01/app/oracle/product/18/db_1

chown -R oracle:oinstall /u01

chmod -R 775 /u01

 

4. Disable firewall

systemctl stop firewalld

systemctl disable firewalld

 

5. passwd oracle

 

 

[bskim@test ~]$ su root
Password: 
[root@test bskim]# hostname
test.com
[root@test bskim]# ifconfig
ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.229  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::20c:29ff:fe7d:5575  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:7d:55:75  txqueuelen 1000  (Ethernet)
        RX packets 47957  bytes 71496764 (68.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 23739  bytes 1584749 (1.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 35  bytes 3213 (3.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 35  bytes 3213 (3.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@test bskim]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.2.229	test.com	test <<== add new information

 

 

 

# Oracle Linux 7 버전은 아래 명령어를 사용.
# yum install -y oracle-database-preinstall-19c


# Oracle Linux 8,9 버전은 아래 명령어를 사용.

Automatic Setup

If you plan to use the "oracle-database-preinstall-19c" package to perform all your prerequisite setup, issue the following command.
# dnf install -y oracle-database-preinstall-19c

It is probably worth doing a full update as well, but this is not strictly speaking necessary.
# dnf update -y

 

 

 

[root@test bskim]# yum install -y oracle-database-preinstall-19c
Last metadata expiration check: 1 day, 1:24:26 ago on Wed 08 Nov 2023 02:04:17 PM GMT.
Dependencies resolved.
===============================================================================
 Package               Arch   Version                  Repository         Size
===============================================================================
Installing:
 oracle-database-preinstall-19c
                       x86_64 1.0-1.el9                ol9_appstream      33 k
Installing dependencies:
 gssproxy              x86_64 0.8.4-5.el9_2            ol9_baseos_latest 119 k
 initscripts           x86_64 10.11.5-1.el9            ol9_baseos_latest 287 k
 keyutils              x86_64 1.6.3-1.el9              ol9_baseos_latest  84 k
 ksh                   x86_64 3:1.0.0~beta.1-2.0.1.el9 ol9_appstream     891 k
 libaio-devel          x86_64 0.3.111-13.el9           ol9_appstream      11 k
 libev                 x86_64 4.33-5.el9               ol9_baseos_latest  53 k
 libnfsidmap           x86_64 1:2.5.4-18.el9           ol9_baseos_latest  71 k
 libnsl                x86_64 2.34-60.0.3.el9_2.7      ol9_baseos_latest  74 k
 libverto-libev        x86_64 0.3.2-3.el9              ol9_baseos_latest  14 k
 lm_sensors-libs       x86_64 3.6.0-10.el9             ol9_appstream      42 k
 nfs-utils             x86_64 1:2.5.4-18.el9           ol9_baseos_latest 514 k
 pcp-conf              x86_64 6.0.1-5.0.3.el9_2        ol9_appstream      37 k
 pcp-libs              x86_64 6.0.1-5.0.3.el9_2        ol9_appstream     634 k
 rpcbind               x86_64 1.2.6-5.el9              ol9_baseos_latest  69 k
 sssd-nfs-idmap        x86_64 2.8.2-3.0.2.el9_2        ol9_baseos_latest  46 k
 sysstat               x86_64 12.5.4-5.0.1.el9         ol9_appstream     539 k

Transaction Summary
===============================================================================
Install  17 Packages

Total download size: 3.4 M
Installed size: 9.5 M
Downloading Packages:
(1/17): gssproxy-0.8.4-5.el9_2.x86_64.rpm      543 kB/s | 119 kB     00:00    
(2/17): keyutils-1.6.3-1.el9.x86_64.rpm        348 kB/s |  84 kB     00:00    
(3/17): libev-4.33-5.el9.x86_64.rpm            966 kB/s |  53 kB     00:00    
(4/17): libnfsidmap-2.5.4-18.el9.x86_64.rpm    1.7 MB/s |  71 kB     00:00    
(5/17): libnsl-2.34-60.0.3.el9_2.7.x86_64.rpm  4.1 MB/s |  74 kB     00:00    
(6/17): libverto-libev-0.3.2-3.el9.x86_64.rpm  875 kB/s |  14 kB     00:00    
(7/17): rpcbind-1.2.6-5.el9.x86_64.rpm         1.0 MB/s |  69 kB     00:00    
(8/17): initscripts-10.11.5-1.el9.x86_64.rpm   777 kB/s | 287 kB     00:00    
(9/17): sssd-nfs-idmap-2.8.2-3.0.2.el9_2.x86_6 1.4 MB/s |  46 kB     00:00    
(10/17): libaio-devel-0.3.111-13.el9.x86_64.rp 188 kB/s |  11 kB     00:00    
(11/17): nfs-utils-2.5.4-18.el9.x86_64.rpm     3.0 MB/s | 514 kB     00:00    
(12/17): lm_sensors-libs-3.6.0-10.el9.x86_64.r 2.9 MB/s |  42 kB     00:00    
(13/17): oracle-database-preinstall-19c-1.0-1. 603 kB/s |  33 kB     00:00    
(14/17): pcp-conf-6.0.1-5.0.3.el9_2.x86_64.rpm 824 kB/s |  37 kB     00:00    
(15/17): pcp-libs-6.0.1-5.0.3.el9_2.x86_64.rpm 3.7 MB/s | 634 kB     00:00    
(16/17): ksh-1.0.0~beta.1-2.0.1.el9.x86_64.rpm 2.4 MB/s | 891 kB     00:00    
(17/17): sysstat-12.5.4-5.0.1.el9.x86_64.rpm   2.1 MB/s | 539 kB     00:00    
-------------------------------------------------------------------------------
Total                                          4.4 MB/s | 3.4 MB     00:00     
Oracle Linux 9 BaseOS Latest (x86_64)          6.1 MB/s | 6.2 kB     00:00    
Importing GPG key 0x8D8B756F:
 Userid     : "Oracle Linux (release key 1) <secalert_us@oracle.com>"
 Fingerprint: 3E6D 826D 3FBA B389 C2F3 8E34 BC4D 06A0 8D8B 756F
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Key imported successfully
Importing GPG key 0x8B4EFBE6:
 Userid     : "Oracle Linux (backup key 1) <secalert_us@oracle.com>"
 Fingerprint: 9822 3175 9C74 6706 5D0C E9B2 A7DD 0708 8B4E FBE6
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                       1/1 
  Installing       : libnfsidmap-1:2.5.4-18.el9.x86_64                    1/17 
  Installing       : pcp-conf-6.0.1-5.0.3.el9_2.x86_64                    2/17 
  Installing       : pcp-libs-6.0.1-5.0.3.el9_2.x86_64                    3/17 
  Installing       : lm_sensors-libs-3.6.0-10.el9.x86_64                  4/17 
  Installing       : sysstat-12.5.4-5.0.1.el9.x86_64                      5/17 
  Running scriptlet: sysstat-12.5.4-5.0.1.el9.x86_64                      5/17 
Created symlink /etc/systemd/system/multi-user.target.wants/sysstat.service → /usr/lib/systemd/system/sysstat.service.
Created symlink /etc/systemd/system/sysstat.service.wants/sysstat-collect.timer → /usr/lib/systemd/system/sysstat-collect.timer.
Created symlink /etc/systemd/system/sysstat.service.wants/sysstat-summary.timer → /usr/lib/systemd/system/sysstat-summary.timer.

  Installing       : libaio-devel-0.3.111-13.el9.x86_64                   6/17 
  Installing       : ksh-3:1.0.0~beta.1-2.0.1.el9.x86_64                  7/17 
  Running scriptlet: ksh-3:1.0.0~beta.1-2.0.1.el9.x86_64                  7/17 
  Running scriptlet: rpcbind-1.2.6-5.el9.x86_64                           8/17 
  Installing       : rpcbind-1.2.6-5.el9.x86_64                           8/17 
  Running scriptlet: rpcbind-1.2.6-5.el9.x86_64                           8/17 
Created symlink /etc/systemd/system/multi-user.target.wants/rpcbind.service → /usr/lib/systemd/system/rpcbind.service.
Created symlink /etc/systemd/system/sockets.target.wants/rpcbind.socket → /usr/lib/systemd/system/rpcbind.socket.

  Installing       : libnsl-2.34-60.0.3.el9_2.7.x86_64                    9/17 
  Installing       : libev-4.33-5.el9.x86_64                             10/17 
  Installing       : libverto-libev-0.3.2-3.el9.x86_64                   11/17 
  Installing       : gssproxy-0.8.4-5.el9_2.x86_64                       12/17 
  Running scriptlet: gssproxy-0.8.4-5.el9_2.x86_64                       12/17 
  Installing       : keyutils-1.6.3-1.el9.x86_64                         13/17 
  Running scriptlet: nfs-utils-1:2.5.4-18.el9.x86_64                     14/17 
  Installing       : nfs-utils-1:2.5.4-18.el9.x86_64                     14/17 
  Running scriptlet: nfs-utils-1:2.5.4-18.el9.x86_64                     14/17 
  Installing       : initscripts-10.11.5-1.el9.x86_64                    15/17 
  Running scriptlet: initscripts-10.11.5-1.el9.x86_64                    15/17 
Created symlink /etc/systemd/system/sysinit.target.wants/import-state.service → /usr/lib/systemd/system/import-state.service.
Created symlink /etc/systemd/system/sysinit.target.wants/loadmodules.service → /usr/lib/systemd/system/loadmodules.service.

  Running scriptlet: oracle-database-preinstall-19c-1.0-1.el9.x86_64     16/17 
  Installing       : oracle-database-preinstall-19c-1.0-1.el9.x86_64     16/17 
  Installing       : sssd-nfs-idmap-2.8.2-3.0.2.el9_2.x86_64             17/17 
  Running scriptlet: oracle-database-preinstall-19c-1.0-1.el9.x86_64     17/17 
  Running scriptlet: sssd-nfs-idmap-2.8.2-3.0.2.el9_2.x86_64             17/17 
  Verifying        : gssproxy-0.8.4-5.el9_2.x86_64                        1/17 
  Verifying        : initscripts-10.11.5-1.el9.x86_64                     2/17 
  Verifying        : keyutils-1.6.3-1.el9.x86_64                          3/17 
  Verifying        : libev-4.33-5.el9.x86_64                              4/17 
  Verifying        : libnfsidmap-1:2.5.4-18.el9.x86_64                    5/17 
  Verifying        : libnsl-2.34-60.0.3.el9_2.7.x86_64                    6/17 
  Verifying        : libverto-libev-0.3.2-3.el9.x86_64                    7/17 
  Verifying        : nfs-utils-1:2.5.4-18.el9.x86_64                      8/17 
  Verifying        : rpcbind-1.2.6-5.el9.x86_64                           9/17 
  Verifying        : sssd-nfs-idmap-2.8.2-3.0.2.el9_2.x86_64             10/17 
  Verifying        : ksh-3:1.0.0~beta.1-2.0.1.el9.x86_64                 11/17 
  Verifying        : libaio-devel-0.3.111-13.el9.x86_64                  12/17 
  Verifying        : lm_sensors-libs-3.6.0-10.el9.x86_64                 13/17 
  Verifying        : oracle-database-preinstall-19c-1.0-1.el9.x86_64     14/17 
  Verifying        : pcp-conf-6.0.1-5.0.3.el9_2.x86_64                   15/17 
  Verifying        : pcp-libs-6.0.1-5.0.3.el9_2.x86_64                   16/17 
  Verifying        : sysstat-12.5.4-5.0.1.el9.x86_64                     17/17 

Installed:
  gssproxy-0.8.4-5.el9_2.x86_64                                                
  initscripts-10.11.5-1.el9.x86_64                                             
  keyutils-1.6.3-1.el9.x86_64                                                  
  ksh-3:1.0.0~beta.1-2.0.1.el9.x86_64                                          
  libaio-devel-0.3.111-13.el9.x86_64                                           
  libev-4.33-5.el9.x86_64                                                      
  libnfsidmap-1:2.5.4-18.el9.x86_64                                            
  libnsl-2.34-60.0.3.el9_2.7.x86_64                                            
  libverto-libev-0.3.2-3.el9.x86_64                                            
  lm_sensors-libs-3.6.0-10.el9.x86_64                                          
  nfs-utils-1:2.5.4-18.el9.x86_64                                              
  oracle-database-preinstall-19c-1.0-1.el9.x86_64                              
  pcp-conf-6.0.1-5.0.3.el9_2.x86_64                                            
  pcp-libs-6.0.1-5.0.3.el9_2.x86_64                                            
  rpcbind-1.2.6-5.el9.x86_64                                                   
  sssd-nfs-idmap-2.8.2-3.0.2.el9_2.x86_64                                      
  sysstat-12.5.4-5.0.1.el9.x86_64                         
  
  Complete!
[root@test bskim]#

 

 

 

[root@test bskim]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
[root@test bskim]# 

# Create directories for oracle software and data
mkdir -p /u01/app/oracle/product/19/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

[root@test bskim]# mkdir -p /u01/app/oracle/product/19/db_1
[root@test bskim]# 

[root@test bskim]# chown -R oracle:oinstall /u01
[root@test bskim]# ll -R /u01
/u01:
total 0
drwxr-xr-x 3 oracle oinstall 20 Nov  9 15:42 app

/u01/app:
total 0
drwxr-xr-x 3 oracle oinstall 21 Nov  9 15:42 oracle

/u01/app/oracle:
total 0
drwxr-xr-x 3 oracle oinstall 16 Nov  9 15:42 product

/u01/app/oracle/product:
total 0
drwxr-xr-x 3 oracle oinstall 18 Nov  9 15:42 19

/u01/app/oracle/product/19:
total 0
drwxr-xr-x 2 oracle oinstall 6 Nov  9 15:42 db_1

/u01/app/oracle/product/19/db_1:
total 0
[root@test bskim]# 


[root@test bskim]# chmod -R 775 /u01
[root@test bskim]# 
[root@test bskim]# ll -R /u01
/u01:
total 0
drwxrwxr-x 3 oracle oinstall 20 Nov  9 15:42 app

/u01/app:
total 0
drwxrwxr-x 3 oracle oinstall 21 Nov  9 15:42 oracle

/u01/app/oracle:
total 0
drwxrwxr-x 3 oracle oinstall 16 Nov  9 15:42 product

/u01/app/oracle/product:
total 0
drwxrwxr-x 3 oracle oinstall 18 Nov  9 15:42 19

/u01/app/oracle/product/19:
total 0
drwxrwxr-x 2 oracle oinstall 6 Nov  9 15:42 db_1

/u01/app/oracle/product/19/db_1:
total 0
[root@test bskim]#

 

 

 

[root@test bskim]# systemctl stop firewalld
[root@test bskim]# systemctl disable firewalld
Removed "/etc/systemd/system/multi-user.target.wants/firewalld.service".
Removed "/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service".
[root@test bskim]# 

[root@test bskim]# passwd oracle
Changing password for user oracle.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@test bskim]#