Hi,
After installing XE 18c on to RHEL 8 and configuring the database I can connect to the instance from both SQL Plus on the local machine and SQL Developer from a remote windows machine. So that's all good.
However after the first reboot I can no longer connect. I suspect that this may be something to do with being on a virtual cloud machine? and IP addresses and host names not persisting post reboot?
I nuked the box and started over just to prove the theory and again everything works great until first reboot.
I would imagine I need to change something in my config to allow for the cloud network that but I'm not sure how to fix it. Any help would be greatly appreciated. I've tried to be as specific as possible and provide all the relevant info (that I know of). Please do let me know if I can provide any further information to aid with diagnosis.
Thanks
Environment / Components:
- AWS EC2 t3a.small instance
- Variable ECUs, 2 vCPUs, 2.2 GHz, AMD EPYC 7571, 2 GiB memory, EBS only
- Red Hat Enterprise Linux release 8.2 (Ootpa)
- oracle-database-xe-18c-1.0-1.x86_64
ORACLE_HOME and ORACLE_SID are set:
# echo $ORACLE_HOME
/opt/oracle/product/18c/dbhomeXE
# echo $ORACLE_SID
xe
TNSPING
# tnsping XE
TNS Ping Utility for Linux: Version 18.0.0.0.0 - Production on 27-MAY-2020 13:27:18
Copyright (c) 1997, 2018, Oracle. All rights reserved.
Used parameter files:
/opt/oracle/product/18c/dbhomeXE/network/admin/sqlnet.ora
Usd TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
OK (10 msec)
listener.ora
# listener.ora Network Configuration File: /opt/oracle/product/18c/dbhomeXE/network/admin/listener.ora
# Generated by Oracle configuration tools.
DEFAULT_SERVICE_LISTENER = XE
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
sqlnet.ora
# sqlnet.ora Network Configuration File: /opt/oracle/product/18c/dbhomeXE/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
tnsnames.ora
tnsnames.ora Network Configuration File: /opt/oracle/product/18c/dbhomeXE/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
LISTENER_XE =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
SQL Plus - Can't connect as sys to start the database.
# sqlplus /nolog
SQL*Plus: Release 18.0.0.0.0 - Production on Wed May 27 13:23:42 2020
Version 18.4.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
SQL>
SQL>
SQL> conn sys@xe / as sysdba
Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
SQL> conn / as sysdba
ERROR:
ORA-01017: invalid username/password; logon denied
Editing to add listener output
[root@ip-172-31-11-39 admin]# lsnrctl start
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 27-MAY-2020 13:34:58
Copyright (c) 1991, 2018, Oracle. All rights reserved.
Starting /opt/oracle/product/18c/dbhomeXE/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Log messages written to /opt/oracle/product/18c/dbhomeXE/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ip-xxxxx-xx-xx.eu-west-1.compute.internal)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date 27-MAY-2020 13:35:00
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /opt/oracle/product/18c/dbhomeXE/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ip-xxx-xx-xx-xx.eu-west-1.compute.internal)(PORT=1521)))
The listener supports no services
The command completed successfully
listener log
TNSLSNR for Linux: Version 18.0.0.0.0 - Production on 27-MAY-2020 13:35:00
Copyright (c) 1991, 2018, Oracle. All rights reserved.
LISTENER for Linux: Version 18.0.0.0.0 - Production
Version 18.4.0.0.0
Log messages written to /opt/oracle/product/18c/dbhomeXE/network/log/listener.log
Trace information written to /opt/oracle/product/18c/dbhomeXE/network/trace/listener.trc
Trace level is currently 0
NL-08014: Failed to initialize Diagnosability framework, falling back to old network tracing/logging
No valid ADR Base to use
NL-08013: Invalid ADR Base directory
Started with pid=1572
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ip-xxx-xx-xx-xx.eu-west-1.compute.internal)(PORT=1521)))
Listener completed notification to CRS on start
TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
27-MAY-2020 13:36:30 * (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XE)(CID=(PROGRAM=sqlplus)(HOST=ip-xxx-xx-xx-xx.eu-west-1.compute.internal)(USER=root))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=52734)) * establish * XE * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
27-MAY-2020 13:36:53 * (CONNECT_DATA=(SID=xe)(CID=(PROGRAM=SQL Developer)(HOST=__jdbc__)(USER=zzz.zzz))) * (ADDRESS=(PROTOCOL=tcp)(HOST=y.yy.yyy.y)(PORT=63276)) * establish * xe * 12505
TNS-12505: TNS:listener does not currently know of SID given in connect descriptor
27-MAY-2020 13:36:53 * (CONNECT_DATA=(CID=(PROGRAM=SQL Developer)(HOST=__jdbc__)(USER=zzz.zzz))(SID=xe)) * (ADDRESS=(PROTOCOL=tcp)(HOST=y.yy.yyy.y)(PORT=63277)) * establish * xe * 12505
TNS-12505: TNS:listener does not currently know of SID given in connect descriptor
27-MAY-2020 13:38:22 * (CONNECT_DATA=(CID=(PROGRAM=SQL Developer)(HOST=__jdbc__)(USER=zzz.zzz))(SERVICE_NAME=xepdb1)) * (ADDRESS=(PROTOCOL=tcp)(HOST=y.yy.yyy.y)(PORT=63812)) * establish * xepdb1 * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
Thanks again!