DB

[RedHat 7.5] Oracle 18c XE Install

검은체리 2020. 2. 28. 11:56

0. 설치 파일 준비 

oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
oracle-database-xe-18c-1.0-1.x86_64.rpm

1. Using Subscription-Manager

subscription-manager repos --enable=rhel-7-server-optional-rpms

2. Install prerequisite software packages using yum command.

yum -y install glibc-devel libaio-devel libstdc++-devel compat-libcap1 compat-libstdc++-33 ksh

3. Install oracle-database-preinstall 

[root@localhost db]# rpm -ivh oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
warning: oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...  ################################# [100%]
Updating / installing...    
1:oracle-database-preinstall-18c-1.################################# [100%]
[root@localhost db]# rpm -qa | grep oracle-database-preinstall-18c
oracle-database-preinstall-18c-1.0-1.el7.x86_64

4. Install oracle-database 18c

[root@localhost db]# rpm -ivh oracle-database-xe-18c-1.0-1.x86_64.rpm 
warning: oracle-database-xe-18c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                 ################################# [100%]
Updating / installing...    
1:oracle-database-xe-18c-1.0-1 ################################# [100%]

5. Edit oracle-xe-18c.conf

[root@dlp ~]# vi /etc/sysconfig/oracle-xe-18c.conf
# change default settings if you need
# listening port for Listener
LISTENER_PORT=1521

6. Install oracle-database 18c

[root@localhost opt]# /etc/init.d/oracle-xe-18c configure
Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts: Password cannot be null.
Enter password: system
Confirm the password: system
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database XE.
[WARNING] [DBT-11209] Current available memory is less than the required available memory (726MB) for creating the database.
   CAUSE: Following nodes do not have required available memory :
 Node:localhost         Available memory:480.7969MB (492336.0KB)

Enter SYS user password: 
*******
Enter SYSTEM user password: 
******
Enter PDBADMIN User Password: 
*******
Prepare for db operation
7% complete
Copying database files
29% complete
Creating and starting Oracle instance
30% complete
31% complete
34% complete
38% complete
41% complete
43% complete
Completing Database Creation
47% complete
50% complete
Creating Pluggable Databases
54% complete
71% complete
Executing Post Configuration Actions
93% complete
Running Custom Scripts
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/XE.
Database Information:
Global Database Name:XE
System Identifier(SID):XE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/XE/XE.log" for further details.

Connect to Oracle Database using one of the connect strings:
     Pluggable database: localhost.localdomain/XEPDB1
     Multitenant container database: localhost.localdomain
Use https://localhost:5500/em to access Oracle Enterprise Manager for Oracle Database XE
[root@localhost dbhomeXE]# passwd oracle
Changing password for user oracle.
New password: oracle
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: oracle 
passwd: all authentication tokens updated successfully. 

7. Reboot and Login as oracle

[root@dcbsdb1 ~]# su oracle
[oracle@dcbsdb1 ~]$
[oracle@localhost ~]$ vi .bash_profile
 ============================================
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

export ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE
export ORACLE_SID=XE

PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin

export PATH  
=============================================
[oracle@localhost ~]$ source .bash_profile
[oracle@localhost ~]$ echo $PATH /usr/local/bin:/usr/bin:/opt/java/jdk1.8/bin:/usr/local/sbin:/usr/sbin:/opt/java/jdk1.8/bin:/
home/oracle/.local/bin:/home/oracle/bin:/opt/oracle/product/18c/dbhomeXE/bin:/opt/java/jdk1.8/bin:/home/oracle/.local/bin:/home/oracle/bin:/opt/oracle/product/18c/dbhomeXE/bin

8. Oracle Listener Start 

[oracle@localhost ~]$ lsnrctl start
[oracle@localhost ~]$ lsnrctl status

LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 10-FEB-2020 15:35:20

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))) STATUS of the LISTENER
------------------------
Alias                   LISTENER
Version                 TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date               10-FEB-2020 14:02:40
Uptime                   0 days 1 hr. 32 min. 39 sec
Trace Level             off
Security                  ON: Local OS Authentication
SNMP                     OFF
Default Service            XE Listener Parameter File
.
.

9. Start Oracle

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Mon Feb 10 15:35:42 2020
Version 18.4.0.0.0

Copyright (c) 1982, 2018, Oracle. All rights reserved.

Connected to:
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0

SQL> startup;
ORACLE instance started.
SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
SQL> quit

9. Firewall

[oracle@localhost ~]$ su -
Password: 
 
Last login: Mon Feb 10 14:28:51 +07 2020 from 192.168.2.10 on pts/3
[root@localhost ~]# firewall-cmd --zone=public --add-port={1521,5500}/tcp --permanent
Warning: ALREADY_ENABLED: 1521:tcp
Warning: ALREADY_ENABLED: 5500:tcp
success
[root@localhost ~]# firewall-cmd --reload
success 

10. Oracle WEB login (sys / system)

https://192.168.x.x:5500/em/shell