Search This Blog

Monday, 1 February 2021

Data Source Configuration to Connect to Oracle 19c DB

 Step 1) Setup Oracle DB

I will provide the documentation on how to setup oracle DB later.

Or refer this link - https://www.server-world.info/en/note?os=CentOS_8&p=oracle19c&f=2

Step 2) Start Oracle DB

[osboxes@machine1 database]$ pwd

/home/osboxes/database

[osboxes@machine1 database]$ . /usr/local/bin/oraenv

ORACLE_SID = [HRDATABASE] ? HRDATABASE

The Oracle base has been set to /home/osboxes/oracledb

[osboxes@machine1 database]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Feb 1 00:40:08 2021

Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> STARTUP

ORACLE instance started.

Total System Global Area  763359832 bytes

Fixed Size                  8901208 bytes

Variable Size             486539264 bytes

Database Buffers          264241152 bytes

Redo Buffers                3678208 bytes

Database mounted.

Database opened.

SQL> show user;

USER is "SYS"

SQL> exit

[osboxes@machine1 bin]$ pwd
/home/osboxes/database/bin

[osboxes@machine1 bin]$ lsnrctl start

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 01-FEB-2021 00:42:37

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

Starting /home/osboxes/database/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Log messages written to /home/osboxes/oracledb/diag/tnslsnr/machine1/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                01-FEB-2021 00:42:37
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /home/osboxes/oracledb/diag/tnslsnr/machine1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
The listener supports no services
The command completed successfully

Step 3) Configure Data Source with following specifications.

Name:  testOracleDS
JNDI Name:  testOracleDS
Database Type:  Oracle
Database Driver:  Oracle's Driver (Thin) for Service connections; Versions:Any
Database Name: HRDATABASE
Host Name:   machine1
Port:    1521
Database User Name: PBPUBLIC
Password:   PBPUBLIC
Initial Capacity:       5
Maximum Capacity:   15
Capacity Increment:    5
Login Delay:     1
Target:      Cluster_1



















Test Data Source Configuration



















Step 4) Deploy testds.war application

































Step 5) Test the Application Data Base connectivity on MangedServer_1 and ManagedServer_2

http://192.168.1.196:9002/testds/
http://192.168.1.196:9003/testds







Step 6) Verify the Logs 

[osboxes@machine1 logs]$ pwd
/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/servers/ManagedServer_1/logs
[osboxes@machine1 logs]$ tail  -5 ManagedServer_1.out
<Feb 1, 2021, 1:17:02,640 AM Eastern Standard Time> <Warning> <Socket> <BEA-000449> <Closing the socket, as no data read from it on 192.168.1.5:58,054 during the configured idle timeout of 5 seconds.>
Looking up the testOracleDS data source.
Getting the connection from the database.
Querying the database.
<Feb 1, 2021, 1:18:17,639 AM Eastern Standard Time> <Warning> <Socket> <BEA-000449> <Closing the socket, as no data read from it on 192.168.1.5:58,060 during the configured idle timeout of 5 seconds.>

/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/servers/ManagedServer_2/logs
[osboxes@machine1 logs]$ tail  -5 ManagedServer_2.out
<Feb 1, 2021, 1:19:49,782 AM Eastern Standard Time> <Warning> <Socket> <BEA-000449> <Closing the socket, as no data read from it on 192.168.1.5:58,077 during the configured idle timeout of 5 seconds.>
Looking up the testOracleDS data source.
Getting the connection from the database.
Querying the database.
<Feb 1, 2021, 1:20:34,781 AM Eastern Standard Time> <Warning> <Socket> <BEA-000449> <Closing the socket, as no data read from it on 192.168.1.5:58,081 during the configured idle timeout of 5 seconds.>
[osboxes@machine1 logs]$





No comments: